diff --git a/.gitignore b/.gitignore index 5b9e8fdc4a3b..c307000df9d4 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ Generated Files AppPackages BundleArtifacts .vs/ +*.VC.db # Ignore files build by ndk and eclipse libs/ @@ -149,3 +150,7 @@ tests/cpp-tests/Resources/audio /*/*/*/prebuilt-mk/Android.mk /*/*/*/*/prebuilt-mk/Android.mk *.xcscmblueprint +tests/cpp-empty-test/proj.tizen/res/ +tests/cpp-tests/proj.tizen/res/ +tests/lua-empty-test/project/proj.tizen/res/ +tests/lua-tests/project/proj.tizen/res/ diff --git a/CHANGELOG b/CHANGELOG index 15135ddc212a..439f6a7708b8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,11 +1,16 @@ -cocos2d-x-3.11 ?? 2016 +cocos2d-x-3.11.1 May 27 2016 -[REFINE] add optional alpha parameter to Color4B and Color4F constructors +[HIGHLIGHT] Supports IPv6-only network -cocos2d-x-3.11 Apr ? 2016 +[FIX] Fix `cocos gen-libs` compiling issue + +cocos2d-x-3.11 May 11 2016 [HIGHLIGHT] Physics: upgrade chipmunk to v7.0.1 [HIGHLIGHT] JS: new memory model, don't have to use retain/release in JS +[HIGHLIGHT] Curl: upgrade to v7.48 +[HIGHLIGHT] OpenSSL: upgrade to 1.0.2g +[HIGHLIGHT] JS: can use Firefox 30+ and VSCode to debug cocos2d-x JSB programs [NEW] JS: web console is enabled debugging JSB projects via firefox [NEW] UI: add a setter for touch total time threshold in ScrollView @@ -26,14 +31,22 @@ cocos2d-x-3.11 Apr ? 2016 [REFINE] Renderer: TriangleCommand and QuadCommand are merged [REFINE] 2D: SpriteFrameCache takes pixelFormat into account if specified [REFINE] UI: let ScrollView swallow touch events by default +[REFINE] JSB: make selectedSprite optional [FIX] JS: firefox v30+ can not debug cocos2d-x JSB projects [FIX] UI: can not get event when PageView was turning [FIX] UI: bitmap font sizes are not loaded from binary .fnt files -[FIX] 2D: TargetedAction::isDone() always return false -[FIX] 2D: some fonts were rendered incorreclty +[FIX] UI: some fonts were rendered incorreclty +[FIX] Action: TargetedAction::isDone() always return false +[FIX] Action: Repeat: will run actions more than speicific times, instant action will run one frame later [FIX] 2D: drawing in incorrect app state on iOS -[FIX] 2D: FileUtils::getValueVectorFromFile() returns wrong value on iOS and Mac +[FIX] Platform: FileUtils::getValueVectorFromFile() returns wrong value on iOS and Mac +[FIX] Network: downloader crashed when storage path contains spaces on iOS +[FIX] Network: downloader may crash on Android +[FIX] HTTPAsyncConnection: crash when custom SSL certification is set on iOS +[FIX] AssetsManagerEX: will stuck at UPDATING forever if last task fails +[FIX] AssetsManagerEX: may repeatly update some assets and cause file write conflict +[FIX] Lua: fix display.wrapScene() cocos2d-x-3.10 Jan 11 2016 diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 745889429bbf..50969a798928 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -120,8 +120,6 @@ 15EFA66F198B356E000C57D3 /* libluacocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EFA665198B33EE000C57D3 /* libluacocos2d iOS.a */; }; 15EFA68B198B3AD8000C57D3 /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; }; 15EFA68D198B3AD8000C57D3 /* libluacocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15EFA665198B33EE000C57D3 /* libluacocos2d iOS.a */; }; - 182C5CBA1A95B2FD00C30D34 /* CocosStudio3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 182C5CB81A95B2FD00C30D34 /* CocosStudio3DTest.cpp */; }; - 182C5CBB1A95B30500C30D34 /* CocosStudio3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 182C5CB81A95B2FD00C30D34 /* CocosStudio3DTest.cpp */; }; 182C5CCE1A95D9BA00C30D34 /* src in Resources */ = {isa = PBXBuildFile; fileRef = 182C5CCC1A95D9BA00C30D34 /* src */; }; 182C5CD01A95D9BA00C30D34 /* src in Resources */ = {isa = PBXBuildFile; fileRef = 182C5CCC1A95D9BA00C30D34 /* src */; }; 185663581B4155D3009EF2AE /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 826294421AAF071500CB7CF7 /* Security.framework */; }; @@ -229,10 +227,6 @@ 1A0EE43318CDF799004CD58F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA39E18CD9EE50087CE3A /* UIKit.framework */; }; 1A0EE43418CDF799004CD58F /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA39C18CD9ED80087CE3A /* AVFoundation.framework */; }; 1A0EE43518CDF799004CD58F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; }; - 1A1645A6191B6281008C7C7F /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 1A221C9B191771E300FD2BE4 /* ccs-res */; }; - 1A1645A9191B6283008C7C7F /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 1A221C9B191771E300FD2BE4 /* ccs-res */; }; - 1A221C9C191771E300FD2BE4 /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 1A221C9B191771E300FD2BE4 /* ccs-res */; }; - 1A221C9D191771E400FD2BE4 /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 1A221C9B191771E300FD2BE4 /* ccs-res */; }; 1AAF534D180E2F4E000584C8 /* libcocos2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2d Mac.a */; }; 1AAF5400180E39D4000584C8 /* libcocos2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2d iOS.a */; }; 1ABCA28718CD91510087CE3A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; }; @@ -374,26 +368,6 @@ 1AC35B7218CECF0C00F37B72 /* TestHeaderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359D518CECF0B00F37B72 /* TestHeaderLayer.cpp */; }; 1AC35B7318CECF0C00F37B72 /* TimelineCallbackTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359DA18CECF0B00F37B72 /* TimelineCallbackTestLayer.cpp */; }; 1AC35B7418CECF0C00F37B72 /* TimelineCallbackTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359DA18CECF0B00F37B72 /* TimelineCallbackTestLayer.cpp */; }; - 1AC35B7518CECF0C00F37B72 /* ArmatureScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359DD18CECF0B00F37B72 /* ArmatureScene.cpp */; }; - 1AC35B7618CECF0C00F37B72 /* ArmatureScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359DD18CECF0B00F37B72 /* ArmatureScene.cpp */; }; - 1AC35B7718CECF0C00F37B72 /* ComponentsTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E018CECF0B00F37B72 /* ComponentsTestScene.cpp */; }; - 1AC35B7818CECF0C00F37B72 /* ComponentsTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E018CECF0B00F37B72 /* ComponentsTestScene.cpp */; }; - 1AC35B7918CECF0C00F37B72 /* EnemyController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E218CECF0B00F37B72 /* EnemyController.cpp */; }; - 1AC35B7A18CECF0C00F37B72 /* EnemyController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E218CECF0B00F37B72 /* EnemyController.cpp */; }; - 1AC35B7B18CECF0C00F37B72 /* GameOverScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E418CECF0B00F37B72 /* GameOverScene.cpp */; }; - 1AC35B7C18CECF0C00F37B72 /* GameOverScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E418CECF0B00F37B72 /* GameOverScene.cpp */; }; - 1AC35B7D18CECF0C00F37B72 /* PlayerController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E618CECF0B00F37B72 /* PlayerController.cpp */; }; - 1AC35B7E18CECF0C00F37B72 /* PlayerController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E618CECF0B00F37B72 /* PlayerController.cpp */; }; - 1AC35B7F18CECF0C00F37B72 /* ProjectileController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E818CECF0B00F37B72 /* ProjectileController.cpp */; }; - 1AC35B8018CECF0C00F37B72 /* ProjectileController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E818CECF0B00F37B72 /* ProjectileController.cpp */; }; - 1AC35B8118CECF0C00F37B72 /* SceneController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359EA18CECF0B00F37B72 /* SceneController.cpp */; }; - 1AC35B8218CECF0C00F37B72 /* SceneController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359EA18CECF0B00F37B72 /* SceneController.cpp */; }; - 1AC35BDB18CECF0C00F37B72 /* SceneEditorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A5918CECF0B00F37B72 /* SceneEditorTest.cpp */; }; - 1AC35BDC18CECF0C00F37B72 /* SceneEditorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A5918CECF0B00F37B72 /* SceneEditorTest.cpp */; }; - 1AC35BDD18CECF0C00F37B72 /* acts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A5C18CECF0B00F37B72 /* acts.cpp */; }; - 1AC35BDE18CECF0C00F37B72 /* acts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A5C18CECF0B00F37B72 /* acts.cpp */; }; - 1AC35BDF18CECF0C00F37B72 /* cons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A5E18CECF0B00F37B72 /* cons.cpp */; }; - 1AC35BE018CECF0C00F37B72 /* cons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A5E18CECF0B00F37B72 /* cons.cpp */; }; 1AC35BE118CECF0C00F37B72 /* CCControlButtonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A6318CECF0B00F37B72 /* CCControlButtonTest.cpp */; }; 1AC35BE218CECF0C00F37B72 /* CCControlButtonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A6318CECF0B00F37B72 /* CCControlButtonTest.cpp */; }; 1AC35BE318CECF0C00F37B72 /* CCControlColourPickerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A6618CECF0B00F37B72 /* CCControlColourPickerTest.cpp */; }; @@ -684,112 +658,48 @@ 29080D1D191B574B0066F8DF /* UITest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D1A191B574B0066F8DF /* UITest.cpp */; }; 29080D8D191B595E0066F8DF /* CocosGUIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */; }; 29080D8E191B595E0066F8DF /* CocosGUIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */; }; - 29080D8F191B595E0066F8DF /* CocoStudioGUITest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D21191B595E0066F8DF /* CocoStudioGUITest.cpp */; }; - 29080D90191B595E0066F8DF /* CocoStudioGUITest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D21191B595E0066F8DF /* CocoStudioGUITest.cpp */; }; - 29080D91191B595E0066F8DF /* CustomGUIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D23191B595E0066F8DF /* CustomGUIScene.cpp */; }; - 29080D92191B595E0066F8DF /* CustomGUIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D23191B595E0066F8DF /* CustomGUIScene.cpp */; }; - 29080D93191B595E0066F8DF /* CustomImageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D27191B595E0066F8DF /* CustomImageTest.cpp */; }; - 29080D94191B595E0066F8DF /* CustomImageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D27191B595E0066F8DF /* CustomImageTest.cpp */; }; - 29080D95191B595E0066F8DF /* CustomParticleWidgetTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D2A191B595E0066F8DF /* CustomParticleWidgetTest.cpp */; }; - 29080D96191B595E0066F8DF /* CustomParticleWidgetTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D2A191B595E0066F8DF /* CustomParticleWidgetTest.cpp */; }; - 29080D97191B595E0066F8DF /* CustomImageView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D2D191B595E0066F8DF /* CustomImageView.cpp */; }; - 29080D98191B595E0066F8DF /* CustomImageView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D2D191B595E0066F8DF /* CustomImageView.cpp */; }; - 29080D99191B595E0066F8DF /* CustomImageViewReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D2F191B595E0066F8DF /* CustomImageViewReader.cpp */; }; - 29080D9A191B595E0066F8DF /* CustomImageViewReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D2F191B595E0066F8DF /* CustomImageViewReader.cpp */; }; - 29080D9B191B595E0066F8DF /* CustomParticleWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D31191B595E0066F8DF /* CustomParticleWidget.cpp */; }; - 29080D9C191B595E0066F8DF /* CustomParticleWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D31191B595E0066F8DF /* CustomParticleWidget.cpp */; }; - 29080D9D191B595E0066F8DF /* CustomParticleWidgetReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D33191B595E0066F8DF /* CustomParticleWidgetReader.cpp */; }; - 29080D9E191B595E0066F8DF /* CustomParticleWidgetReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D33191B595E0066F8DF /* CustomParticleWidgetReader.cpp */; }; - 29080D9F191B595E0066F8DF /* CustomReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D35191B595E0066F8DF /* CustomReader.cpp */; }; - 29080DA0191B595E0066F8DF /* CustomReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D35191B595E0066F8DF /* CustomReader.cpp */; }; - 29080DA1191B595E0066F8DF /* GUIEditorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D37191B595E0066F8DF /* GUIEditorTest.cpp */; }; - 29080DA2191B595E0066F8DF /* GUIEditorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D37191B595E0066F8DF /* GUIEditorTest.cpp */; }; 29080DA3191B595E0066F8DF /* UIButtonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D3A191B595E0066F8DF /* UIButtonTest.cpp */; }; 29080DA4191B595E0066F8DF /* UIButtonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D3A191B595E0066F8DF /* UIButtonTest.cpp */; }; - 29080DA5191B595E0066F8DF /* UIButtonTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D3C191B595E0066F8DF /* UIButtonTest_Editor.cpp */; }; - 29080DA6191B595E0066F8DF /* UIButtonTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D3C191B595E0066F8DF /* UIButtonTest_Editor.cpp */; }; 29080DA7191B595E0066F8DF /* UICheckBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D3F191B595E0066F8DF /* UICheckBoxTest.cpp */; }; 29080DA8191B595E0066F8DF /* UICheckBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D3F191B595E0066F8DF /* UICheckBoxTest.cpp */; }; - 29080DA9191B595E0066F8DF /* UICheckBoxTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D41191B595E0066F8DF /* UICheckBoxTest_Editor.cpp */; }; - 29080DAA191B595E0066F8DF /* UICheckBoxTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D41191B595E0066F8DF /* UICheckBoxTest_Editor.cpp */; }; 29080DAB191B595E0066F8DF /* UIFocusTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D44191B595E0066F8DF /* UIFocusTest.cpp */; }; 29080DAC191B595E0066F8DF /* UIFocusTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D44191B595E0066F8DF /* UIFocusTest.cpp */; }; 29080DAD191B595E0066F8DF /* UIImageViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D47191B595E0066F8DF /* UIImageViewTest.cpp */; }; 29080DAE191B595E0066F8DF /* UIImageViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D47191B595E0066F8DF /* UIImageViewTest.cpp */; }; - 29080DAF191B595E0066F8DF /* UIImageViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D49191B595E0066F8DF /* UIImageViewTest_Editor.cpp */; }; - 29080DB0191B595E0066F8DF /* UIImageViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D49191B595E0066F8DF /* UIImageViewTest_Editor.cpp */; }; 29080DB1191B595E0066F8DF /* UILayoutTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D4C191B595E0066F8DF /* UILayoutTest.cpp */; }; 29080DB2191B595E0066F8DF /* UILayoutTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D4C191B595E0066F8DF /* UILayoutTest.cpp */; }; - 29080DB3191B595E0066F8DF /* UILayoutTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D4E191B595E0066F8DF /* UILayoutTest_Editor.cpp */; }; - 29080DB4191B595E0066F8DF /* UILayoutTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D4E191B595E0066F8DF /* UILayoutTest_Editor.cpp */; }; 29080DB5191B595E0066F8DF /* UIListViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D51191B595E0066F8DF /* UIListViewTest.cpp */; }; 29080DB6191B595E0066F8DF /* UIListViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D51191B595E0066F8DF /* UIListViewTest.cpp */; }; - 29080DB7191B595E0066F8DF /* UIListViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D53191B595E0066F8DF /* UIListViewTest_Editor.cpp */; }; - 29080DB8191B595E0066F8DF /* UIListViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D53191B595E0066F8DF /* UIListViewTest_Editor.cpp */; }; 29080DB9191B595E0066F8DF /* UILoadingBarTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D56191B595E0066F8DF /* UILoadingBarTest.cpp */; }; 29080DBA191B595E0066F8DF /* UILoadingBarTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D56191B595E0066F8DF /* UILoadingBarTest.cpp */; }; - 29080DBB191B595E0066F8DF /* UILoadingBarTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D58191B595E0066F8DF /* UILoadingBarTest_Editor.cpp */; }; - 29080DBC191B595E0066F8DF /* UILoadingBarTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D58191B595E0066F8DF /* UILoadingBarTest_Editor.cpp */; }; 29080DBD191B595E0066F8DF /* UIPageViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D5B191B595E0066F8DF /* UIPageViewTest.cpp */; }; 29080DBE191B595E0066F8DF /* UIPageViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D5B191B595E0066F8DF /* UIPageViewTest.cpp */; }; - 29080DBF191B595E0066F8DF /* UIPageViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D5D191B595E0066F8DF /* UIPageViewTest_Editor.cpp */; }; - 29080DC0191B595E0066F8DF /* UIPageViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D5D191B595E0066F8DF /* UIPageViewTest_Editor.cpp */; }; 29080DC1191B595E0066F8DF /* UIRichTextTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D60191B595E0066F8DF /* UIRichTextTest.cpp */; }; 29080DC2191B595E0066F8DF /* UIRichTextTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D60191B595E0066F8DF /* UIRichTextTest.cpp */; }; 29080DC3191B595E0066F8DF /* UIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D62191B595E0066F8DF /* UIScene.cpp */; }; 29080DC4191B595E0066F8DF /* UIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D62191B595E0066F8DF /* UIScene.cpp */; }; - 29080DC5191B595E0066F8DF /* UIScene_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D64191B595E0066F8DF /* UIScene_Editor.cpp */; }; - 29080DC6191B595E0066F8DF /* UIScene_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D64191B595E0066F8DF /* UIScene_Editor.cpp */; }; 29080DC7191B595E0066F8DF /* UISceneManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D66191B595E0066F8DF /* UISceneManager.cpp */; }; 29080DC8191B595E0066F8DF /* UISceneManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D66191B595E0066F8DF /* UISceneManager.cpp */; }; - 29080DC9191B595E0066F8DF /* UISceneManager_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D68191B595E0066F8DF /* UISceneManager_Editor.cpp */; }; - 29080DCA191B595E0066F8DF /* UISceneManager_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D68191B595E0066F8DF /* UISceneManager_Editor.cpp */; }; 29080DCB191B595E0066F8DF /* UIScrollViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D6B191B595E0066F8DF /* UIScrollViewTest.cpp */; }; 29080DCC191B595E0066F8DF /* UIScrollViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D6B191B595E0066F8DF /* UIScrollViewTest.cpp */; }; - 29080DCD191B595E0066F8DF /* UIScrollViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D6D191B595E0066F8DF /* UIScrollViewTest_Editor.cpp */; }; - 29080DCE191B595E0066F8DF /* UIScrollViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D6D191B595E0066F8DF /* UIScrollViewTest_Editor.cpp */; }; 29080DCF191B595E0066F8DF /* UISliderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D70191B595E0066F8DF /* UISliderTest.cpp */; }; 29080DD0191B595E0066F8DF /* UISliderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D70191B595E0066F8DF /* UISliderTest.cpp */; }; - 29080DD1191B595E0066F8DF /* UISliderTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D72191B595E0066F8DF /* UISliderTest_Editor.cpp */; }; - 29080DD2191B595E0066F8DF /* UISliderTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D72191B595E0066F8DF /* UISliderTest_Editor.cpp */; }; 29080DD3191B595E0066F8DF /* UITextAtlasTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D75191B595E0066F8DF /* UITextAtlasTest.cpp */; }; 29080DD4191B595E0066F8DF /* UITextAtlasTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D75191B595E0066F8DF /* UITextAtlasTest.cpp */; }; - 29080DD5191B595E0066F8DF /* UITextAtlasTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D77191B595E0066F8DF /* UITextAtlasTest_Editor.cpp */; }; - 29080DD6191B595E0066F8DF /* UITextAtlasTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D77191B595E0066F8DF /* UITextAtlasTest_Editor.cpp */; }; 29080DD7191B595E0066F8DF /* UITextBMFontTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D7A191B595E0066F8DF /* UITextBMFontTest.cpp */; }; 29080DD8191B595E0066F8DF /* UITextBMFontTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D7A191B595E0066F8DF /* UITextBMFontTest.cpp */; }; - 29080DD9191B595E0066F8DF /* UITextBMFontTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D7C191B595E0066F8DF /* UITextBMFontTest_Editor.cpp */; }; - 29080DDA191B595E0066F8DF /* UITextBMFontTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D7C191B595E0066F8DF /* UITextBMFontTest_Editor.cpp */; }; 29080DDB191B595E0066F8DF /* UITextFieldTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D7F191B595E0066F8DF /* UITextFieldTest.cpp */; }; 29080DDC191B595E0066F8DF /* UITextFieldTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D7F191B595E0066F8DF /* UITextFieldTest.cpp */; }; - 29080DDD191B595E0066F8DF /* UITextFieldTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D81191B595E0066F8DF /* UITextFieldTest_Editor.cpp */; }; - 29080DDE191B595E0066F8DF /* UITextFieldTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D81191B595E0066F8DF /* UITextFieldTest_Editor.cpp */; }; 29080DDF191B595E0066F8DF /* UITextTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D84191B595E0066F8DF /* UITextTest.cpp */; }; 29080DE0191B595E0066F8DF /* UITextTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D84191B595E0066F8DF /* UITextTest.cpp */; }; - 29080DE1191B595E0066F8DF /* UITextTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D86191B595E0066F8DF /* UITextTest_Editor.cpp */; }; - 29080DE2191B595E0066F8DF /* UITextTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D86191B595E0066F8DF /* UITextTest_Editor.cpp */; }; 29080DE3191B595E0066F8DF /* UIWidgetAddNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D89191B595E0066F8DF /* UIWidgetAddNodeTest.cpp */; }; 29080DE4191B595E0066F8DF /* UIWidgetAddNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D89191B595E0066F8DF /* UIWidgetAddNodeTest.cpp */; }; - 29080DE5191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; }; - 29080DE6191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; }; - 290E94B5196FC16900694919 /* CocostudioParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */; }; - 290E94B6196FC16900694919 /* CocostudioParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */; }; 292CF01419A1965E00E8E6A0 /* UIEditBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292CF01219A1965E00E8E6A0 /* UIEditBoxTest.cpp */; }; 292CF01519A1965E00E8E6A0 /* UIEditBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292CF01219A1965E00E8E6A0 /* UIEditBoxTest.cpp */; }; 295824591987415900F9746D /* UIScale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 295824571987415900F9746D /* UIScale9SpriteTest.cpp */; }; 2958245A1987415900F9746D /* UIScale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 295824571987415900F9746D /* UIScale9SpriteTest.cpp */; }; 298D7F6F19AC31F300FF096D /* UIWebViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 298D7F6D19AC31F300FF096D /* UIWebViewTest.cpp */; }; 29AFEF6719ACCAA000F6B10A /* Test.html in Resources */ = {isa = PBXBuildFile; fileRef = 29AFEF6619ACCAA000F6B10A /* Test.html */; }; - 29FBBBFE196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */; }; - 29FBBBFF196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */; }; - 3825CC491A2C982A00C92EA8 /* CustomRootNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3825CC431A2C982A00C92EA8 /* CustomRootNode.cpp */; }; - 3825CC4A1A2C982A00C92EA8 /* CustomRootNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3825CC431A2C982A00C92EA8 /* CustomRootNode.cpp */; }; - 3825CC4B1A2C982A00C92EA8 /* CustomRootNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3825CC451A2C982A00C92EA8 /* CustomRootNodeReader.cpp */; }; - 3825CC4C1A2C982A00C92EA8 /* CustomRootNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3825CC451A2C982A00C92EA8 /* CustomRootNodeReader.cpp */; }; - 3825CC4D1A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3825CC471A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.cpp */; }; - 3825CC4E1A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3825CC471A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.cpp */; }; - 38FA2E73194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */; }; - 38FA2E74194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */; }; 38FA2E76194AECF800FF2BE4 /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; }; 38FA2E77194AECF800FF2BE4 /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; }; 3E2BDAD019BEA3410055CDCD /* NewAudioEngineTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E2BDACE19BEA3410055CDCD /* NewAudioEngineTest.cpp */; }; @@ -846,6 +756,8 @@ 3EA0FB5E191B92F100B170C8 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; }; 3EA0FB66191B933000B170C8 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; 3EA0FB72191C844400B170C8 /* UIVideoPlayerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */; }; + 460629781CDB4DBA00B44058 /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 460629771CDB4DBA00B44058 /* ccs-res */; }; + 460629791CDB4DBA00B44058 /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 460629771CDB4DBA00B44058 /* ccs-res */; }; 4B5C5BA81CA1147300D55A14 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 826294421AAF071500CB7CF7 /* Security.framework */; }; 4B5C5BA91CA1147F00D55A14 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 826294421AAF071500CB7CF7 /* Security.framework */; }; 4B5C5BAB1CA1149900D55A14 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B5C5BAA1CA1149900D55A14 /* Security.framework */; }; @@ -861,6 +773,9 @@ 4B5C5BB61CA114E100D55A14 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B5C5BB41CA114DB00D55A14 /* Security.framework */; }; 4B5C5BB71CA114E700D55A14 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B5C5BB41CA114DB00D55A14 /* Security.framework */; }; 4B5C5BB81CA114EE00D55A14 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B5C5BB41CA114DB00D55A14 /* Security.framework */; }; + 500D1CD31CF4A48B00535D35 /* Bug-15594.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500D1CD11CF4A48B00535D35 /* Bug-15594.cpp */; }; + 500D1CD41CF4A48B00535D35 /* Bug-15594.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500D1CD11CF4A48B00535D35 /* Bug-15594.cpp */; }; + 500D1CD51CF4A48B00535D35 /* Bug-15594.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500D1CD11CF4A48B00535D35 /* Bug-15594.cpp */; }; 5046AB4A1AF2A8D80060550B /* MaterialSystemTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5046AB481AF2A8D80060550B /* MaterialSystemTest.cpp */; }; 5046AB4B1AF2A8D80060550B /* MaterialSystemTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5046AB481AF2A8D80060550B /* MaterialSystemTest.cpp */; }; 5046AB5B1AF2C4180060550B /* Materials in Resources */ = {isa = PBXBuildFile; fileRef = 5046AB5A1AF2C4180060550B /* Materials */; }; @@ -874,7 +789,6 @@ 507B41081C31BEA60067B53E /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35C7518CECF1400F37B72 /* Default@2x.png */; }; 507B41091C31BEA60067B53E /* effect1.raw in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35CB518CED84500F37B72 /* effect1.raw */; }; 507B410A1C31BEA60067B53E /* TerrainTest in Resources */ = {isa = PBXBuildFile; fileRef = B603F1B31AC8FBFB00A9579C /* TerrainTest */; }; - 507B410B1C31BEA60067B53E /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 1A221C9B191771E300FD2BE4 /* ccs-res */; }; 507B410C1C31BEA60067B53E /* Icon-29.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35C7B18CECF1400F37B72 /* Icon-29.png */; }; 507B410D1C31BEA60067B53E /* TileMaps in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35CC818CED84500F37B72 /* TileMaps */; }; 507B410E1C31BEA60067B53E /* Particles in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35CC318CED84500F37B72 /* Particles */; }; @@ -928,7 +842,6 @@ 507B413F1C31BEA60067B53E /* Bug-886.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3598618CECF0B00F37B72 /* Bug-886.cpp */; }; 507B41401C31BEA60067B53E /* CCControlButtonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A6318CECF0B00F37B72 /* CCControlButtonTest.cpp */; }; 507B41411C31BEA60067B53E /* CCControlSliderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7018CECF0B00F37B72 /* CCControlSliderTest.cpp */; }; - 507B41421C31BEA60067B53E /* UILayoutTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D4E191B595E0066F8DF /* UILayoutTest_Editor.cpp */; }; 507B41431C31BEA60067B53E /* SpineTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AF218CECF0C00F37B72 /* SpineTest.cpp */; }; 507B41441C31BEA60067B53E /* Physics3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6CAB54C1AF9AA6C00B9B856 /* Physics3DTest.cpp */; }; 507B41451C31BEA60067B53E /* NewRendererTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AB618CECF0C00F37B72 /* NewRendererTest.cpp */; }; @@ -937,7 +850,6 @@ 507B41481C31BEA60067B53E /* AnimationsTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359B818CECF0B00F37B72 /* AnimationsTestLayer.cpp */; }; 507B41491C31BEA60067B53E /* CocosGUIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */; }; 507B414A1C31BEA60067B53E /* WebSocketTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8218CECF0B00F37B72 /* WebSocketTest.cpp */; }; - 507B414B1C31BEA60067B53E /* ActionTimelineTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */; }; 507B414C1C31BEA60067B53E /* UIScale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 295824571987415900F9746D /* UIScale9SpriteTest.cpp */; }; 507B414D1C31BEA60067B53E /* Particle3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B639932C1A490EC700B07923 /* Particle3DTest.cpp */; }; 507B414E1C31BEA60067B53E /* Bug-1174.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3597918CECF0B00F37B72 /* Bug-1174.cpp */; }; @@ -945,17 +857,11 @@ 507B41501C31BEA60067B53E /* UITextAtlasTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D75191B595E0066F8DF /* UITextAtlasTest.cpp */; }; 507B41511C31BEA60067B53E /* ActionsEaseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3592C18CECF0A00F37B72 /* ActionsEaseTest.cpp */; }; 507B41521C31BEA60067B53E /* MutiTouchTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AB018CECF0C00F37B72 /* MutiTouchTest.cpp */; }; - 507B41531C31BEA60067B53E /* UIListViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D53191B595E0066F8DF /* UIListViewTest_Editor.cpp */; }; - 507B41541C31BEA60067B53E /* UILoadingBarTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D58191B595E0066F8DF /* UILoadingBarTest_Editor.cpp */; }; 507B41551C31BEA60067B53E /* testsAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35C7218CECF1400F37B72 /* testsAppDelegate.mm */; }; - 507B41561C31BEA60067B53E /* CustomImageView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D2D191B595E0066F8DF /* CustomImageView.cpp */; }; 507B41571C31BEA60067B53E /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3593418CECF0A00F37B72 /* AppDelegate.cpp */; }; 507B41581C31BEA60067B53E /* Bug-1159.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3597718CECF0B00F37B72 /* Bug-1159.cpp */; }; 507B41591C31BEA60067B53E /* UILoadingBarTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D56191B595E0066F8DF /* UILoadingBarTest.cpp */; }; - 507B415A1C31BEA60067B53E /* CustomParticleWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D31191B595E0066F8DF /* CustomParticleWidget.cpp */; }; 507B415B1C31BEA60067B53E /* SceneTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AE718CECF0C00F37B72 /* SceneTest.cpp */; }; - 507B415C1C31BEA60067B53E /* CustomImageViewReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D2F191B595E0066F8DF /* CustomImageViewReader.cpp */; }; - 507B415D1C31BEA60067B53E /* UITextAtlasTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D77191B595E0066F8DF /* UITextAtlasTest_Editor.cpp */; }; 507B415E1C31BEA60067B53E /* MenuTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359C818CECF0B00F37B72 /* MenuTestLayer.cpp */; }; 507B415F1C31BEA60067B53E /* ClippingNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3599518CECF0B00F37B72 /* ClippingNodeTest.cpp */; }; 507B41601C31BEA60067B53E /* LayerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AA718CECF0C00F37B72 /* LayerTest.cpp */; }; @@ -967,24 +873,18 @@ 507B41661C31BEA60067B53E /* UserDefaultTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35B1818CECF0C00F37B72 /* UserDefaultTest.cpp */; }; 507B41671C31BEA60067B53E /* UITest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D1A191B574B0066F8DF /* UITest.cpp */; }; 507B41681C31BEA60067B53E /* Camera3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E9E75CE199324CB005B7047 /* Camera3DTest.cpp */; }; - 507B41691C31BEA60067B53E /* CustomReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D35191B595E0066F8DF /* CustomReader.cpp */; }; 507B416A1C31BEA60067B53E /* ParallaxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35ABC18CECF0C00F37B72 /* ParallaxTest.cpp */; }; 507B416B1C31BEA60067B53E /* ZwoptexTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35B1D18CECF0C00F37B72 /* ZwoptexTest.cpp */; }; 507B416C1C31BEA60067B53E /* VibrateTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35C6D18CECF0C00F37B72 /* VibrateTest.cpp */; }; - 507B416D1C31BEA60067B53E /* ComponentsTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E018CECF0B00F37B72 /* ComponentsTestScene.cpp */; }; 507B416E1C31BEA60067B53E /* Bug-914.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3598A18CECF0B00F37B72 /* Bug-914.cpp */; }; 507B416F1C31BEA60067B53E /* EffectsAdvancedTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359AF18CECF0B00F37B72 /* EffectsAdvancedTest.cpp */; }; 507B41701C31BEA60067B53E /* Paddle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35B0D18CECF0C00F37B72 /* Paddle.cpp */; }; 507B41711C31BEA60067B53E /* UIPageViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D5B191B595E0066F8DF /* UIPageViewTest.cpp */; }; - 507B41721C31BEA60067B53E /* SceneEditorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A5918CECF0B00F37B72 /* SceneEditorTest.cpp */; }; 507B41731C31BEA60067B53E /* Scene3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0BD49FC1AFAFEE50046CCE3 /* Scene3DTest.cpp */; }; 507B41741C31BEA60067B53E /* OpenURLTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5030C3319D059DA000E78E7 /* OpenURLTest.cpp */; }; 507B41751C31BEA60067B53E /* BugsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3598C18CECF0B00F37B72 /* BugsTest.cpp */; }; 507B41761C31BEA60067B53E /* testBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AF718CECF0C00F37B72 /* testBasic.cpp */; }; - 507B41771C31BEA60067B53E /* EnemyController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E218CECF0B00F37B72 /* EnemyController.cpp */; }; - 507B41781C31BEA60067B53E /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; }; 507B41791C31BEA60067B53E /* CocosBuilderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359BE18CECF0B00F37B72 /* CocosBuilderTest.cpp */; }; - 507B417A1C31BEA60067B53E /* UITextFieldTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D81191B595E0066F8DF /* UITextFieldTest_Editor.cpp */; }; 507B417B1C31BEA60067B53E /* QuestionContainerSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3598218CECF0B00F37B72 /* QuestionContainerSprite.cpp */; }; 507B417C1C31BEA60067B53E /* DrawPrimitivesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359AC18CECF0B00F37B72 /* DrawPrimitivesTest.cpp */; }; 507B417D1C31BEA60067B53E /* UITextFieldTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D7F191B595E0066F8DF /* UITextFieldTest.cpp */; }; @@ -996,43 +896,33 @@ 507B41831C31BEA60067B53E /* ActionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3593218CECF0A00F37B72 /* ActionsTest.cpp */; }; 507B41841C31BEA60067B53E /* ShaderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AED18CECF0C00F37B72 /* ShaderTest.cpp */; }; 507B41851C31BEA60067B53E /* BillBoardTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B609E67119C18DAD003D0074 /* BillBoardTest.cpp */; }; - 507B41861C31BEA60067B53E /* Bug-PageViewLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D71B4B7A3600F60F10 /* Bug-PageViewLayout.cpp */; }; 507B41871C31BEA60067B53E /* TileMapTest2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C04F93581941B05400E9FEAB /* TileMapTest2.cpp */; }; 507B41881C31BEA60067B53E /* Bug-624.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3598418CECF0B00F37B72 /* Bug-624.cpp */; }; 507B41891C31BEA60067B53E /* SocketIOTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8018CECF0B00F37B72 /* SocketIOTest.cpp */; }; 507B418A1C31BEA60067B53E /* SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AF518CECF0C00F37B72 /* SpriteTest.cpp */; }; 507B418B1C31BEA60067B53E /* NewAudioEngineTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E2BDACE19BEA3410055CDCD /* NewAudioEngineTest.cpp */; }; 507B418C1C31BEA60067B53E /* FileUtilsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A9018CECF0B00F37B72 /* FileUtilsTest.cpp */; }; - 507B418D1C31BEA60067B53E /* CustomRootNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3825CC451A2C982A00C92EA8 /* CustomRootNodeReader.cpp */; }; 507B418E1C31BEA60067B53E /* CurlTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359A318CECF0B00F37B72 /* CurlTest.cpp */; }; 507B418F1C31BEA60067B53E /* CustomTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8B18CECF0B00F37B72 /* CustomTableViewCell.cpp */; }; - 507B41901C31BEA60067B53E /* CustomGUIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D23191B595E0066F8DF /* CustomGUIScene.cpp */; }; 507B41911C31BEA60067B53E /* CCControlSwitchTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7618CECF0B00F37B72 /* CCControlSwitchTest.cpp */; }; 507B41921C31BEA60067B53E /* BaseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3593618CECF0A00F37B72 /* BaseTest.cpp */; }; - 507B41931C31BEA60067B53E /* PlayerController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E618CECF0B00F37B72 /* PlayerController.cpp */; }; 507B41941C31BEA60067B53E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35C8418CECF1400F37B72 /* main.m */; }; 507B41951C31BEA60067B53E /* UIScrollViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D6B191B595E0066F8DF /* UIScrollViewTest.cpp */; }; 507B41961C31BEA60067B53E /* CCControlScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A6B18CECF0B00F37B72 /* CCControlScene.cpp */; }; - 507B41971C31BEA60067B53E /* UICheckBoxTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D41191B595E0066F8DF /* UICheckBoxTest_Editor.cpp */; }; 507B41981C31BEA60067B53E /* DataVisitorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359A918CECF0B00F37B72 /* DataVisitorTest.cpp */; }; 507B41991C31BEA60067B53E /* CurrentLanguageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359A618CECF0B00F37B72 /* CurrentLanguageTest.cpp */; }; - 507B419A1C31BEA60067B53E /* UITextTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D86191B595E0066F8DF /* UITextTest_Editor.cpp */; }; 507B419B1C31BEA60067B53E /* UICheckBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D3F191B595E0066F8DF /* UICheckBoxTest.cpp */; }; 507B419C1C31BEA60067B53E /* Bug-350.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3597B18CECF0B00F37B72 /* Bug-350.cpp */; }; - 507B419D1C31BEA60067B53E /* UITextBMFontTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D7C191B595E0066F8DF /* UITextBMFontTest_Editor.cpp */; }; 507B419E1C31BEA60067B53E /* SchedulerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AEA18CECF0C00F37B72 /* SchedulerTest.cpp */; }; 507B419F1C31BEA60067B53E /* Texture2dTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AFF18CECF0C00F37B72 /* Texture2dTest.cpp */; }; 507B41A01C31BEA60067B53E /* MouseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A9618CECF0B00F37B72 /* MouseTest.cpp */; }; 507B41A11C31BEA60067B53E /* Ball.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35B0B18CECF0C00F37B72 /* Ball.cpp */; }; - 507B41A21C31BEA60067B53E /* GameOverScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E418CECF0B00F37B72 /* GameOverScene.cpp */; }; 507B41A31C31BEA60067B53E /* ExtensionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7B18CECF0B00F37B72 /* ExtensionsTest.cpp */; }; 507B41A41C31BEA60067B53E /* TestEntries.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3594218CECF0A00F37B72 /* TestEntries.cpp */; }; 507B41A51C31BEA60067B53E /* AssetsManagerExTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15B3709619EE5DBA00ABE682 /* AssetsManagerExTest.cpp */; }; 507B41A61C31BEA60067B53E /* Box2dTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3593918CECF0A00F37B72 /* Box2dTest.cpp */; }; - 507B41A71C31BEA60067B53E /* UISceneManager_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D68191B595E0066F8DF /* UISceneManager_Editor.cpp */; }; 507B41A81C31BEA60067B53E /* LabelTestNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AA418CECF0C00F37B72 /* LabelTestNew.cpp */; }; 507B41A91C31BEA60067B53E /* ChipmunkTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3598F18CECF0B00F37B72 /* ChipmunkTest.cpp */; }; - 507B41AA1C31BEA60067B53E /* cons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A5E18CECF0B00F37B72 /* cons.cpp */; }; 507B41AB1C31BEA60067B53E /* ConsoleTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3599E18CECF0B00F37B72 /* ConsoleTest.cpp */; }; 507B41AC1C31BEA60067B53E /* IntervalTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A9918CECF0B00F37B72 /* IntervalTest.cpp */; }; 507B41AD1C31BEA60067B53E /* UISliderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D70191B595E0066F8DF /* UISliderTest.cpp */; }; @@ -1046,25 +936,16 @@ 507B41B51C31BEA60067B53E /* UIRichTextTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D60191B595E0066F8DF /* UIRichTextTest.cpp */; }; 507B41B71C31BEA60067B53E /* Bug-899.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3598818CECF0B00F37B72 /* Bug-899.cpp */; }; 507B41B81C31BEA60067B53E /* NewEventDispatcherTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AB318CECF0C00F37B72 /* NewEventDispatcherTest.cpp */; }; - 507B41B91C31BEA60067B53E /* UIScrollViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D6D191B595E0066F8DF /* UIScrollViewTest_Editor.cpp */; }; - 507B41BA1C31BEA60067B53E /* acts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A5C18CECF0B00F37B72 /* acts.cpp */; }; - 507B41BB1C31BEA60067B53E /* ArmatureScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359DD18CECF0B00F37B72 /* ArmatureScene.cpp */; }; - 507B41BC1C31BEA60067B53E /* SceneController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359EA18CECF0B00F37B72 /* SceneController.cpp */; }; - 507B41BD1C31BEA60067B53E /* UISliderTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D72191B595E0066F8DF /* UISliderTest_Editor.cpp */; }; 507B41BE1C31BEA60067B53E /* Test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3594018CECF0A00F37B72 /* Test.cpp */; }; 507B41BF1C31BEA60067B53E /* ParticleTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35ABF18CECF0C00F37B72 /* ParticleTest.cpp */; }; 507B41C01C31BEA60067B53E /* TouchesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35B0F18CECF0C00F37B72 /* TouchesTest.cpp */; }; - 507B41C11C31BEA60067B53E /* UIImageViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D49191B595E0066F8DF /* UIImageViewTest_Editor.cpp */; }; 507B41C21C31BEA60067B53E /* TransitionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35B1218CECF0C00F37B72 /* TransitionsTest.cpp */; }; 507B41C31C31BEA60067B53E /* RotateWorldTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AE418CECF0C00F37B72 /* RotateWorldTest.cpp */; }; 507B41C41C31BEA60067B53E /* ActionsProgressTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3592F18CECF0A00F37B72 /* ActionsProgressTest.cpp */; }; 507B41C51C31BEA60067B53E /* EffectsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359B218CECF0B00F37B72 /* EffectsTest.cpp */; }; 507B41C61C31BEA60067B53E /* TestHeaderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359D518CECF0B00F37B72 /* TestHeaderLayer.cpp */; }; 507B41C71C31BEA60067B53E /* ActionManagerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3592918CECF0A00F37B72 /* ActionManagerTest.cpp */; }; - 507B41C81C31BEA60067B53E /* CocoStudioGUITest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D21191B595E0066F8DF /* CocoStudioGUITest.cpp */; }; 507B41C91C31BEA60067B53E /* PhysicsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35ADB18CECF0C00F37B72 /* PhysicsTest.cpp */; }; - 507B41CA1C31BEA60067B53E /* CustomRootNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3825CC431A2C982A00C92EA8 /* CustomRootNode.cpp */; }; - 507B41CB1C31BEA60067B53E /* UIScene_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D64191B595E0066F8DF /* UIScene_Editor.cpp */; }; 507B41CC1C31BEA60067B53E /* UILayoutTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D4C191B595E0066F8DF /* UILayoutTest.cpp */; }; 507B41CD1C31BEA60067B53E /* ButtonTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359BB18CECF0B00F37B72 /* ButtonTestLayer.cpp */; }; 507B41CE1C31BEA60067B53E /* UIListViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D51191B595E0066F8DF /* UIListViewTest.cpp */; }; @@ -1080,35 +961,24 @@ 507B41D81C31BEA60067B53E /* DownloaderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50921EAD1B746D5F00C085CC /* DownloaderTest.cpp */; }; 507B41D91C31BEA60067B53E /* TextureCacheTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35B0218CECF0C00F37B72 /* TextureCacheTest.cpp */; }; 507B41DA1C31BEA60067B53E /* HelloCocosBuilderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359C118CECF0B00F37B72 /* HelloCocosBuilderLayer.cpp */; }; - 507B41DB1C31BEA60067B53E /* CustomParticleWidgetTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D2A191B595E0066F8DF /* CustomParticleWidgetTest.cpp */; }; 507B41DC1C31BEA60067B53E /* UITextTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D84191B595E0066F8DF /* UITextTest.cpp */; }; - 507B41DD1C31BEA60067B53E /* UIPageViewTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D5D191B595E0066F8DF /* UIPageViewTest_Editor.cpp */; }; 507B41DE1C31BEA60067B53E /* TableViewTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8D18CECF0B00F37B72 /* TableViewTestScene.cpp */; }; 507B41DF1C31BEA60067B53E /* ShaderTest2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35AEF18CECF0C00F37B72 /* ShaderTest2.cpp */; }; 507B41E01C31BEA60067B53E /* UnitTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35B1518CECF0C00F37B72 /* UnitTest.cpp */; }; - 507B41E11C31BEA60067B53E /* CocostudioParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */; }; 507B41E21C31BEA60067B53E /* Bug-458.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3598018CECF0B00F37B72 /* Bug-458.cpp */; }; 507B41E31C31BEA60067B53E /* UIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D62191B595E0066F8DF /* UIScene.cpp */; }; 507B41E41C31BEA60067B53E /* CocosDenshionTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3599818CECF0B00F37B72 /* CocosDenshionTest.cpp */; }; - 507B41E51C31BEA60067B53E /* ProjectileController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359E818CECF0B00F37B72 /* ProjectileController.cpp */; }; - 507B41E61C31BEA60067B53E /* CustomWidgetCallbackBindTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3825CC471A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.cpp */; }; 507B41E71C31BEA60067B53E /* Sprite3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E92EA801921A1400094CD21 /* Sprite3DTest.cpp */; }; 507B41E81C31BEA60067B53E /* controller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359A018CECF0B00F37B72 /* controller.cpp */; }; 507B41E91C31BEA60067B53E /* CCControlSceneManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A6D18CECF0B00F37B72 /* CCControlSceneManager.cpp */; }; - 507B41EA1C31BEA60067B53E /* CocosStudio3DTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 182C5CB81A95B2FD00C30D34 /* CocosStudio3DTest.cpp */; }; 507B41EB1C31BEA60067B53E /* TimelineCallbackTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC359DA18CECF0B00F37B72 /* TimelineCallbackTestLayer.cpp */; }; 507B41EC1C31BEA60067B53E /* Bug-CCDrawNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D51B4B7A3600F60F10 /* Bug-CCDrawNode.cpp */; }; - 507B41ED1C31BEA60067B53E /* CustomParticleWidgetReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D33191B595E0066F8DF /* CustomParticleWidgetReader.cpp */; }; 507B41EE1C31BEA60067B53E /* NotificationCenterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8518CECF0B00F37B72 /* NotificationCenterTest.cpp */; }; - 507B41EF1C31BEA60067B53E /* CocostudioParserJsonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */; }; 507B41F01C31BEA60067B53E /* NavMeshTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6DD2FFA1B04979C00E47F5F /* NavMeshTest.cpp */; }; 507B41F11C31BEA60067B53E /* LightTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6C039D719C95D83007207DC /* LightTest.cpp */; }; - 507B41F21C31BEA60067B53E /* GUIEditorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D37191B595E0066F8DF /* GUIEditorTest.cpp */; }; - 507B41F31C31BEA60067B53E /* CustomImageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D27191B595E0066F8DF /* CustomImageTest.cpp */; }; 507B41F41C31BEA60067B53E /* Bug-422.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3597D18CECF0B00F37B72 /* Bug-422.cpp */; }; 507B41F51C31BEA60067B53E /* UIFocusTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D44191B595E0066F8DF /* UIFocusTest.cpp */; }; 507B41F61C31BEA60067B53E /* HttpClientTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7E18CECF0B00F37B72 /* HttpClientTest.cpp */; }; - 507B41F81C31BEA60067B53E /* UIButtonTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D3C191B595E0066F8DF /* UIButtonTest_Editor.cpp */; }; 507B41F91C31BEA60067B53E /* ClickAndMoveTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3599218CECF0B00F37B72 /* ClickAndMoveTest.cpp */; }; 507B41FA1C31BEA60067B53E /* TerrainTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B603F1AD1AC8EA4E00A9579C /* TerrainTest.cpp */; }; 507B41FC1C31BEA60067B53E /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = ED545A721B68A1AC00C3958E /* libiconv.dylib */; }; @@ -1222,7 +1092,6 @@ 507B43A51C31FB670067B53E /* audio in Resources */ = {isa = PBXBuildFile; fileRef = 3E2BDAD119BEA3E20055CDCD /* audio */; }; 507B43A61C31FB670067B53E /* CocosBuilderExample.ccbproj in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35CAF18CED84500F37B72 /* CocosBuilderExample.ccbproj */; }; 507B43A71C31FB670067B53E /* animations in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35CA918CED84500F37B72 /* animations */; }; - 507B43A81C31FB670067B53E /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 1A221C9B191771E300FD2BE4 /* ccs-res */; }; 507B43A91C31FB670067B53E /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35D9018CEE5D100F37B72 /* Icon-72.png */; }; 507B43AA1C31FB670067B53E /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35D9118CEE5D100F37B72 /* Icon-76.png */; }; 507B43AB1C31FB670067B53E /* effect1.raw in Resources */ = {isa = PBXBuildFile; fileRef = 1AC35CB518CED84500F37B72 /* effect1.raw */; }; @@ -1365,8 +1234,6 @@ 850F8A251B5F3A4F00780603 /* Bug-12847.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 850F8A221B5F3A4F00780603 /* Bug-12847.cpp */; }; 94D793D91B4B7A3600F60F10 /* Bug-CCDrawNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D51B4B7A3600F60F10 /* Bug-CCDrawNode.cpp */; }; 94D793DA1B4B7A3600F60F10 /* Bug-CCDrawNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D51B4B7A3600F60F10 /* Bug-CCDrawNode.cpp */; }; - 94D793DB1B4B7A3600F60F10 /* Bug-PageViewLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D71B4B7A3600F60F10 /* Bug-PageViewLayout.cpp */; }; - 94D793DC1B4B7A3600F60F10 /* Bug-PageViewLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D71B4B7A3600F60F10 /* Bug-PageViewLayout.cpp */; }; A05FCACA177C124500BE600E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; }; A07A521E1783A1D20073F6A7 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; }; A07A521F1783A1D20073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; }; @@ -1965,8 +1832,6 @@ 15CBA9EB196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lua_cocos2dx_controller_auto.cpp; path = "../../../../cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp"; sourceTree = ""; }; 15CBA9EC196F7BD8005877BB /* lua_cocos2dx_controller_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = lua_cocos2dx_controller_auto.hpp; path = "../../../../cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.hpp"; sourceTree = ""; }; 15EE465A19A7200300AF29F1 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../external/curl/prebuilt/ios/libcurl.a; sourceTree = ""; }; - 182C5CB81A95B2FD00C30D34 /* CocosStudio3DTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CocosStudio3DTest.cpp; path = CocosStudio3DTest/CocosStudio3DTest.cpp; sourceTree = ""; }; - 182C5CB91A95B2FD00C30D34 /* CocosStudio3DTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CocosStudio3DTest.h; path = CocosStudio3DTest/CocosStudio3DTest.h; sourceTree = ""; }; 182C5CCC1A95D9BA00C30D34 /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = "../tests/lua-tests/src"; sourceTree = ""; }; 185663081B41511B009EF2AE /* cocos2d_js_bindings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_js_bindings.xcodeproj; path = "../cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj"; sourceTree = ""; }; 185663941B4155D4009EF2AE /* js-tests Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "js-tests Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -2014,7 +1879,6 @@ 1A0EE31418CDF733004CD58F /* lua-empty-test Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "lua-empty-test Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1A0EE41318CDF775004CD58F /* cpp-empty-test iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cpp-empty-test iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1A0EE47E18CDF799004CD58F /* lua-empty-test iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "lua-empty-test iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A221C9B191771E300FD2BE4 /* ccs-res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "ccs-res"; path = "../tests/cpp-tests/Resources/ccs-res"; sourceTree = ""; }; 1A9F808C177E98A600D9A1CB /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; 1ABCA27618CD90A40087CE3A /* cocos2d_lua_bindings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_lua_bindings.xcodeproj; path = "../cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj"; sourceTree = ""; }; 1ABCA28618CD91510087CE3A /* lua-tests Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "lua-tests Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -2219,27 +2083,6 @@ 1AC359D918CECF0B00F37B72 /* TimelineCallbackLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineCallbackLayerLoader.h; sourceTree = ""; }; 1AC359DA18CECF0B00F37B72 /* TimelineCallbackTestLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineCallbackTestLayer.cpp; sourceTree = ""; }; 1AC359DB18CECF0B00F37B72 /* TimelineCallbackTestLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineCallbackTestLayer.h; sourceTree = ""; }; - 1AC359DD18CECF0B00F37B72 /* ArmatureScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ArmatureScene.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; - 1AC359DE18CECF0B00F37B72 /* ArmatureScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArmatureScene.h; sourceTree = ""; }; - 1AC359E018CECF0B00F37B72 /* ComponentsTestScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComponentsTestScene.cpp; sourceTree = ""; }; - 1AC359E118CECF0B00F37B72 /* ComponentsTestScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComponentsTestScene.h; sourceTree = ""; }; - 1AC359E218CECF0B00F37B72 /* EnemyController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnemyController.cpp; sourceTree = ""; }; - 1AC359E318CECF0B00F37B72 /* EnemyController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnemyController.h; sourceTree = ""; }; - 1AC359E418CECF0B00F37B72 /* GameOverScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameOverScene.cpp; sourceTree = ""; }; - 1AC359E518CECF0B00F37B72 /* GameOverScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameOverScene.h; sourceTree = ""; }; - 1AC359E618CECF0B00F37B72 /* PlayerController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlayerController.cpp; sourceTree = ""; }; - 1AC359E718CECF0B00F37B72 /* PlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerController.h; sourceTree = ""; }; - 1AC359E818CECF0B00F37B72 /* ProjectileController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProjectileController.cpp; sourceTree = ""; }; - 1AC359E918CECF0B00F37B72 /* ProjectileController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectileController.h; sourceTree = ""; }; - 1AC359EA18CECF0B00F37B72 /* SceneController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneController.cpp; sourceTree = ""; }; - 1AC359EB18CECF0B00F37B72 /* SceneController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneController.h; sourceTree = ""; }; - 1AC35A5918CECF0B00F37B72 /* SceneEditorTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneEditorTest.cpp; sourceTree = ""; }; - 1AC35A5A18CECF0B00F37B72 /* SceneEditorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneEditorTest.h; sourceTree = ""; }; - 1AC35A5C18CECF0B00F37B72 /* acts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = acts.cpp; sourceTree = ""; }; - 1AC35A5D18CECF0B00F37B72 /* acts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acts.h; sourceTree = ""; }; - 1AC35A5E18CECF0B00F37B72 /* cons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cons.cpp; sourceTree = ""; }; - 1AC35A5F18CECF0B00F37B72 /* cons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cons.h; sourceTree = ""; }; - 1AC35A6018CECF0B00F37B72 /* EventDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventDef.h; sourceTree = ""; }; 1AC35A6318CECF0B00F37B72 /* CCControlButtonTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButtonTest.cpp; sourceTree = ""; }; 1AC35A6418CECF0B00F37B72 /* CCControlButtonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlButtonTest.h; sourceTree = ""; }; 1AC35A6618CECF0B00F37B72 /* CCControlColourPickerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlColourPickerTest.cpp; sourceTree = ""; }; @@ -2470,96 +2313,42 @@ 29080D1B191B574B0066F8DF /* UITest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UITest.h; path = UITest/UITest.h; sourceTree = ""; }; 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosGUIScene.cpp; sourceTree = ""; }; 29080D20191B595E0066F8DF /* CocosGUIScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosGUIScene.h; sourceTree = ""; }; - 29080D21191B595E0066F8DF /* CocoStudioGUITest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CocoStudioGUITest.cpp; path = UITest/CocoStudioGUITest/CocoStudioGUITest.cpp; sourceTree = ""; }; - 29080D22191B595E0066F8DF /* CocoStudioGUITest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CocoStudioGUITest.h; path = UITest/CocoStudioGUITest/CocoStudioGUITest.h; sourceTree = ""; }; - 29080D23191B595E0066F8DF /* CustomGUIScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomGUIScene.cpp; path = ../CustomGUIScene.cpp; sourceTree = ""; }; - 29080D24191B595E0066F8DF /* CustomGUIScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomGUIScene.h; path = ../CustomGUIScene.h; sourceTree = ""; }; - 29080D27191B595E0066F8DF /* CustomImageTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomImageTest.cpp; sourceTree = ""; }; - 29080D28191B595E0066F8DF /* CustomImageTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomImageTest.h; sourceTree = ""; }; - 29080D2A191B595E0066F8DF /* CustomParticleWidgetTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomParticleWidgetTest.cpp; sourceTree = ""; }; - 29080D2B191B595E0066F8DF /* CustomParticleWidgetTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomParticleWidgetTest.h; sourceTree = ""; }; - 29080D2D191B595E0066F8DF /* CustomImageView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomImageView.cpp; sourceTree = ""; }; - 29080D2E191B595E0066F8DF /* CustomImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomImageView.h; sourceTree = ""; }; - 29080D2F191B595E0066F8DF /* CustomImageViewReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomImageViewReader.cpp; sourceTree = ""; }; - 29080D30191B595E0066F8DF /* CustomImageViewReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomImageViewReader.h; sourceTree = ""; }; - 29080D31191B595E0066F8DF /* CustomParticleWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomParticleWidget.cpp; sourceTree = ""; }; - 29080D32191B595E0066F8DF /* CustomParticleWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomParticleWidget.h; sourceTree = ""; }; - 29080D33191B595E0066F8DF /* CustomParticleWidgetReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomParticleWidgetReader.cpp; sourceTree = ""; }; - 29080D34191B595E0066F8DF /* CustomParticleWidgetReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomParticleWidgetReader.h; sourceTree = ""; }; - 29080D35191B595E0066F8DF /* CustomReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomReader.cpp; sourceTree = ""; }; - 29080D36191B595E0066F8DF /* CustomReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomReader.h; sourceTree = ""; }; - 29080D37191B595E0066F8DF /* GUIEditorTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIEditorTest.cpp; sourceTree = ""; }; - 29080D38191B595E0066F8DF /* GUIEditorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIEditorTest.h; sourceTree = ""; }; 29080D3A191B595E0066F8DF /* UIButtonTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIButtonTest.cpp; sourceTree = ""; }; 29080D3B191B595E0066F8DF /* UIButtonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIButtonTest.h; sourceTree = ""; }; - 29080D3C191B595E0066F8DF /* UIButtonTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIButtonTest_Editor.cpp; sourceTree = ""; }; - 29080D3D191B595E0066F8DF /* UIButtonTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIButtonTest_Editor.h; sourceTree = ""; }; 29080D3F191B595E0066F8DF /* UICheckBoxTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UICheckBoxTest.cpp; sourceTree = ""; }; 29080D40191B595E0066F8DF /* UICheckBoxTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICheckBoxTest.h; sourceTree = ""; }; - 29080D41191B595E0066F8DF /* UICheckBoxTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UICheckBoxTest_Editor.cpp; sourceTree = ""; }; - 29080D42191B595E0066F8DF /* UICheckBoxTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICheckBoxTest_Editor.h; sourceTree = ""; }; 29080D44191B595E0066F8DF /* UIFocusTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIFocusTest.cpp; sourceTree = ""; }; 29080D45191B595E0066F8DF /* UIFocusTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIFocusTest.h; sourceTree = ""; }; 29080D47191B595E0066F8DF /* UIImageViewTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIImageViewTest.cpp; sourceTree = ""; }; 29080D48191B595E0066F8DF /* UIImageViewTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIImageViewTest.h; sourceTree = ""; }; - 29080D49191B595E0066F8DF /* UIImageViewTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIImageViewTest_Editor.cpp; sourceTree = ""; }; - 29080D4A191B595E0066F8DF /* UIImageViewTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIImageViewTest_Editor.h; sourceTree = ""; }; 29080D4C191B595E0066F8DF /* UILayoutTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILayoutTest.cpp; sourceTree = ""; }; 29080D4D191B595E0066F8DF /* UILayoutTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayoutTest.h; sourceTree = ""; }; - 29080D4E191B595E0066F8DF /* UILayoutTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILayoutTest_Editor.cpp; sourceTree = ""; }; - 29080D4F191B595E0066F8DF /* UILayoutTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayoutTest_Editor.h; sourceTree = ""; }; 29080D51191B595E0066F8DF /* UIListViewTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIListViewTest.cpp; sourceTree = ""; }; 29080D52191B595E0066F8DF /* UIListViewTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIListViewTest.h; sourceTree = ""; }; - 29080D53191B595E0066F8DF /* UIListViewTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIListViewTest_Editor.cpp; sourceTree = ""; }; - 29080D54191B595E0066F8DF /* UIListViewTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIListViewTest_Editor.h; sourceTree = ""; }; 29080D56191B595E0066F8DF /* UILoadingBarTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILoadingBarTest.cpp; sourceTree = ""; }; 29080D57191B595E0066F8DF /* UILoadingBarTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILoadingBarTest.h; sourceTree = ""; }; - 29080D58191B595E0066F8DF /* UILoadingBarTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILoadingBarTest_Editor.cpp; sourceTree = ""; }; - 29080D59191B595E0066F8DF /* UILoadingBarTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILoadingBarTest_Editor.h; sourceTree = ""; }; 29080D5B191B595E0066F8DF /* UIPageViewTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIPageViewTest.cpp; sourceTree = ""; }; 29080D5C191B595E0066F8DF /* UIPageViewTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIPageViewTest.h; sourceTree = ""; }; - 29080D5D191B595E0066F8DF /* UIPageViewTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIPageViewTest_Editor.cpp; sourceTree = ""; }; - 29080D5E191B595E0066F8DF /* UIPageViewTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIPageViewTest_Editor.h; sourceTree = ""; }; 29080D60191B595E0066F8DF /* UIRichTextTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIRichTextTest.cpp; sourceTree = ""; }; 29080D61191B595E0066F8DF /* UIRichTextTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIRichTextTest.h; sourceTree = ""; }; 29080D62191B595E0066F8DF /* UIScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScene.cpp; sourceTree = ""; }; 29080D63191B595E0066F8DF /* UIScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScene.h; sourceTree = ""; }; - 29080D64191B595E0066F8DF /* UIScene_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScene_Editor.cpp; sourceTree = ""; }; - 29080D65191B595E0066F8DF /* UIScene_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScene_Editor.h; sourceTree = ""; }; 29080D66191B595E0066F8DF /* UISceneManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UISceneManager.cpp; sourceTree = ""; }; 29080D67191B595E0066F8DF /* UISceneManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISceneManager.h; sourceTree = ""; }; - 29080D68191B595E0066F8DF /* UISceneManager_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UISceneManager_Editor.cpp; sourceTree = ""; }; - 29080D69191B595E0066F8DF /* UISceneManager_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISceneManager_Editor.h; sourceTree = ""; }; 29080D6B191B595E0066F8DF /* UIScrollViewTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScrollViewTest.cpp; sourceTree = ""; }; 29080D6C191B595E0066F8DF /* UIScrollViewTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScrollViewTest.h; sourceTree = ""; }; - 29080D6D191B595E0066F8DF /* UIScrollViewTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScrollViewTest_Editor.cpp; sourceTree = ""; }; - 29080D6E191B595E0066F8DF /* UIScrollViewTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScrollViewTest_Editor.h; sourceTree = ""; }; 29080D70191B595E0066F8DF /* UISliderTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UISliderTest.cpp; sourceTree = ""; }; 29080D71191B595E0066F8DF /* UISliderTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISliderTest.h; sourceTree = ""; }; - 29080D72191B595E0066F8DF /* UISliderTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UISliderTest_Editor.cpp; sourceTree = ""; }; - 29080D73191B595E0066F8DF /* UISliderTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISliderTest_Editor.h; sourceTree = ""; }; 29080D75191B595E0066F8DF /* UITextAtlasTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextAtlasTest.cpp; sourceTree = ""; }; 29080D76191B595E0066F8DF /* UITextAtlasTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextAtlasTest.h; sourceTree = ""; }; - 29080D77191B595E0066F8DF /* UITextAtlasTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextAtlasTest_Editor.cpp; sourceTree = ""; }; - 29080D78191B595E0066F8DF /* UITextAtlasTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextAtlasTest_Editor.h; sourceTree = ""; }; 29080D7A191B595E0066F8DF /* UITextBMFontTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextBMFontTest.cpp; sourceTree = ""; }; 29080D7B191B595E0066F8DF /* UITextBMFontTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextBMFontTest.h; sourceTree = ""; }; - 29080D7C191B595E0066F8DF /* UITextBMFontTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextBMFontTest_Editor.cpp; sourceTree = ""; }; - 29080D7D191B595E0066F8DF /* UITextBMFontTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextBMFontTest_Editor.h; sourceTree = ""; }; 29080D7F191B595E0066F8DF /* UITextFieldTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextFieldTest.cpp; sourceTree = ""; }; 29080D80191B595E0066F8DF /* UITextFieldTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextFieldTest.h; sourceTree = ""; }; - 29080D81191B595E0066F8DF /* UITextFieldTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextFieldTest_Editor.cpp; sourceTree = ""; }; - 29080D82191B595E0066F8DF /* UITextFieldTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextFieldTest_Editor.h; sourceTree = ""; }; 29080D84191B595E0066F8DF /* UITextTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextTest.cpp; sourceTree = ""; }; 29080D85191B595E0066F8DF /* UITextTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextTest.h; sourceTree = ""; }; - 29080D86191B595E0066F8DF /* UITextTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextTest_Editor.cpp; sourceTree = ""; }; - 29080D87191B595E0066F8DF /* UITextTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextTest_Editor.h; sourceTree = ""; }; 29080D89191B595E0066F8DF /* UIWidgetAddNodeTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidgetAddNodeTest.cpp; sourceTree = ""; }; 29080D8A191B595E0066F8DF /* UIWidgetAddNodeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest.h; sourceTree = ""; }; - 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidgetAddNodeTest_Editor.cpp; sourceTree = ""; }; - 29080D8C191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest_Editor.h; sourceTree = ""; }; - 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CocostudioParserTest.cpp; path = ../CocostudioParserTest.cpp; sourceTree = ""; }; - 290E94B4196FC16900694919 /* CocostudioParserTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CocostudioParserTest.h; path = ../CocostudioParserTest.h; sourceTree = ""; }; 292CF01219A1965E00E8E6A0 /* UIEditBoxTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBoxTest.cpp; sourceTree = ""; }; 292CF01319A1965E00E8E6A0 /* UIEditBoxTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxTest.h; sourceTree = ""; }; 295824571987415900F9746D /* UIScale9SpriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScale9SpriteTest.cpp; sourceTree = ""; }; @@ -2567,16 +2356,6 @@ 298D7F6D19AC31F300FF096D /* UIWebViewTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UIWebViewTest.cpp; path = UIWebViewTest/UIWebViewTest.cpp; sourceTree = ""; }; 298D7F6E19AC31F300FF096D /* UIWebViewTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIWebViewTest.h; path = UIWebViewTest/UIWebViewTest.h; sourceTree = ""; }; 29AFEF6619ACCAA000F6B10A /* Test.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = Test.html; path = "../tests/cpp-tests/Resources/Test.html"; sourceTree = ""; }; - 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocostudioParserJsonTest.cpp; sourceTree = ""; }; - 29FBBBFD196A9ECD00E65826 /* CocostudioParserJsonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocostudioParserJsonTest.h; sourceTree = ""; }; - 3825CC431A2C982A00C92EA8 /* CustomRootNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomRootNode.cpp; sourceTree = ""; }; - 3825CC441A2C982A00C92EA8 /* CustomRootNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomRootNode.h; sourceTree = ""; }; - 3825CC451A2C982A00C92EA8 /* CustomRootNodeReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomRootNodeReader.cpp; sourceTree = ""; }; - 3825CC461A2C982A00C92EA8 /* CustomRootNodeReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomRootNodeReader.h; sourceTree = ""; }; - 3825CC471A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomWidgetCallbackBindTest.cpp; sourceTree = ""; }; - 3825CC481A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomWidgetCallbackBindTest.h; sourceTree = ""; }; - 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActionTimelineTestScene.cpp; sourceTree = ""; }; - 38FA2E72194AEBE100FF2BE4 /* ActionTimelineTestScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionTimelineTestScene.h; sourceTree = ""; }; 38FA2E75194AECF800FF2BE4 /* ActionTimeline */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ActionTimeline; path = "../tests/cpp-tests/Resources/ActionTimeline"; sourceTree = ""; }; 3E2BDACE19BEA3410055CDCD /* NewAudioEngineTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewAudioEngineTest.cpp; sourceTree = ""; }; 3E2BDACF19BEA3410055CDCD /* NewAudioEngineTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewAudioEngineTest.h; sourceTree = ""; }; @@ -2624,9 +2403,12 @@ 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; }; 3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIVideoPlayerTest.cpp; sourceTree = ""; }; 3EA0FB71191C844400B170C8 /* UIVideoPlayerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoPlayerTest.h; sourceTree = ""; }; + 460629771CDB4DBA00B44058 /* ccs-res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "ccs-res"; path = "../tests/cpp-tests/Resources/ccs-res"; sourceTree = ""; }; 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = cocos2d_libs.xcodeproj; sourceTree = ""; }; 4B5C5BAA1CA1149900D55A14 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; 4B5C5BB41CA114DB00D55A14 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; + 500D1CD11CF4A48B00535D35 /* Bug-15594.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-15594.cpp"; sourceTree = ""; }; + 500D1CD21CF4A48B00535D35 /* Bug-15594.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-15594.h"; sourceTree = ""; }; 5046AB481AF2A8D80060550B /* MaterialSystemTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MaterialSystemTest.cpp; sourceTree = ""; }; 5046AB491AF2A8D80060550B /* MaterialSystemTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MaterialSystemTest.h; sourceTree = ""; }; 5046AB5A1AF2C4180060550B /* Materials */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Materials; path = "../tests/cpp-tests/Resources/Materials"; sourceTree = ""; }; @@ -2696,8 +2478,6 @@ 850F8A231B5F3A4F00780603 /* Bug-12847.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-12847.h"; sourceTree = ""; }; 94D793D51B4B7A3600F60F10 /* Bug-CCDrawNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-CCDrawNode.cpp"; sourceTree = ""; }; 94D793D61B4B7A3600F60F10 /* Bug-CCDrawNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-CCDrawNode.h"; sourceTree = ""; }; - 94D793D71B4B7A3600F60F10 /* Bug-PageViewLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-PageViewLayout.cpp"; sourceTree = ""; }; - 94D793D81B4B7A3600F60F10 /* Bug-PageViewLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-PageViewLayout.h"; sourceTree = ""; }; A035A71117822E9E00987F6C /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; A07A52291783A1D20073F6A7 /* cpp-tests iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cpp-tests iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; A07A52B71783AE6D0073F6A7 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; @@ -3329,15 +3109,6 @@ path = res; sourceTree = ""; }; - 182C5CB71A95B28A00C30D34 /* CocosStudio3DTest */ = { - isa = PBXGroup; - children = ( - 182C5CB81A95B2FD00C30D34 /* CocosStudio3DTest.cpp */, - 182C5CB91A95B2FD00C30D34 /* CocosStudio3DTest.h */, - ); - name = CocosStudio3DTest; - sourceTree = ""; - }; 185663091B41511B009EF2AE /* Products */ = { isa = PBXGroup; children = ( @@ -3572,7 +3343,6 @@ 5046AB471AF2A8D80060550B /* MaterialSystemTest */, 6886696E1AE8E8A000C2CFD9 /* SpritePolygonTest */, B603F1AC1AC8EA2E00A9579C /* TerrainTest */, - 182C5CB71A95B28A00C30D34 /* CocosStudio3DTest */, B639932B1A490E9900B07923 /* Particle3DTest */, D0FD03611A3B543700825BB5 /* AllocatorTest */, B6C039D619C95D28007207DC /* LightTest */, @@ -3777,8 +3547,6 @@ children = ( 94D793D51B4B7A3600F60F10 /* Bug-CCDrawNode.cpp */, 94D793D61B4B7A3600F60F10 /* Bug-CCDrawNode.h */, - 94D793D71B4B7A3600F60F10 /* Bug-PageViewLayout.cpp */, - 94D793D81B4B7A3600F60F10 /* Bug-PageViewLayout.h */, 1AC3597718CECF0B00F37B72 /* Bug-1159.cpp */, 1AC3597818CECF0B00F37B72 /* Bug-1159.h */, 1AC3597918CECF0B00F37B72 /* Bug-1174.cpp */, @@ -3802,6 +3570,8 @@ 59620E8E1921E5CF002021B6 /* Bug-Child.h */, 850F8A221B5F3A4F00780603 /* Bug-12847.cpp */, 850F8A231B5F3A4F00780603 /* Bug-12847.h */, + 500D1CD11CF4A48B00535D35 /* Bug-15594.cpp */, + 500D1CD21CF4A48B00535D35 /* Bug-15594.h */, ); path = BugsTest; sourceTree = ""; @@ -3929,11 +3699,7 @@ isa = PBXGroup; children = ( 15B3709519EE5DBA00ABE682 /* AssetsManagerExTest */, - 38FA2E70194AEBE100FF2BE4 /* CocoStudioActionTimelineTest */, 1AC359B518CECF0B00F37B72 /* CocosBuilderTest */, - 1AC359DC18CECF0B00F37B72 /* CocoStudioArmatureTest */, - 1AC359DF18CECF0B00F37B72 /* CocoStudioComponentsTest */, - 1AC35A5818CECF0B00F37B72 /* CocoStudioSceneTest */, 1AC35A6118CECF0B00F37B72 /* ControlExtensionTest */, 1AC35A7B18CECF0B00F37B72 /* ExtensionsTest.cpp */, 1AC35A7C18CECF0B00F37B72 /* ExtensionsTest.h */, @@ -4059,56 +3825,6 @@ path = TimelineCallbackTest; sourceTree = ""; }; - 1AC359DC18CECF0B00F37B72 /* CocoStudioArmatureTest */ = { - isa = PBXGroup; - children = ( - 1AC359DD18CECF0B00F37B72 /* ArmatureScene.cpp */, - 1AC359DE18CECF0B00F37B72 /* ArmatureScene.h */, - ); - path = CocoStudioArmatureTest; - sourceTree = ""; - }; - 1AC359DF18CECF0B00F37B72 /* CocoStudioComponentsTest */ = { - isa = PBXGroup; - children = ( - 1AC359E018CECF0B00F37B72 /* ComponentsTestScene.cpp */, - 1AC359E118CECF0B00F37B72 /* ComponentsTestScene.h */, - 1AC359E218CECF0B00F37B72 /* EnemyController.cpp */, - 1AC359E318CECF0B00F37B72 /* EnemyController.h */, - 1AC359E418CECF0B00F37B72 /* GameOverScene.cpp */, - 1AC359E518CECF0B00F37B72 /* GameOverScene.h */, - 1AC359E618CECF0B00F37B72 /* PlayerController.cpp */, - 1AC359E718CECF0B00F37B72 /* PlayerController.h */, - 1AC359E818CECF0B00F37B72 /* ProjectileController.cpp */, - 1AC359E918CECF0B00F37B72 /* ProjectileController.h */, - 1AC359EA18CECF0B00F37B72 /* SceneController.cpp */, - 1AC359EB18CECF0B00F37B72 /* SceneController.h */, - ); - path = CocoStudioComponentsTest; - sourceTree = ""; - }; - 1AC35A5818CECF0B00F37B72 /* CocoStudioSceneTest */ = { - isa = PBXGroup; - children = ( - 1AC35A5918CECF0B00F37B72 /* SceneEditorTest.cpp */, - 1AC35A5A18CECF0B00F37B72 /* SceneEditorTest.h */, - 1AC35A5B18CECF0B00F37B72 /* TriggerCode */, - ); - path = CocoStudioSceneTest; - sourceTree = ""; - }; - 1AC35A5B18CECF0B00F37B72 /* TriggerCode */ = { - isa = PBXGroup; - children = ( - 1AC35A5C18CECF0B00F37B72 /* acts.cpp */, - 1AC35A5D18CECF0B00F37B72 /* acts.h */, - 1AC35A5E18CECF0B00F37B72 /* cons.cpp */, - 1AC35A5F18CECF0B00F37B72 /* cons.h */, - 1AC35A6018CECF0B00F37B72 /* EventDef.h */, - ); - path = TriggerCode; - sourceTree = ""; - }; 1AC35A6118CECF0B00F37B72 /* ControlExtensionTest */ = { isa = PBXGroup; children = ( @@ -4589,6 +4305,7 @@ 1AC35CA818CED83500F37B72 /* Resources */ = { isa = PBXGroup; children = ( + 460629771CDB4DBA00B44058 /* ccs-res */, B61E90CA1B12B74B00BE69EA /* NavMesh */, 5046AB5A1AF2C4180060550B /* Materials */, B603F1B31AC8FBFB00A9579C /* TerrainTest */, @@ -4602,7 +4319,6 @@ 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */, 1AC35CA918CED84500F37B72 /* animations */, 1AC35CAE18CED84500F37B72 /* ccb */, - 1A221C9B191771E300FD2BE4 /* ccs-res */, 1AC35CB318CED84500F37B72 /* components */, 1AC35CB418CED84500F37B72 /* configs */, 1AC35CB818CED84500F37B72 /* extensions */, @@ -4820,72 +4536,16 @@ children = ( 29080D1A191B574B0066F8DF /* UITest.cpp */, 29080D1B191B574B0066F8DF /* UITest.h */, - 29080D21191B595E0066F8DF /* CocoStudioGUITest.cpp */, - 29080D22191B595E0066F8DF /* CocoStudioGUITest.h */, 29FBBC00196A9F0D00E65826 /* UIAndEditorTests */, - 29FBBBFB196A9ECD00E65826 /* CocostudioParserTest */, - 29080D25191B595E0066F8DF /* CustomTest */, ); name = UITest; sourceTree = ""; }; - 29080D25191B595E0066F8DF /* CustomTest */ = { - isa = PBXGroup; - children = ( - 3825CC421A2C982A00C92EA8 /* CustomWidgetCallbackBindTest */, - 29080D2C191B595E0066F8DF /* CustomWidget */, - 29080D23191B595E0066F8DF /* CustomGUIScene.cpp */, - 29080D24191B595E0066F8DF /* CustomGUIScene.h */, - 29080D26191B595E0066F8DF /* CustomImageTest */, - 29080D29191B595E0066F8DF /* CustomParticleWidgetTest */, - ); - name = CustomTest; - path = UITest/CocoStudioGUITest/CustomTest; - sourceTree = ""; - }; - 29080D26191B595E0066F8DF /* CustomImageTest */ = { - isa = PBXGroup; - children = ( - 29080D27191B595E0066F8DF /* CustomImageTest.cpp */, - 29080D28191B595E0066F8DF /* CustomImageTest.h */, - ); - path = CustomImageTest; - sourceTree = ""; - }; - 29080D29191B595E0066F8DF /* CustomParticleWidgetTest */ = { - isa = PBXGroup; - children = ( - 29080D2A191B595E0066F8DF /* CustomParticleWidgetTest.cpp */, - 29080D2B191B595E0066F8DF /* CustomParticleWidgetTest.h */, - ); - path = CustomParticleWidgetTest; - sourceTree = ""; - }; - 29080D2C191B595E0066F8DF /* CustomWidget */ = { - isa = PBXGroup; - children = ( - 29080D2D191B595E0066F8DF /* CustomImageView.cpp */, - 29080D2E191B595E0066F8DF /* CustomImageView.h */, - 29080D2F191B595E0066F8DF /* CustomImageViewReader.cpp */, - 29080D30191B595E0066F8DF /* CustomImageViewReader.h */, - 29080D31191B595E0066F8DF /* CustomParticleWidget.cpp */, - 29080D32191B595E0066F8DF /* CustomParticleWidget.h */, - 29080D33191B595E0066F8DF /* CustomParticleWidgetReader.cpp */, - 29080D34191B595E0066F8DF /* CustomParticleWidgetReader.h */, - 29080D35191B595E0066F8DF /* CustomReader.cpp */, - 29080D36191B595E0066F8DF /* CustomReader.h */, - ); - name = CustomWidget; - path = ../CustomWidget; - sourceTree = ""; - }; 29080D39191B595E0066F8DF /* UIButtonTest */ = { isa = PBXGroup; children = ( 29080D3A191B595E0066F8DF /* UIButtonTest.cpp */, 29080D3B191B595E0066F8DF /* UIButtonTest.h */, - 29080D3C191B595E0066F8DF /* UIButtonTest_Editor.cpp */, - 29080D3D191B595E0066F8DF /* UIButtonTest_Editor.h */, ); path = UIButtonTest; sourceTree = ""; @@ -4895,8 +4555,6 @@ children = ( 29080D3F191B595E0066F8DF /* UICheckBoxTest.cpp */, 29080D40191B595E0066F8DF /* UICheckBoxTest.h */, - 29080D41191B595E0066F8DF /* UICheckBoxTest_Editor.cpp */, - 29080D42191B595E0066F8DF /* UICheckBoxTest_Editor.h */, ); path = UICheckBoxTest; sourceTree = ""; @@ -4915,8 +4573,6 @@ children = ( 29080D47191B595E0066F8DF /* UIImageViewTest.cpp */, 29080D48191B595E0066F8DF /* UIImageViewTest.h */, - 29080D49191B595E0066F8DF /* UIImageViewTest_Editor.cpp */, - 29080D4A191B595E0066F8DF /* UIImageViewTest_Editor.h */, ); path = UIImageViewTest; sourceTree = ""; @@ -4926,8 +4582,6 @@ children = ( 29080D4C191B595E0066F8DF /* UILayoutTest.cpp */, 29080D4D191B595E0066F8DF /* UILayoutTest.h */, - 29080D4E191B595E0066F8DF /* UILayoutTest_Editor.cpp */, - 29080D4F191B595E0066F8DF /* UILayoutTest_Editor.h */, ); path = UILayoutTest; sourceTree = ""; @@ -4937,8 +4591,6 @@ children = ( 29080D51191B595E0066F8DF /* UIListViewTest.cpp */, 29080D52191B595E0066F8DF /* UIListViewTest.h */, - 29080D53191B595E0066F8DF /* UIListViewTest_Editor.cpp */, - 29080D54191B595E0066F8DF /* UIListViewTest_Editor.h */, ); path = UIListViewTest; sourceTree = ""; @@ -4948,8 +4600,6 @@ children = ( 29080D56191B595E0066F8DF /* UILoadingBarTest.cpp */, 29080D57191B595E0066F8DF /* UILoadingBarTest.h */, - 29080D58191B595E0066F8DF /* UILoadingBarTest_Editor.cpp */, - 29080D59191B595E0066F8DF /* UILoadingBarTest_Editor.h */, ); path = UILoadingBarTest; sourceTree = ""; @@ -4959,8 +4609,6 @@ children = ( 29080D5B191B595E0066F8DF /* UIPageViewTest.cpp */, 29080D5C191B595E0066F8DF /* UIPageViewTest.h */, - 29080D5D191B595E0066F8DF /* UIPageViewTest_Editor.cpp */, - 29080D5E191B595E0066F8DF /* UIPageViewTest_Editor.h */, ); path = UIPageViewTest; sourceTree = ""; @@ -4979,8 +4627,6 @@ children = ( 29080D6B191B595E0066F8DF /* UIScrollViewTest.cpp */, 29080D6C191B595E0066F8DF /* UIScrollViewTest.h */, - 29080D6D191B595E0066F8DF /* UIScrollViewTest_Editor.cpp */, - 29080D6E191B595E0066F8DF /* UIScrollViewTest_Editor.h */, ); path = UIScrollViewTest; sourceTree = ""; @@ -4990,8 +4636,6 @@ children = ( 29080D70191B595E0066F8DF /* UISliderTest.cpp */, 29080D71191B595E0066F8DF /* UISliderTest.h */, - 29080D72191B595E0066F8DF /* UISliderTest_Editor.cpp */, - 29080D73191B595E0066F8DF /* UISliderTest_Editor.h */, ); path = UISliderTest; sourceTree = ""; @@ -5001,8 +4645,6 @@ children = ( 29080D75191B595E0066F8DF /* UITextAtlasTest.cpp */, 29080D76191B595E0066F8DF /* UITextAtlasTest.h */, - 29080D77191B595E0066F8DF /* UITextAtlasTest_Editor.cpp */, - 29080D78191B595E0066F8DF /* UITextAtlasTest_Editor.h */, ); path = UITextAtlasTest; sourceTree = ""; @@ -5012,8 +4654,6 @@ children = ( 29080D7A191B595E0066F8DF /* UITextBMFontTest.cpp */, 29080D7B191B595E0066F8DF /* UITextBMFontTest.h */, - 29080D7C191B595E0066F8DF /* UITextBMFontTest_Editor.cpp */, - 29080D7D191B595E0066F8DF /* UITextBMFontTest_Editor.h */, ); path = UITextBMFontTest; sourceTree = ""; @@ -5023,8 +4663,6 @@ children = ( 29080D7F191B595E0066F8DF /* UITextFieldTest.cpp */, 29080D80191B595E0066F8DF /* UITextFieldTest.h */, - 29080D81191B595E0066F8DF /* UITextFieldTest_Editor.cpp */, - 29080D82191B595E0066F8DF /* UITextFieldTest_Editor.h */, ); path = UITextFieldTest; sourceTree = ""; @@ -5034,8 +4672,6 @@ children = ( 29080D84191B595E0066F8DF /* UITextTest.cpp */, 29080D85191B595E0066F8DF /* UITextTest.h */, - 29080D86191B595E0066F8DF /* UITextTest_Editor.cpp */, - 29080D87191B595E0066F8DF /* UITextTest_Editor.h */, ); path = UITextTest; sourceTree = ""; @@ -5045,8 +4681,6 @@ children = ( 29080D89191B595E0066F8DF /* UIWidgetAddNodeTest.cpp */, 29080D8A191B595E0066F8DF /* UIWidgetAddNodeTest.h */, - 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */, - 29080D8C191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.h */, ); path = UIWidgetAddNodeTest; sourceTree = ""; @@ -5155,34 +4789,16 @@ name = Frameworks; sourceTree = ""; }; - 29FBBBFB196A9ECD00E65826 /* CocostudioParserTest */ = { - isa = PBXGroup; - children = ( - 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */, - 290E94B4196FC16900694919 /* CocostudioParserTest.h */, - 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */, - 29FBBBFD196A9ECD00E65826 /* CocostudioParserJsonTest.h */, - ); - name = CocostudioParserTest; - path = UITest/CocoStudioGUITest/CocostudioParserTest; - sourceTree = ""; - }; 29FBBC00196A9F0D00E65826 /* UIAndEditorTests */ = { isa = PBXGroup; children = ( C58126F61C84959600C92DE2 /* UITabControlTest */, 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */, 29080D20191B595E0066F8DF /* CocosGUIScene.h */, - 29080D37191B595E0066F8DF /* GUIEditorTest.cpp */, - 29080D38191B595E0066F8DF /* GUIEditorTest.h */, 29080D62191B595E0066F8DF /* UIScene.cpp */, 29080D63191B595E0066F8DF /* UIScene.h */, - 29080D64191B595E0066F8DF /* UIScene_Editor.cpp */, - 29080D65191B595E0066F8DF /* UIScene_Editor.h */, 29080D66191B595E0066F8DF /* UISceneManager.cpp */, 29080D67191B595E0066F8DF /* UISceneManager.h */, - 29080D68191B595E0066F8DF /* UISceneManager_Editor.cpp */, - 29080D69191B595E0066F8DF /* UISceneManager_Editor.h */, 29AAE28619F0BD12004F5A18 /* UIEditBoxTest */, 29AAE28519F0BD02004F5A18 /* UIScale9SpriteTest */, 298D7F6C19AC31C000FF096D /* UIWebViewTest */, @@ -5209,28 +4825,6 @@ path = UITest/CocoStudioGUITest; sourceTree = ""; }; - 3825CC421A2C982A00C92EA8 /* CustomWidgetCallbackBindTest */ = { - isa = PBXGroup; - children = ( - 3825CC431A2C982A00C92EA8 /* CustomRootNode.cpp */, - 3825CC441A2C982A00C92EA8 /* CustomRootNode.h */, - 3825CC451A2C982A00C92EA8 /* CustomRootNodeReader.cpp */, - 3825CC461A2C982A00C92EA8 /* CustomRootNodeReader.h */, - 3825CC471A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.cpp */, - 3825CC481A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.h */, - ); - path = CustomWidgetCallbackBindTest; - sourceTree = ""; - }; - 38FA2E70194AEBE100FF2BE4 /* CocoStudioActionTimelineTest */ = { - isa = PBXGroup; - children = ( - 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */, - 38FA2E72194AEBE100FF2BE4 /* ActionTimelineTestScene.h */, - ); - path = CocoStudioActionTimelineTest; - sourceTree = ""; - }; 3E2BDACD19BEA3410055CDCD /* NewAudioEngineTest */ = { isa = PBXGroup; children = ( @@ -6361,7 +5955,6 @@ 1AC35DE118CEE65900F37B72 /* background.ogg in Resources */, 1AC35DDF18CEE65900F37B72 /* music.mid in Resources */, 1AC35DE018CEE65900F37B72 /* background.mp3 in Resources */, - 1A1645A6191B6281008C7C7F /* ccs-res in Resources */, C08689C218D370C90093E810 /* background.caf in Resources */, 1AC35DE918CEE65900F37B72 /* effect1.wav in Resources */, 3E2F27BD19D00D7D00E7C490 /* background.wav in Resources */, @@ -6424,7 +6017,6 @@ 3E2BDAFF19C5E5B40055CDCD /* audio in Resources */, 1AC35DEB18CEE65B00F37B72 /* CocosBuilderExample.ccbproj in Resources */, 1AC35DCA18CEE65200F37B72 /* animations in Resources */, - 1A1645A9191B6283008C7C7F /* ccs-res in Resources */, 1AC35DA118CEE5D100F37B72 /* Icon-72.png in Resources */, 1AC35DA218CEE5D100F37B72 /* Icon-76.png in Resources */, 1AC35DF418CEE65B00F37B72 /* effect1.raw in Resources */, @@ -6468,9 +6060,9 @@ 5046AB5B1AF2C4180060550B /* Materials in Resources */, B63993311A49359F00B07923 /* Particle3D in Resources */, 1AC35CEC18CED84500F37B72 /* fonts in Resources */, + 460629781CDB4DBA00B44058 /* ccs-res in Resources */, 1AC35CCA18CED84500F37B72 /* animations in Resources */, 1AC35CEA18CED84500F37B72 /* fileLookup.plist in Resources */, - 1A221C9C191771E300FD2BE4 /* ccs-res in Resources */, 1AC35CF018CED84500F37B72 /* hd in Resources */, 1AC35CFC18CED84500F37B72 /* music.mid in Resources */, 1AC35D0A18CED84500F37B72 /* zwoptex in Resources */, @@ -6528,7 +6120,6 @@ 507B41081C31BEA60067B53E /* Default@2x.png in Resources */, 507B41091C31BEA60067B53E /* effect1.raw in Resources */, 507B410A1C31BEA60067B53E /* TerrainTest in Resources */, - 507B410B1C31BEA60067B53E /* ccs-res in Resources */, 507B410C1C31BEA60067B53E /* Icon-29.png in Resources */, 507B410D1C31BEA60067B53E /* TileMaps in Resources */, 507B410E1C31BEA60067B53E /* Particles in Resources */, @@ -6644,7 +6235,6 @@ 507B43A51C31FB670067B53E /* audio in Resources */, 507B43A61C31FB670067B53E /* CocosBuilderExample.ccbproj in Resources */, 507B43A71C31FB670067B53E /* animations in Resources */, - 507B43A81C31FB670067B53E /* ccs-res in Resources */, 507B43A91C31FB670067B53E /* Icon-72.png in Resources */, 507B43AA1C31FB670067B53E /* Icon-76.png in Resources */, 507B43AB1C31FB670067B53E /* effect1.raw in Resources */, @@ -6737,7 +6327,6 @@ 1AC35C8A18CECF1400F37B72 /* Default@2x.png in Resources */, 1AC35CE318CED84500F37B72 /* effect1.raw in Resources */, B603F1B51AC8FBFB00A9579C /* TerrainTest in Resources */, - 1A221C9D191771E400FD2BE4 /* ccs-res in Resources */, 1AC35C9018CECF1400F37B72 /* Icon-29.png in Resources */, 1AC35D0918CED84500F37B72 /* TileMaps in Resources */, 1AC35CFF18CED84500F37B72 /* Particles in Resources */, @@ -6756,6 +6345,7 @@ 1AC35C9118CECF1400F37B72 /* Icon-40.png in Resources */, 1AC35C8B18CECF1400F37B72 /* Icon-100.png in Resources */, 1AC35D0118CED84500F37B72 /* pew-pew-lei.wav in Resources */, + 460629791CDB4DBA00B44058 /* ccs-res in Resources */, 1AC35D0518CED84500F37B72 /* Shaders in Resources */, 1AC35CD318CED84500F37B72 /* background.ogg in Resources */, 3E2BDB0119C5E5D40055CDCD /* background.wav in Resources */, @@ -7140,9 +6730,7 @@ buildActionMask = 2147483647; files = ( C5384A801C85339200EC986E /* UITabControlTest.cpp in Sources */, - 3825CC491A2C982A00C92EA8 /* CustomRootNode.cpp in Sources */, 1AC35B3118CECF0C00F37B72 /* GLES-Render.cpp in Sources */, - 29080DE1191B595E0066F8DF /* UITextTest_Editor.cpp in Sources */, 1AC35C5318CECF0C00F37B72 /* TextInputTest.cpp in Sources */, 1AC35B4518CECF0C00F37B72 /* Bug-886.cpp in Sources */, 29080DCB191B595E0066F8DF /* UIScrollViewTest.cpp in Sources */, @@ -7150,21 +6738,17 @@ 1AC35BEB18CECF0C00F37B72 /* CCControlSliderTest.cpp in Sources */, 1AC35C4D18CECF0C00F37B72 /* SpineTest.cpp in Sources */, 3E92EA821921A1400094CD21 /* Sprite3DTest.cpp in Sources */, - 94D793DB1B4B7A3600F60F10 /* Bug-PageViewLayout.cpp in Sources */, 1AC35C1D18CECF0C00F37B72 /* NewRendererTest.cpp in Sources */, 50921EAF1B746D5F00C085CC /* DownloaderTest.cpp in Sources */, 1AC35B6718CECF0C00F37B72 /* AnimationsTestLayer.cpp in Sources */, - 29080DB7191B595E0066F8DF /* UIListViewTest_Editor.cpp in Sources */, 1AC35BF918CECF0C00F37B72 /* WebSocketTest.cpp in Sources */, 1AC35B3918CECF0C00F37B72 /* Bug-1174.cpp in Sources */, 1AC35BE318CECF0C00F37B72 /* CCControlColourPickerTest.cpp in Sources */, 29080DB1191B595E0066F8DF /* UILayoutTest.cpp in Sources */, 1AC35B2318CECF0C00F37B72 /* ActionsEaseTest.cpp in Sources */, - 29080DE5191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */, 1AC35C1918CECF0C00F37B72 /* MutiTouchTest.cpp in Sources */, 29080DBD191B595E0066F8DF /* UIPageViewTest.cpp in Sources */, 1AC35B2918CECF0C00F37B72 /* AppDelegate.cpp in Sources */, - 29080DA1191B595E0066F8DF /* GUIEditorTest.cpp in Sources */, 1AC35B3718CECF0C00F37B72 /* Bug-1159.cpp in Sources */, 850F8A241B5F3A4F00780603 /* Bug-12847.cpp in Sources */, A5030C3519D059DA000E78E7 /* OpenURLTest.cpp in Sources */, @@ -7172,23 +6756,17 @@ 1AC35C4518CECF0C00F37B72 /* SceneTest.cpp in Sources */, 1AC35B6F18CECF0C00F37B72 /* MenuTestLayer.cpp in Sources */, 59620E8F1921E5CF002021B6 /* Bug-Child.cpp in Sources */, - 29080DCD191B595E0066F8DF /* UIScrollViewTest_Editor.cpp in Sources */, 1AC35B5118CECF0C00F37B72 /* ClippingNodeTest.cpp in Sources */, - 3825CC4D1A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.cpp in Sources */, 1AC35C1318CECF0C00F37B72 /* LayerTest.cpp in Sources */, - 29080D97191B595E0066F8DF /* CustomImageView.cpp in Sources */, 1AC35C1F18CECF0C00F37B72 /* NodeTest.cpp in Sources */, - 29080D95191B595E0066F8DF /* CustomParticleWidgetTest.cpp in Sources */, C04F935A1941B05400E9FEAB /* TileMapTest2.cpp in Sources */, 1AC35C4118CECF0C00F37B72 /* RenderTextureTest.cpp in Sources */, 29080DE3191B595E0066F8DF /* UIWidgetAddNodeTest.cpp in Sources */, - 29080DBB191B595E0066F8DF /* UILoadingBarTest_Editor.cpp in Sources */, 1AC35C1518CECF0C00F37B72 /* MenuTest.cpp in Sources */, 1AC35C6718CECF0C00F37B72 /* UserDefaultTest.cpp in Sources */, 1AC35C2118CECF0C00F37B72 /* ParallaxTest.cpp in Sources */, 1AC35C6B18CECF0C00F37B72 /* ZwoptexTest.cpp in Sources */, 1AC35C7018CECF0C00F37B72 /* VibrateTest.cpp in Sources */, - 1AC35B7718CECF0C00F37B72 /* ComponentsTestScene.cpp in Sources */, 5046AB4A1AF2A8D80060550B /* MaterialSystemTest.cpp in Sources */, B603F1AF1AC8EA4E00A9579C /* TerrainTest.cpp in Sources */, 29080DC7191B595E0066F8DF /* UISceneManager.cpp in Sources */, @@ -7197,46 +6775,35 @@ B6CAB54E1AF9AA6C00B9B856 /* Physics3DTest.cpp in Sources */, B639932E1A490EC700B07923 /* Particle3DTest.cpp in Sources */, 1AC35C5F18CECF0C00F37B72 /* Paddle.cpp in Sources */, - 1AC35BDB18CECF0C00F37B72 /* SceneEditorTest.cpp in Sources */, 1AC35B4B18CECF0C00F37B72 /* BugsTest.cpp in Sources */, 27C5CE011C6E0469000CA4B3 /* SpriteFrameCacheTest.cpp in Sources */, 1AC35C5118CECF0C00F37B72 /* testBasic.cpp in Sources */, - 1AC35B7918CECF0C00F37B72 /* EnemyController.cpp in Sources */, 1AC35B6B18CECF0C00F37B72 /* CocosBuilderTest.cpp in Sources */, - 29FBBBFE196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */, 1AC35B4118CECF0C00F37B72 /* QuestionContainerSprite.cpp in Sources */, 1AC35B6118CECF0C00F37B72 /* DrawPrimitivesTest.cpp in Sources */, 1AC35C1718CECF0C00F37B72 /* MotionStreakTest.cpp in Sources */, 1AC35C0518CECF0C00F37B72 /* FontTest.cpp in Sources */, - 29080D99191B595E0066F8DF /* CustomImageViewReader.cpp in Sources */, - 29080DD1191B595E0066F8DF /* UISliderTest_Editor.cpp in Sources */, 1AC35B2718CECF0C00F37B72 /* ActionsTest.cpp in Sources */, 1AC35C4918CECF0C00F37B72 /* ShaderTest.cpp in Sources */, 1AC35B4318CECF0C00F37B72 /* Bug-624.cpp in Sources */, 688669711AE8E8B500C2CFD9 /* SpritePolygonTest.cpp in Sources */, 1AC35BF718CECF0C00F37B72 /* SocketIOTest.cpp in Sources */, 1AC35C4F18CECF0C00F37B72 /* SpriteTest.cpp in Sources */, - 29080D9D191B595E0066F8DF /* CustomParticleWidgetReader.cpp in Sources */, 1AC35C0318CECF0C00F37B72 /* FileUtilsTest.cpp in Sources */, B5CE6DD11B3C08F8002B0419 /* UIRadioButtonTest.cpp in Sources */, B6C039D919C95D83007207DC /* LightTest.cpp in Sources */, 1AC35B5B18CECF0C00F37B72 /* CurlTest.cpp in Sources */, - 29080DD5191B595E0066F8DF /* UITextAtlasTest_Editor.cpp in Sources */, 1AC35BFF18CECF0C00F37B72 /* CustomTableViewCell.cpp in Sources */, 29080DDF191B595E0066F8DF /* UITextTest.cpp in Sources */, 1AC35BEF18CECF0C00F37B72 /* CCControlSwitchTest.cpp in Sources */, - 29080D91191B595E0066F8DF /* CustomGUIScene.cpp in Sources */, 3E9E75D0199324CB005B7047 /* Camera3DTest.cpp in Sources */, 29080DC1191B595E0066F8DF /* UIRichTextTest.cpp in Sources */, 1AC35B2B18CECF0C00F37B72 /* BaseTest.cpp in Sources */, - 1AC35B7D18CECF0C00F37B72 /* PlayerController.cpp in Sources */, - 29080D9F191B595E0066F8DF /* CustomReader.cpp in Sources */, 1AC35BE718CECF0C00F37B72 /* CCControlScene.cpp in Sources */, B609E67319C18DAD003D0074 /* BillBoardTest.cpp in Sources */, 292CF01419A1965E00E8E6A0 /* UIEditBoxTest.cpp in Sources */, B6DD2FFC1B04979C00E47F5F /* NavMeshTest.cpp in Sources */, D0FD03641A3B546400825BB5 /* AllocatorTest.cpp in Sources */, - 29080DBF191B595E0066F8DF /* UIPageViewTest_Editor.cpp in Sources */, 1AC35B5F18CECF0C00F37B72 /* DataVisitorTest.cpp in Sources */, 1AC35B5D18CECF0C00F37B72 /* CurrentLanguageTest.cpp in Sources */, 1AC35B3B18CECF0C00F37B72 /* Bug-350.cpp in Sources */, @@ -7244,55 +6811,39 @@ 29080DA3191B595E0066F8DF /* UIButtonTest.cpp in Sources */, 1AC35C5518CECF0C00F37B72 /* Texture2dTest.cpp in Sources */, 1AC35C0718CECF0C00F37B72 /* MouseTest.cpp in Sources */, - 182C5CBA1A95B2FD00C30D34 /* CocosStudio3DTest.cpp in Sources */, 1AC35C5D18CECF0C00F37B72 /* Ball.cpp in Sources */, - 1AC35B7B18CECF0C00F37B72 /* GameOverScene.cpp in Sources */, 1AC35BF318CECF0C00F37B72 /* ExtensionsTest.cpp in Sources */, 1AC35B3518CECF0C00F37B72 /* TestEntries.cpp in Sources */, 1AC35B2D18CECF0C00F37B72 /* Box2dTest.cpp in Sources */, - 290E94B5196FC16900694919 /* CocostudioParserTest.cpp in Sources */, 29080DDB191B595E0066F8DF /* UITextFieldTest.cpp in Sources */, 1AC35C1118CECF0C00F37B72 /* LabelTestNew.cpp in Sources */, 1AC35B4D18CECF0C00F37B72 /* ChipmunkTest.cpp in Sources */, - 1AC35BDF18CECF0C00F37B72 /* cons.cpp in Sources */, - 3825CC4B1A2C982A00C92EA8 /* CustomRootNodeReader.cpp in Sources */, 1AC35B5718CECF0C00F37B72 /* ConsoleTest.cpp in Sources */, 29080DA7191B595E0066F8DF /* UICheckBoxTest.cpp in Sources */, - 29080DDD191B595E0066F8DF /* UITextFieldTest_Editor.cpp in Sources */, 1AC35C0918CECF0C00F37B72 /* IntervalTest.cpp in Sources */, - 29080DA5191B595E0066F8DF /* UIButtonTest_Editor.cpp in Sources */, 29080DC3191B595E0066F8DF /* UIScene.cpp in Sources */, A0BD49FE1AFAFEE50046CCE3 /* Scene3DTest.cpp in Sources */, - 29080D9B191B595E0066F8DF /* CustomParticleWidget.cpp in Sources */, 29080D8D191B595E0066F8DF /* CocosGUIScene.cpp in Sources */, 5EBEECB01995247000429821 /* DrawNode3D.cpp in Sources */, 1AC35BED18CECF0C00F37B72 /* CCControlStepperTest.cpp in Sources */, 1AC35C5918CECF0C00F37B72 /* TextureAtlasEncryptionTest.cpp in Sources */, - 29080DA9191B595E0066F8DF /* UICheckBoxTest_Editor.cpp in Sources */, 1AC35B5518CECF0C00F37B72 /* ConfigurationTest.cpp in Sources */, 1AC35BE518CECF0C00F37B72 /* CCControlPotentiometerTest.cpp in Sources */, 1AC35C5B18CECF0C00F37B72 /* TileMapTest.cpp in Sources */, 1AC35B4718CECF0C00F37B72 /* Bug-899.cpp in Sources */, 1AC35C1B18CECF0C00F37B72 /* NewEventDispatcherTest.cpp in Sources */, - 29080DC5191B595E0066F8DF /* UIScene_Editor.cpp in Sources */, - 1AC35BDD18CECF0C00F37B72 /* acts.cpp in Sources */, - 1AC35B7518CECF0C00F37B72 /* ArmatureScene.cpp in Sources */, - 1AC35B8118CECF0C00F37B72 /* SceneController.cpp in Sources */, 1AC35B3318CECF0C00F37B72 /* Test.cpp in Sources */, 1AC35C2318CECF0C00F37B72 /* ParticleTest.cpp in Sources */, 295824591987415900F9746D /* UIScale9SpriteTest.cpp in Sources */, 1AC35C6118CECF0C00F37B72 /* TouchesTest.cpp in Sources */, 1AC35C6318CECF0C00F37B72 /* TransitionsTest.cpp in Sources */, - 29080DB3191B595E0066F8DF /* UILayoutTest_Editor.cpp in Sources */, 29080DB9191B595E0066F8DF /* UILoadingBarTest.cpp in Sources */, - 29080DAF191B595E0066F8DF /* UIImageViewTest_Editor.cpp in Sources */, 1AC35C4318CECF0C00F37B72 /* RotateWorldTest.cpp in Sources */, 29080DD7191B595E0066F8DF /* UITextBMFontTest.cpp in Sources */, 1AC35B2518CECF0C00F37B72 /* ActionsProgressTest.cpp in Sources */, 1AC35B6518CECF0C00F37B72 /* EffectsTest.cpp in Sources */, 1AC35B7118CECF0C00F37B72 /* TestHeaderLayer.cpp in Sources */, 94D793D91B4B7A3600F60F10 /* Bug-CCDrawNode.cpp in Sources */, - 29080D93191B595E0066F8DF /* CustomImageTest.cpp in Sources */, 1AC35B2118CECF0C00F37B72 /* ActionManagerTest.cpp in Sources */, 1AC35C3D18CECF0C00F37B72 /* PhysicsTest.cpp in Sources */, 29080DAD191B595E0066F8DF /* UIImageViewTest.cpp in Sources */, @@ -7306,28 +6857,24 @@ 1AC35B6D18CECF0C00F37B72 /* HelloCocosBuilderLayer.cpp in Sources */, 1AC35C0118CECF0C00F37B72 /* TableViewTestScene.cpp in Sources */, 1AC35C4B18CECF0C00F37B72 /* ShaderTest2.cpp in Sources */, - 38FA2E73194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp in Sources */, 1AC35C6518CECF0C00F37B72 /* UnitTest.cpp in Sources */, 15B3709819EE5DBA00ABE682 /* AssetsManagerExTest.cpp in Sources */, - 29080DC9191B595E0066F8DF /* UISceneManager_Editor.cpp in Sources */, 1AC35B3F18CECF0C00F37B72 /* Bug-458.cpp in Sources */, 3E2F27B919CFF4AF00E7C490 /* NewAudioEngineTest.cpp in Sources */, 1AC35B5318CECF0C00F37B72 /* CocosDenshionTest.cpp in Sources */, 29080DD3191B595E0066F8DF /* UITextAtlasTest.cpp in Sources */, - 1AC35B7F18CECF0C00F37B72 /* ProjectileController.cpp in Sources */, 29080DB5191B595E0066F8DF /* UIListViewTest.cpp in Sources */, 29080DAB191B595E0066F8DF /* UIFocusTest.cpp in Sources */, - 29080DD9191B595E0066F8DF /* UITextBMFontTest_Editor.cpp in Sources */, 1AC35B5918CECF0C00F37B72 /* controller.cpp in Sources */, 1AC35CA618CECF1E00F37B72 /* main.cpp in Sources */, 1AC35BE918CECF0C00F37B72 /* CCControlSceneManager.cpp in Sources */, 1AC35B7318CECF0C00F37B72 /* TimelineCallbackTestLayer.cpp in Sources */, 1AC35BFB18CECF0C00F37B72 /* NotificationCenterTest.cpp in Sources */, - 29080D8F191B595E0066F8DF /* CocoStudioGUITest.cpp in Sources */, 1AC35B3D18CECF0C00F37B72 /* Bug-422.cpp in Sources */, 1AC35BF518CECF0C00F37B72 /* HttpClientTest.cpp in Sources */, 1AC35B4F18CECF0C00F37B72 /* ClickAndMoveTest.cpp in Sources */, 29080DCF191B595E0066F8DF /* UISliderTest.cpp in Sources */, + 500D1CD31CF4A48B00535D35 /* Bug-15594.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7354,7 +6901,6 @@ 507B413F1C31BEA60067B53E /* Bug-886.cpp in Sources */, 507B41401C31BEA60067B53E /* CCControlButtonTest.cpp in Sources */, 507B41411C31BEA60067B53E /* CCControlSliderTest.cpp in Sources */, - 507B41421C31BEA60067B53E /* UILayoutTest_Editor.cpp in Sources */, 507B41431C31BEA60067B53E /* SpineTest.cpp in Sources */, 507B41441C31BEA60067B53E /* Physics3DTest.cpp in Sources */, 507B41451C31BEA60067B53E /* NewRendererTest.cpp in Sources */, @@ -7363,7 +6909,6 @@ 507B41481C31BEA60067B53E /* AnimationsTestLayer.cpp in Sources */, 507B41491C31BEA60067B53E /* CocosGUIScene.cpp in Sources */, 507B414A1C31BEA60067B53E /* WebSocketTest.cpp in Sources */, - 507B414B1C31BEA60067B53E /* ActionTimelineTestScene.cpp in Sources */, 507B414C1C31BEA60067B53E /* UIScale9SpriteTest.cpp in Sources */, 507B414D1C31BEA60067B53E /* Particle3DTest.cpp in Sources */, 507B414E1C31BEA60067B53E /* Bug-1174.cpp in Sources */, @@ -7371,17 +6916,11 @@ 507B41501C31BEA60067B53E /* UITextAtlasTest.cpp in Sources */, 507B41511C31BEA60067B53E /* ActionsEaseTest.cpp in Sources */, 507B41521C31BEA60067B53E /* MutiTouchTest.cpp in Sources */, - 507B41531C31BEA60067B53E /* UIListViewTest_Editor.cpp in Sources */, - 507B41541C31BEA60067B53E /* UILoadingBarTest_Editor.cpp in Sources */, 507B41551C31BEA60067B53E /* testsAppDelegate.mm in Sources */, - 507B41561C31BEA60067B53E /* CustomImageView.cpp in Sources */, 507B41571C31BEA60067B53E /* AppDelegate.cpp in Sources */, 507B41581C31BEA60067B53E /* Bug-1159.cpp in Sources */, 507B41591C31BEA60067B53E /* UILoadingBarTest.cpp in Sources */, - 507B415A1C31BEA60067B53E /* CustomParticleWidget.cpp in Sources */, 507B415B1C31BEA60067B53E /* SceneTest.cpp in Sources */, - 507B415C1C31BEA60067B53E /* CustomImageViewReader.cpp in Sources */, - 507B415D1C31BEA60067B53E /* UITextAtlasTest_Editor.cpp in Sources */, 507B415E1C31BEA60067B53E /* MenuTestLayer.cpp in Sources */, 507B415F1C31BEA60067B53E /* ClippingNodeTest.cpp in Sources */, 507B41601C31BEA60067B53E /* LayerTest.cpp in Sources */, @@ -7393,24 +6932,18 @@ 507B41661C31BEA60067B53E /* UserDefaultTest.cpp in Sources */, 507B41671C31BEA60067B53E /* UITest.cpp in Sources */, 507B41681C31BEA60067B53E /* Camera3DTest.cpp in Sources */, - 507B41691C31BEA60067B53E /* CustomReader.cpp in Sources */, 507B416A1C31BEA60067B53E /* ParallaxTest.cpp in Sources */, 507B416B1C31BEA60067B53E /* ZwoptexTest.cpp in Sources */, 507B416C1C31BEA60067B53E /* VibrateTest.cpp in Sources */, - 507B416D1C31BEA60067B53E /* ComponentsTestScene.cpp in Sources */, 507B416E1C31BEA60067B53E /* Bug-914.cpp in Sources */, 507B416F1C31BEA60067B53E /* EffectsAdvancedTest.cpp in Sources */, 507B41701C31BEA60067B53E /* Paddle.cpp in Sources */, 507B41711C31BEA60067B53E /* UIPageViewTest.cpp in Sources */, - 507B41721C31BEA60067B53E /* SceneEditorTest.cpp in Sources */, 507B41731C31BEA60067B53E /* Scene3DTest.cpp in Sources */, 507B41741C31BEA60067B53E /* OpenURLTest.cpp in Sources */, 507B41751C31BEA60067B53E /* BugsTest.cpp in Sources */, 507B41761C31BEA60067B53E /* testBasic.cpp in Sources */, - 507B41771C31BEA60067B53E /* EnemyController.cpp in Sources */, - 507B41781C31BEA60067B53E /* UIWidgetAddNodeTest_Editor.cpp in Sources */, 507B41791C31BEA60067B53E /* CocosBuilderTest.cpp in Sources */, - 507B417A1C31BEA60067B53E /* UITextFieldTest_Editor.cpp in Sources */, 507B417B1C31BEA60067B53E /* QuestionContainerSprite.cpp in Sources */, 507B417C1C31BEA60067B53E /* DrawPrimitivesTest.cpp in Sources */, 507B417D1C31BEA60067B53E /* UITextFieldTest.cpp in Sources */, @@ -7422,7 +6955,6 @@ 507B41831C31BEA60067B53E /* ActionsTest.cpp in Sources */, 507B41841C31BEA60067B53E /* ShaderTest.cpp in Sources */, 507B41851C31BEA60067B53E /* BillBoardTest.cpp in Sources */, - 507B41861C31BEA60067B53E /* Bug-PageViewLayout.cpp in Sources */, 507B41871C31BEA60067B53E /* TileMapTest2.cpp in Sources */, 507B41881C31BEA60067B53E /* Bug-624.cpp in Sources */, 507B41891C31BEA60067B53E /* SocketIOTest.cpp in Sources */, @@ -7430,36 +6962,27 @@ 507B418B1C31BEA60067B53E /* NewAudioEngineTest.cpp in Sources */, 507B418C1C31BEA60067B53E /* FileUtilsTest.cpp in Sources */, 27C5CE031C6E0477000CA4B3 /* SpriteFrameCacheTest.cpp in Sources */, - 507B418D1C31BEA60067B53E /* CustomRootNodeReader.cpp in Sources */, 507B418E1C31BEA60067B53E /* CurlTest.cpp in Sources */, 507B418F1C31BEA60067B53E /* CustomTableViewCell.cpp in Sources */, - 507B41901C31BEA60067B53E /* CustomGUIScene.cpp in Sources */, 507B41911C31BEA60067B53E /* CCControlSwitchTest.cpp in Sources */, 507B41921C31BEA60067B53E /* BaseTest.cpp in Sources */, - 507B41931C31BEA60067B53E /* PlayerController.cpp in Sources */, 507B41941C31BEA60067B53E /* main.m in Sources */, 507B41951C31BEA60067B53E /* UIScrollViewTest.cpp in Sources */, 507B41961C31BEA60067B53E /* CCControlScene.cpp in Sources */, - 507B41971C31BEA60067B53E /* UICheckBoxTest_Editor.cpp in Sources */, 507B41981C31BEA60067B53E /* DataVisitorTest.cpp in Sources */, 507B41991C31BEA60067B53E /* CurrentLanguageTest.cpp in Sources */, - 507B419A1C31BEA60067B53E /* UITextTest_Editor.cpp in Sources */, 507B419B1C31BEA60067B53E /* UICheckBoxTest.cpp in Sources */, 507B419C1C31BEA60067B53E /* Bug-350.cpp in Sources */, - 507B419D1C31BEA60067B53E /* UITextBMFontTest_Editor.cpp in Sources */, 507B419E1C31BEA60067B53E /* SchedulerTest.cpp in Sources */, 507B419F1C31BEA60067B53E /* Texture2dTest.cpp in Sources */, 507B41A01C31BEA60067B53E /* MouseTest.cpp in Sources */, 507B41A11C31BEA60067B53E /* Ball.cpp in Sources */, - 507B41A21C31BEA60067B53E /* GameOverScene.cpp in Sources */, 507B41A31C31BEA60067B53E /* ExtensionsTest.cpp in Sources */, 507B41A41C31BEA60067B53E /* TestEntries.cpp in Sources */, 507B41A51C31BEA60067B53E /* AssetsManagerExTest.cpp in Sources */, 507B41A61C31BEA60067B53E /* Box2dTest.cpp in Sources */, - 507B41A71C31BEA60067B53E /* UISceneManager_Editor.cpp in Sources */, 507B41A81C31BEA60067B53E /* LabelTestNew.cpp in Sources */, 507B41A91C31BEA60067B53E /* ChipmunkTest.cpp in Sources */, - 507B41AA1C31BEA60067B53E /* cons.cpp in Sources */, 507B41AB1C31BEA60067B53E /* ConsoleTest.cpp in Sources */, 507B41AC1C31BEA60067B53E /* IntervalTest.cpp in Sources */, 507B41AD1C31BEA60067B53E /* UISliderTest.cpp in Sources */, @@ -7473,25 +6996,16 @@ 507B41B51C31BEA60067B53E /* UIRichTextTest.cpp in Sources */, 507B41B71C31BEA60067B53E /* Bug-899.cpp in Sources */, 507B41B81C31BEA60067B53E /* NewEventDispatcherTest.cpp in Sources */, - 507B41B91C31BEA60067B53E /* UIScrollViewTest_Editor.cpp in Sources */, - 507B41BA1C31BEA60067B53E /* acts.cpp in Sources */, - 507B41BB1C31BEA60067B53E /* ArmatureScene.cpp in Sources */, - 507B41BC1C31BEA60067B53E /* SceneController.cpp in Sources */, - 507B41BD1C31BEA60067B53E /* UISliderTest_Editor.cpp in Sources */, 507B41BE1C31BEA60067B53E /* Test.cpp in Sources */, 507B41BF1C31BEA60067B53E /* ParticleTest.cpp in Sources */, 507B41C01C31BEA60067B53E /* TouchesTest.cpp in Sources */, - 507B41C11C31BEA60067B53E /* UIImageViewTest_Editor.cpp in Sources */, 507B41C21C31BEA60067B53E /* TransitionsTest.cpp in Sources */, 507B41C31C31BEA60067B53E /* RotateWorldTest.cpp in Sources */, 507B41C41C31BEA60067B53E /* ActionsProgressTest.cpp in Sources */, 507B41C51C31BEA60067B53E /* EffectsTest.cpp in Sources */, 507B41C61C31BEA60067B53E /* TestHeaderLayer.cpp in Sources */, 507B41C71C31BEA60067B53E /* ActionManagerTest.cpp in Sources */, - 507B41C81C31BEA60067B53E /* CocoStudioGUITest.cpp in Sources */, 507B41C91C31BEA60067B53E /* PhysicsTest.cpp in Sources */, - 507B41CA1C31BEA60067B53E /* CustomRootNode.cpp in Sources */, - 507B41CB1C31BEA60067B53E /* UIScene_Editor.cpp in Sources */, 507B41CC1C31BEA60067B53E /* UILayoutTest.cpp in Sources */, 507B41CD1C31BEA60067B53E /* ButtonTestLayer.cpp in Sources */, 507B41CE1C31BEA60067B53E /* UIListViewTest.cpp in Sources */, @@ -7507,35 +7021,24 @@ 507B41D81C31BEA60067B53E /* DownloaderTest.cpp in Sources */, 507B41D91C31BEA60067B53E /* TextureCacheTest.cpp in Sources */, 507B41DA1C31BEA60067B53E /* HelloCocosBuilderLayer.cpp in Sources */, - 507B41DB1C31BEA60067B53E /* CustomParticleWidgetTest.cpp in Sources */, 507B41DC1C31BEA60067B53E /* UITextTest.cpp in Sources */, - 507B41DD1C31BEA60067B53E /* UIPageViewTest_Editor.cpp in Sources */, 507B41DE1C31BEA60067B53E /* TableViewTestScene.cpp in Sources */, 507B41DF1C31BEA60067B53E /* ShaderTest2.cpp in Sources */, 507B41E01C31BEA60067B53E /* UnitTest.cpp in Sources */, - 507B41E11C31BEA60067B53E /* CocostudioParserTest.cpp in Sources */, 507B41E21C31BEA60067B53E /* Bug-458.cpp in Sources */, 507B41E31C31BEA60067B53E /* UIScene.cpp in Sources */, 507B41E41C31BEA60067B53E /* CocosDenshionTest.cpp in Sources */, - 507B41E51C31BEA60067B53E /* ProjectileController.cpp in Sources */, - 507B41E61C31BEA60067B53E /* CustomWidgetCallbackBindTest.cpp in Sources */, 507B41E71C31BEA60067B53E /* Sprite3DTest.cpp in Sources */, 507B41E81C31BEA60067B53E /* controller.cpp in Sources */, 507B41E91C31BEA60067B53E /* CCControlSceneManager.cpp in Sources */, - 507B41EA1C31BEA60067B53E /* CocosStudio3DTest.cpp in Sources */, 507B41EB1C31BEA60067B53E /* TimelineCallbackTestLayer.cpp in Sources */, 507B41EC1C31BEA60067B53E /* Bug-CCDrawNode.cpp in Sources */, - 507B41ED1C31BEA60067B53E /* CustomParticleWidgetReader.cpp in Sources */, 507B41EE1C31BEA60067B53E /* NotificationCenterTest.cpp in Sources */, - 507B41EF1C31BEA60067B53E /* CocostudioParserJsonTest.cpp in Sources */, 507B41F01C31BEA60067B53E /* NavMeshTest.cpp in Sources */, 507B41F11C31BEA60067B53E /* LightTest.cpp in Sources */, - 507B41F21C31BEA60067B53E /* GUIEditorTest.cpp in Sources */, - 507B41F31C31BEA60067B53E /* CustomImageTest.cpp in Sources */, 507B41F41C31BEA60067B53E /* Bug-422.cpp in Sources */, 507B41F51C31BEA60067B53E /* UIFocusTest.cpp in Sources */, 507B41F61C31BEA60067B53E /* HttpClientTest.cpp in Sources */, - 507B41F81C31BEA60067B53E /* UIButtonTest_Editor.cpp in Sources */, 507B41F91C31BEA60067B53E /* ClickAndMoveTest.cpp in Sources */, 507B41FA1C31BEA60067B53E /* TerrainTest.cpp in Sources */, ); @@ -7546,6 +7049,7 @@ buildActionMask = 2147483647; files = ( 507B42851C31E6070067B53E /* AppController.mm in Sources */, + 500D1CD51CF4A48B00535D35 /* Bug-15594.cpp in Sources */, 507B42861C31E6070067B53E /* main.m in Sources */, 507B42871C31E6070067B53E /* NativeOcClass.m in Sources */, 507B42881C31E6070067B53E /* js_Effect3D_bindings.cpp in Sources */, @@ -7613,7 +7117,6 @@ 1AC35B4618CECF0C00F37B72 /* Bug-886.cpp in Sources */, 1AC35BE218CECF0C00F37B72 /* CCControlButtonTest.cpp in Sources */, 1AC35BEC18CECF0C00F37B72 /* CCControlSliderTest.cpp in Sources */, - 29080DB4191B595E0066F8DF /* UILayoutTest_Editor.cpp in Sources */, 1AC35C4E18CECF0C00F37B72 /* SpineTest.cpp in Sources */, B6CAB54F1AF9AA6C00B9B856 /* Physics3DTest.cpp in Sources */, 1AC35C1E18CECF0C00F37B72 /* NewRendererTest.cpp in Sources */, @@ -7622,7 +7125,6 @@ 1AC35B6818CECF0C00F37B72 /* AnimationsTestLayer.cpp in Sources */, 29080D8E191B595E0066F8DF /* CocosGUIScene.cpp in Sources */, 1AC35BFA18CECF0C00F37B72 /* WebSocketTest.cpp in Sources */, - 38FA2E74194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp in Sources */, 2958245A1987415900F9746D /* UIScale9SpriteTest.cpp in Sources */, B639932F1A490EC700B07923 /* Particle3DTest.cpp in Sources */, 1AC35B3A18CECF0C00F37B72 /* Bug-1174.cpp in Sources */, @@ -7630,17 +7132,11 @@ 29080DD4191B595E0066F8DF /* UITextAtlasTest.cpp in Sources */, 1AC35B2418CECF0C00F37B72 /* ActionsEaseTest.cpp in Sources */, 1AC35C1A18CECF0C00F37B72 /* MutiTouchTest.cpp in Sources */, - 29080DB8191B595E0066F8DF /* UIListViewTest_Editor.cpp in Sources */, - 29080DBC191B595E0066F8DF /* UILoadingBarTest_Editor.cpp in Sources */, 1AC35C8718CECF1400F37B72 /* testsAppDelegate.mm in Sources */, - 29080D98191B595E0066F8DF /* CustomImageView.cpp in Sources */, 1AC35B2A18CECF0C00F37B72 /* AppDelegate.cpp in Sources */, 1AC35B3818CECF0C00F37B72 /* Bug-1159.cpp in Sources */, 29080DBA191B595E0066F8DF /* UILoadingBarTest.cpp in Sources */, - 29080D9C191B595E0066F8DF /* CustomParticleWidget.cpp in Sources */, 1AC35C4618CECF0C00F37B72 /* SceneTest.cpp in Sources */, - 29080D9A191B595E0066F8DF /* CustomImageViewReader.cpp in Sources */, - 29080DD6191B595E0066F8DF /* UITextAtlasTest_Editor.cpp in Sources */, 1AC35B7018CECF0C00F37B72 /* MenuTestLayer.cpp in Sources */, 1AC35B5218CECF0C00F37B72 /* ClippingNodeTest.cpp in Sources */, 1AC35C1418CECF0C00F37B72 /* LayerTest.cpp in Sources */, @@ -7652,24 +7148,18 @@ 1AC35C6818CECF0C00F37B72 /* UserDefaultTest.cpp in Sources */, 29080D1D191B574B0066F8DF /* UITest.cpp in Sources */, 3E9E75D1199324CB005B7047 /* Camera3DTest.cpp in Sources */, - 29080DA0191B595E0066F8DF /* CustomReader.cpp in Sources */, 1AC35C2218CECF0C00F37B72 /* ParallaxTest.cpp in Sources */, 1AC35C6C18CECF0C00F37B72 /* ZwoptexTest.cpp in Sources */, 1AC35C7118CECF0C00F37B72 /* VibrateTest.cpp in Sources */, - 1AC35B7818CECF0C00F37B72 /* ComponentsTestScene.cpp in Sources */, 1AC35B4A18CECF0C00F37B72 /* Bug-914.cpp in Sources */, 1AC35B6418CECF0C00F37B72 /* EffectsAdvancedTest.cpp in Sources */, 1AC35C6018CECF0C00F37B72 /* Paddle.cpp in Sources */, 29080DBE191B595E0066F8DF /* UIPageViewTest.cpp in Sources */, - 1AC35BDC18CECF0C00F37B72 /* SceneEditorTest.cpp in Sources */, A0BD49FF1AFAFEE50046CCE3 /* Scene3DTest.cpp in Sources */, A5030C3619D059DA000E78E7 /* OpenURLTest.cpp in Sources */, 1AC35B4C18CECF0C00F37B72 /* BugsTest.cpp in Sources */, 1AC35C5218CECF0C00F37B72 /* testBasic.cpp in Sources */, - 1AC35B7A18CECF0C00F37B72 /* EnemyController.cpp in Sources */, - 29080DE6191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */, 1AC35B6C18CECF0C00F37B72 /* CocosBuilderTest.cpp in Sources */, - 29080DDE191B595E0066F8DF /* UITextFieldTest_Editor.cpp in Sources */, 1AC35B4218CECF0C00F37B72 /* QuestionContainerSprite.cpp in Sources */, 1AC35B6218CECF0C00F37B72 /* DrawPrimitivesTest.cpp in Sources */, 29080DDC191B595E0066F8DF /* UITextFieldTest.cpp in Sources */, @@ -7681,43 +7171,34 @@ 1AC35B2818CECF0C00F37B72 /* ActionsTest.cpp in Sources */, 1AC35C4A18CECF0C00F37B72 /* ShaderTest.cpp in Sources */, B609E67419C18DAD003D0074 /* BillBoardTest.cpp in Sources */, - 94D793DC1B4B7A3600F60F10 /* Bug-PageViewLayout.cpp in Sources */, C04F935B1941B05400E9FEAB /* TileMapTest2.cpp in Sources */, 1AC35B4418CECF0C00F37B72 /* Bug-624.cpp in Sources */, 1AC35BF818CECF0C00F37B72 /* SocketIOTest.cpp in Sources */, 1AC35C5018CECF0C00F37B72 /* SpriteTest.cpp in Sources */, 3E2BDAD019BEA3410055CDCD /* NewAudioEngineTest.cpp in Sources */, 1AC35C0418CECF0C00F37B72 /* FileUtilsTest.cpp in Sources */, - 3825CC4C1A2C982A00C92EA8 /* CustomRootNodeReader.cpp in Sources */, 1AC35B5C18CECF0C00F37B72 /* CurlTest.cpp in Sources */, 1AC35C0018CECF0C00F37B72 /* CustomTableViewCell.cpp in Sources */, - 29080D92191B595E0066F8DF /* CustomGUIScene.cpp in Sources */, + 500D1CD41CF4A48B00535D35 /* Bug-15594.cpp in Sources */, 1AC35BF018CECF0C00F37B72 /* CCControlSwitchTest.cpp in Sources */, 1AC35B2C18CECF0C00F37B72 /* BaseTest.cpp in Sources */, - 1AC35B7E18CECF0C00F37B72 /* PlayerController.cpp in Sources */, 1AC35C9818CECF1400F37B72 /* main.m in Sources */, 29080DCC191B595E0066F8DF /* UIScrollViewTest.cpp in Sources */, 1AC35BE818CECF0C00F37B72 /* CCControlScene.cpp in Sources */, - 29080DAA191B595E0066F8DF /* UICheckBoxTest_Editor.cpp in Sources */, 1AC35B6018CECF0C00F37B72 /* DataVisitorTest.cpp in Sources */, 1AC35B5E18CECF0C00F37B72 /* CurrentLanguageTest.cpp in Sources */, - 29080DE2191B595E0066F8DF /* UITextTest_Editor.cpp in Sources */, 29080DA8191B595E0066F8DF /* UICheckBoxTest.cpp in Sources */, 1AC35B3C18CECF0C00F37B72 /* Bug-350.cpp in Sources */, - 29080DDA191B595E0066F8DF /* UITextBMFontTest_Editor.cpp in Sources */, 1AC35C4818CECF0C00F37B72 /* SchedulerTest.cpp in Sources */, 1AC35C5618CECF0C00F37B72 /* Texture2dTest.cpp in Sources */, 1AC35C0818CECF0C00F37B72 /* MouseTest.cpp in Sources */, 1AC35C5E18CECF0C00F37B72 /* Ball.cpp in Sources */, - 1AC35B7C18CECF0C00F37B72 /* GameOverScene.cpp in Sources */, 1AC35BF418CECF0C00F37B72 /* ExtensionsTest.cpp in Sources */, 1AC35B3618CECF0C00F37B72 /* TestEntries.cpp in Sources */, 15B3709919EE5DBA00ABE682 /* AssetsManagerExTest.cpp in Sources */, 1AC35B2E18CECF0C00F37B72 /* Box2dTest.cpp in Sources */, - 29080DCA191B595E0066F8DF /* UISceneManager_Editor.cpp in Sources */, 1AC35C1218CECF0C00F37B72 /* LabelTestNew.cpp in Sources */, 1AC35B4E18CECF0C00F37B72 /* ChipmunkTest.cpp in Sources */, - 1AC35BE018CECF0C00F37B72 /* cons.cpp in Sources */, 1AC35B5818CECF0C00F37B72 /* ConsoleTest.cpp in Sources */, 1AC35C0A18CECF0C00F37B72 /* IntervalTest.cpp in Sources */, 29080DD0191B595E0066F8DF /* UISliderTest.cpp in Sources */, @@ -7732,25 +7213,16 @@ 3EA0FB72191C844400B170C8 /* UIVideoPlayerTest.cpp in Sources */, 1AC35B4818CECF0C00F37B72 /* Bug-899.cpp in Sources */, 1AC35C1C18CECF0C00F37B72 /* NewEventDispatcherTest.cpp in Sources */, - 29080DCE191B595E0066F8DF /* UIScrollViewTest_Editor.cpp in Sources */, - 1AC35BDE18CECF0C00F37B72 /* acts.cpp in Sources */, - 1AC35B7618CECF0C00F37B72 /* ArmatureScene.cpp in Sources */, - 1AC35B8218CECF0C00F37B72 /* SceneController.cpp in Sources */, - 29080DD2191B595E0066F8DF /* UISliderTest_Editor.cpp in Sources */, 1AC35B3418CECF0C00F37B72 /* Test.cpp in Sources */, 1AC35C2418CECF0C00F37B72 /* ParticleTest.cpp in Sources */, 1AC35C6218CECF0C00F37B72 /* TouchesTest.cpp in Sources */, - 29080DB0191B595E0066F8DF /* UIImageViewTest_Editor.cpp in Sources */, 1AC35C6418CECF0C00F37B72 /* TransitionsTest.cpp in Sources */, 1AC35C4418CECF0C00F37B72 /* RotateWorldTest.cpp in Sources */, 1AC35B2618CECF0C00F37B72 /* ActionsProgressTest.cpp in Sources */, 1AC35B6618CECF0C00F37B72 /* EffectsTest.cpp in Sources */, 1AC35B7218CECF0C00F37B72 /* TestHeaderLayer.cpp in Sources */, 1AC35B2218CECF0C00F37B72 /* ActionManagerTest.cpp in Sources */, - 29080D90191B595E0066F8DF /* CocoStudioGUITest.cpp in Sources */, 1AC35C3E18CECF0C00F37B72 /* PhysicsTest.cpp in Sources */, - 3825CC4A1A2C982A00C92EA8 /* CustomRootNode.cpp in Sources */, - 29080DC6191B595E0066F8DF /* UIScene_Editor.cpp in Sources */, 29080DB2191B595E0066F8DF /* UILayoutTest.cpp in Sources */, 1AC35B6A18CECF0C00F37B72 /* ButtonTestLayer.cpp in Sources */, 29080DB6191B595E0066F8DF /* UIListViewTest.cpp in Sources */, @@ -7767,36 +7239,25 @@ 1AC35C5818CECF0C00F37B72 /* TextureCacheTest.cpp in Sources */, 1AC35B6E18CECF0C00F37B72 /* HelloCocosBuilderLayer.cpp in Sources */, 27C5CE021C6E0470000CA4B3 /* SpriteFrameCacheTest.cpp in Sources */, - 29080D96191B595E0066F8DF /* CustomParticleWidgetTest.cpp in Sources */, 29080DE0191B595E0066F8DF /* UITextTest.cpp in Sources */, - 29080DC0191B595E0066F8DF /* UIPageViewTest_Editor.cpp in Sources */, 1AC35C0218CECF0C00F37B72 /* TableViewTestScene.cpp in Sources */, 1AC35C4C18CECF0C00F37B72 /* ShaderTest2.cpp in Sources */, 1AC35C6618CECF0C00F37B72 /* UnitTest.cpp in Sources */, - 290E94B6196FC16900694919 /* CocostudioParserTest.cpp in Sources */, 1AC35B4018CECF0C00F37B72 /* Bug-458.cpp in Sources */, 29080DC4191B595E0066F8DF /* UIScene.cpp in Sources */, 1AC35B5418CECF0C00F37B72 /* CocosDenshionTest.cpp in Sources */, - 1AC35B8018CECF0C00F37B72 /* ProjectileController.cpp in Sources */, - 3825CC4E1A2C982A00C92EA8 /* CustomWidgetCallbackBindTest.cpp in Sources */, 3E92EA831921A1400094CD21 /* Sprite3DTest.cpp in Sources */, 1AC35B5A18CECF0C00F37B72 /* controller.cpp in Sources */, 1AC35BEA18CECF0C00F37B72 /* CCControlSceneManager.cpp in Sources */, - 182C5CBB1A95B30500C30D34 /* CocosStudio3DTest.cpp in Sources */, 1AC35B7418CECF0C00F37B72 /* TimelineCallbackTestLayer.cpp in Sources */, 94D793DA1B4B7A3600F60F10 /* Bug-CCDrawNode.cpp in Sources */, - 29080D9E191B595E0066F8DF /* CustomParticleWidgetReader.cpp in Sources */, 1AC35BFC18CECF0C00F37B72 /* NotificationCenterTest.cpp in Sources */, - 29FBBBFF196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */, B6DD2FFD1B04979C00E47F5F /* NavMeshTest.cpp in Sources */, B6C039DA19C95D83007207DC /* LightTest.cpp in Sources */, - 29080DA2191B595E0066F8DF /* GUIEditorTest.cpp in Sources */, - 29080D94191B595E0066F8DF /* CustomImageTest.cpp in Sources */, 1AC35B3E18CECF0C00F37B72 /* Bug-422.cpp in Sources */, 29080DAC191B595E0066F8DF /* UIFocusTest.cpp in Sources */, 1AC35BF618CECF0C00F37B72 /* HttpClientTest.cpp in Sources */, 298D7F6F19AC31F300FF096D /* UIWebViewTest.cpp in Sources */, - 29080DA6191B595E0066F8DF /* UIButtonTest_Editor.cpp in Sources */, 1AC35B5018CECF0C00F37B72 /* ClickAndMoveTest.cpp in Sources */, B603F1B01AC8EA4E00A9579C /* TerrainTest.cpp in Sources */, ); @@ -8211,6 +7672,7 @@ ); PRODUCT_NAME = "lua-game-controller-test iOS"; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; VALID_ARCHS = "arm64 armv7"; @@ -8244,6 +7706,7 @@ ); PRODUCT_NAME = "lua-game-controller-test iOS"; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; VALIDATE_PRODUCT = YES; @@ -8341,6 +7804,7 @@ PROVISIONING_PROFILE = ""; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios"; VALID_ARCHS = "arm64 armv7"; @@ -8373,6 +7837,7 @@ PROVISIONING_PROFILE = ""; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; @@ -8460,6 +7925,7 @@ INFOPLIST_FILE = "$(SRCROOT)/../tests/cpp-empty-test/proj.ios/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALID_ARCHS = "arm64 armv7"; @@ -8478,6 +7944,7 @@ INFOPLIST_FILE = "$(SRCROOT)/../tests/cpp-empty-test/proj.ios/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; @@ -8507,6 +7974,7 @@ 100000000, ); SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; VALID_ARCHS = "arm64 armv7"; @@ -8535,6 +8003,7 @@ 100000000, ); SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua"; VALIDATE_PRODUCT = YES; @@ -8603,6 +8072,7 @@ 100000000, ); SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../external/curl/include/ios"; VALID_ARCHS = "arm64 armv7"; @@ -8631,6 +8101,7 @@ 100000000, ); SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; @@ -8685,6 +8156,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "game-controller-test IOS"; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALID_ARCHS = "arm64 armv7"; @@ -8705,6 +8177,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "game-controller-test IOS"; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; @@ -8729,6 +8202,7 @@ ); PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + STRIP_PNG_TEXT = NO; TVOS_DEPLOYMENT_TARGET = 9.1; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; }; @@ -8751,6 +8225,7 @@ ); PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + STRIP_PNG_TEXT = NO; TVOS_DEPLOYMENT_TARGET = 9.1; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; @@ -8776,6 +8251,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SDKROOT = appletvos; + STRIP_PNG_TEXT = NO; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios"; }; name = Debug; @@ -8800,6 +8276,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SDKROOT = appletvos; + STRIP_PNG_TEXT = NO; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; }; @@ -8834,6 +8311,7 @@ ); PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../external/curl/include/ios"; }; @@ -8854,6 +8332,7 @@ ); PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; @@ -8871,6 +8350,7 @@ INFOPLIST_FILE = "$(SRCROOT)/../tests/game-controller-test/proj.ios/Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + STRIP_PNG_TEXT = NO; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; }; name = Debug; @@ -8886,6 +8366,7 @@ INFOPLIST_FILE = "$(SRCROOT)/../tests/game-controller-test/proj.ios/Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + STRIP_PNG_TEXT = NO; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; }; @@ -8981,6 +8462,7 @@ PROVISIONING_PROFILE = ""; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios"; VALID_ARCHS = "arm64 armv7"; @@ -9013,6 +8495,7 @@ PROVISIONING_PROFILE = ""; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../extensions $(SRCROOT)/../external $(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; @@ -9073,6 +8556,7 @@ "$(SRCROOT)/../external/curl/prebuilt/ios", ); SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALID_ARCHS = "arm64 armv7"; @@ -9098,6 +8582,7 @@ "$(SRCROOT)/../external/curl/prebuilt/ios", ); SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; @@ -9184,6 +8669,7 @@ ); PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALID_ARCHS = "arm64 armv7"; @@ -9211,6 +8697,7 @@ ); PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; diff --git a/build/tizen/.cproject b/build/tizen/.cproject new file mode 100644 index 000000000000..b833b8ab2e51 --- /dev/null +++ b/build/tizen/.cproject @@ -0,0 +1,975 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/tizen/.exportMap b/build/tizen/.exportMap new file mode 100644 index 000000000000..43e310e053e2 --- /dev/null +++ b/build/tizen/.exportMap @@ -0,0 +1,4 @@ +{ + global: main; + local: *; +}; diff --git a/build/tizen/.gitignore b/build/tizen/.gitignore new file mode 100644 index 000000000000..6c2a09550904 --- /dev/null +++ b/build/tizen/.gitignore @@ -0,0 +1,3 @@ +/SA_Report +/Emulator +/res diff --git a/build/tizen/.project b/build/tizen/.project new file mode 100644 index 000000000000..c19e93581851 --- /dev/null +++ b/build/tizen/.project @@ -0,0 +1,301 @@ + + + libcocos2dx + + + + + + org.tizen.nativecore.apichecker.apicheckerbuilder + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + org.tizen.nativecore.apichecker.core.builder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.tizen.nativecore.apichecker.core.tizenCppNature + org.tizen.nativecore.apichecker.apicheckernature + + + + cocos + 2 + PARENT-2-PROJECT_LOC/cocos + + + extensions + 2 + PARENT-2-PROJECT_LOC/extensions + + + external + 2 + PARENT-2-PROJECT_LOC/external + + + + + 1423558551456 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-projectRelativePath-matches-false-false-*/.tpk + + + + 1423558551461 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-Android.mk + + + + 1423558551465 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-CMakeLists.txt + + + + 1423558551469 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*_props$ + + + + 1423558551473 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-libcocos2d_8_1 + + + + 1423558551477 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*.props$ + + + + 1423558551482 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*vcxproj.* + + + + 1423558551486 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*\.def$ + + + + 1423558551490 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*\.mm$ + + + + 1423558551494 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*\.m$ + + + + 1423558551498 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-proj.win32 + + + + 1423558551503 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-proj.wp8 + + + + 1423558551508 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-^proj.win.* + + + + 1423558551513 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-android + + + + 1423558551518 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-apple + + + + 1423558551523 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-desktop + + + + 1423558551528 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-ios + + + + 1423558551533 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-linux + + + + 1423558551537 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-mac + + + + 1423558551542 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*win8.1.* + + + + 1423558551559 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*wp8.* + + + + 1423558551564 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*winrt.* + + + + 1423558551578 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-scripting + + + + 1423558551597 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-lua + + + + 1423558551615 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*win32.* + + + + 1423558551627 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-true-.*wp_8.* + + + + 1414416409298 + cocos/audio + 10 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-openal + + + + diff --git a/build/tizen/.tproject b/build/tizen/.tproject new file mode 100644 index 000000000000..824eaa1748c9 --- /dev/null +++ b/build/tizen/.tproject @@ -0,0 +1,12 @@ + + + + + mobile-2.4 + + + + + + + diff --git a/cmake/Modules/SetCompilerOptions.cmake b/cmake/Modules/SetCompilerOptions.cmake index 83383db1243e..c8fa020da62e 100644 --- a/cmake/Modules/SetCompilerOptions.cmake +++ b/cmake/Modules/SetCompilerOptions.cmake @@ -23,7 +23,7 @@ macro (SetCompilerOptions) # definitions for bullet if (USE_BULLET) add_definitions(-DCC_ENABLE_BULLET_INTEGRATION=1) - add_definitions(-DCC_USE_PHYSICS=1) + add_definitions(-DCC_USE_3D_PHYSICS=1) else() add_definitions(-DCC_ENABLE_BULLET_INTEGRATION=0) add_definitions(-DCC_USE_3D_PHYSICS=0) diff --git a/cocos/2d/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp index beea0b952d3f..cb02318f0cbb 100644 --- a/cocos/2d/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -194,11 +194,11 @@ void OrbitCamera::startWithTarget(Node *target) float r, zenith, azimuth; this->sphericalRadius(&r, &zenith, &azimuth); - if( isnan(_radius) ) + if( std::isnan(_radius) ) _radius = r; - if( isnan(_angleZ) ) + if( std::isnan(_angleZ) ) _angleZ = (float)CC_RADIANS_TO_DEGREES(zenith); - if( isnan(_angleX) ) + if( std::isnan(_angleX) ) _angleX = (float)CC_RADIANS_TO_DEGREES(azimuth); _radZ = (float)CC_DEGREES_TO_RADIANS(_angleZ); diff --git a/cocos/2d/CCActionCatmullRom.cpp b/cocos/2d/CCActionCatmullRom.cpp index e169e02d16f7..a00bbc18ba67 100644 --- a/cocos/2d/CCActionCatmullRom.cpp +++ b/cocos/2d/CCActionCatmullRom.cpp @@ -57,6 +57,9 @@ PointArray* PointArray::create(ssize_t capacity) bool PointArray::initWithCapacity(ssize_t capacity) { _controlPoints = new (std::nothrow) vector(); + if (capacity > 0) { + _controlPoints->reserve(capacity); + } return true; } @@ -112,7 +115,7 @@ void PointArray::setControlPoints(vector *controlPoints) _controlPoints = controlPoints; } -void PointArray::addControlPoint(Vec2 controlPoint) +void PointArray::addControlPoint(const Vec2& controlPoint) { _controlPoints->push_back(new Vec2(controlPoint.x, controlPoint.y)); } diff --git a/cocos/2d/CCActionCatmullRom.h b/cocos/2d/CCActionCatmullRom.h index 83d132e7cd2a..7dedd927f93a 100644 --- a/cocos/2d/CCActionCatmullRom.h +++ b/cocos/2d/CCActionCatmullRom.h @@ -88,7 +88,7 @@ class CC_DLL PointArray : public Ref, public Clonable * @js NA * @param controlPoint A control point. */ - void addControlPoint(Vec2 controlPoint); + void addControlPoint(const Vec2& controlPoint); /** Inserts a controlPoint at index. * diff --git a/cocos/2d/CCActionGrid3D.cpp b/cocos/2d/CCActionGrid3D.cpp index 95704e2f194f..8cd6564d5510 100644 --- a/cocos/2d/CCActionGrid3D.cpp +++ b/cocos/2d/CCActionGrid3D.cpp @@ -653,7 +653,7 @@ void Waves::update(float time) // implementation of Twirl -Twirl* Twirl::create(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude) +Twirl* Twirl::create(float duration, const Size& gridSize, const Vec2& position, unsigned int twirls, float amplitude) { Twirl *action = new (std::nothrow) Twirl(); @@ -672,7 +672,7 @@ Twirl* Twirl::create(float duration, const Size& gridSize, Vec2 position, unsign return action; } -bool Twirl::initWithDuration(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude) +bool Twirl::initWithDuration(float duration, const Size& gridSize, const Vec2& position, unsigned int twirls, float amplitude) { if (Grid3DAction::initWithDuration(duration, gridSize)) { diff --git a/cocos/2d/CCActionGrid3D.h b/cocos/2d/CCActionGrid3D.h index fe782db0361b..16f2ca22067d 100644 --- a/cocos/2d/CCActionGrid3D.h +++ b/cocos/2d/CCActionGrid3D.h @@ -545,7 +545,7 @@ class CC_DLL Twirl : public Grid3DAction @param amplitude Specify the amplitude of the Twirl action. @return If the creation success, return a pointer of Twirl action; otherwise, return nil. */ - static Twirl* create(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude); + static Twirl* create(float duration, const Size& gridSize, const Vec2& position, unsigned int twirls, float amplitude); /** @brief Get the center position of twirl action. @@ -598,7 +598,7 @@ class CC_DLL Twirl : public Grid3DAction @param amplitude Specify the amplitude of the Twirl action. @return If the initialization success, return true; otherwise, return false. */ - bool initWithDuration(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude); + bool initWithDuration(float duration, const Size& gridSize, const Vec2& position, unsigned int twirls, float amplitude); protected: /* twirl center */ diff --git a/cocos/2d/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp index ad91c57d7dcf..4d54187f94b3 100644 --- a/cocos/2d/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -1958,7 +1958,7 @@ bool Blink::initWithDuration(float duration, int blinks) void Blink::stop() { - if(NULL != _target) + if (nullptr != _target) _target->setVisible(_originalState); ActionInterval::stop(); } @@ -2501,7 +2501,9 @@ void Animate::stop() { if (_animation->getRestoreOriginalFrame() && _target) { + auto blend = static_cast(_target)->getBlendFunc(); static_cast(_target)->setSpriteFrame(_origFrame); + static_cast(_target)->setBlendFunc(blend); } ActionInterval::stop(); @@ -2536,10 +2538,12 @@ void Animate::update(float t) if( splitTime <= t ) { + auto blend = static_cast(_target)->getBlendFunc(); _currFrameIndex = i; AnimationFrame* frame = frames.at(_currFrameIndex); frameToDisplay = frame->getSpriteFrame(); static_cast(_target)->setSpriteFrame(frameToDisplay); + static_cast(_target)->setBlendFunc(blend); const ValueMap& dict = frame->getUserInfo(); if ( !dict.empty() ) diff --git a/cocos/2d/CCActionManager.cpp b/cocos/2d/CCActionManager.cpp index d19fef1d9aba..8e13c538a30e 100644 --- a/cocos/2d/CCActionManager.cpp +++ b/cocos/2d/CCActionManager.cpp @@ -452,7 +452,7 @@ void ActionManager::update(float dt) { deleteHashElement(_currentTarget); } - //if some node refrence 'target', it's refrence count >= 2 (issues #14050) + //if some node reference 'target', it's reference count >= 2 (issues #14050) else if (_currentTarget->target->getReferenceCount() == 1) { deleteHashElement(_currentTarget); diff --git a/cocos/2d/CCAtlasNode.cpp b/cocos/2d/CCAtlasNode.cpp index e182ad77d5e4..ac891a6c6f74 100644 --- a/cocos/2d/CCAtlasNode.cpp +++ b/cocos/2d/CCAtlasNode.cpp @@ -28,7 +28,6 @@ THE SOFTWARE. #include "2d/CCAtlasNode.h" #include "renderer/CCTextureAtlas.h" #include "base/CCDirector.h" -#include "base/CCDirector.h" #include "renderer/CCTextureCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCGLProgram.h" diff --git a/cocos/2d/CCAutoPolygon.cpp b/cocos/2d/CCAutoPolygon.cpp index 0ac0830a1bdd..bea7bd57b53f 100644 --- a/cocos/2d/CCAutoPolygon.cpp +++ b/cocos/2d/CCAutoPolygon.cpp @@ -38,20 +38,32 @@ USING_NS_CC; static unsigned short quadIndices[]={0,1,2, 3,2,1}; const static float PRECISION = 10.0f; -PolygonInfo::PolygonInfo(const PolygonInfo& other): -triangles(), -isVertsOwner(true), -rect() +PolygonInfo::PolygonInfo() +: rect(cocos2d::Rect::ZERO) +, filename("") +, isVertsOwner(true) +{ + triangles.verts = nullptr; + triangles.indices = nullptr; + triangles.vertCount = 0; + triangles.indexCount = 0; +}; + +PolygonInfo::PolygonInfo(const PolygonInfo& other) +: triangles() +, rect() +, isVertsOwner(true) { filename = other.filename; isVertsOwner = true; rect = other.rect; triangles.verts = new (std::nothrow) V3F_C4B_T2F[other.triangles.vertCount]; triangles.indices = new (std::nothrow) unsigned short[other.triangles.indexCount]; + CCASSERT(triangles.verts && triangles.indices, "not enough memory"); triangles.vertCount = other.triangles.vertCount; triangles.indexCount = other.triangles.indexCount; - memcpy(triangles.verts, other.triangles.verts, other.triangles.vertCount*sizeof(V3F_C4B_T2F)); - memcpy(triangles.indices, other.triangles.indices, other.triangles.indexCount*sizeof(unsigned short)); + memcpy(triangles.verts, other.triangles.verts, other.triangles.vertCount * sizeof(other.triangles.verts[0])); + memcpy(triangles.indices, other.triangles.indices, other.triangles.indexCount * sizeof(other.triangles.indices[0])); }; PolygonInfo& PolygonInfo::operator= (const PolygonInfo& other) @@ -64,10 +76,11 @@ PolygonInfo& PolygonInfo::operator= (const PolygonInfo& other) rect = other.rect; triangles.verts = new (std::nothrow) V3F_C4B_T2F[other.triangles.vertCount]; triangles.indices = new (std::nothrow) unsigned short[other.triangles.indexCount]; + CCASSERT(triangles.verts && triangles.indices, "not enough memory"); triangles.vertCount = other.triangles.vertCount; triangles.indexCount = other.triangles.indexCount; - memcpy(triangles.verts, other.triangles.verts, other.triangles.vertCount*sizeof(V3F_C4B_T2F)); - memcpy(triangles.indices, other.triangles.indices, other.triangles.indexCount*sizeof(unsigned short)); + memcpy(triangles.verts, other.triangles.verts, other.triangles.vertCount * sizeof(other.triangles.verts[0])); + memcpy(triangles.indices, other.triangles.indices, other.triangles.indexCount * sizeof(other.triangles.indices[0])); } return *this; } @@ -87,7 +100,7 @@ void PolygonInfo::setQuad(V3F_C4B_T2F_Quad *quad) triangles.verts = (V3F_C4B_T2F*)quad; } -void PolygonInfo::setTriangles(TrianglesCommand::Triangles other) +void PolygonInfo::setTriangles(const TrianglesCommand::Triangles& other) { this->releaseVertsAndIndices(); isVertsOwner = false; @@ -421,7 +434,7 @@ float AutoPolygon::perpendicularDistance(const cocos2d::Vec2& i, const cocos2d:: } return res; } -std::vector AutoPolygon::rdp(std::vector v, const float& optimization) +std::vector AutoPolygon::rdp(const std::vector& v, float optimization) { if(v.size() < 3) return v; @@ -562,12 +575,14 @@ TrianglesCommand::Triangles AutoPolygon::triangulate(const std::vector& po cdt.Triangulate(); std::vector tris = cdt.GetTriangles(); - V3F_C4B_T2F* verts= new (std::nothrow) V3F_C4B_T2F[points.size()]; - unsigned short* indices = new (std::nothrow) unsigned short[tris.size()*3]; + // we won't know the size of verts and indices until we process all of the triangles! + std::vector verts; + std::vector indices; + unsigned short idx = 0; unsigned short vdx = 0; - for(std::vector::const_iterator ite = tris.begin(); ite < tris.end(); ite++) + for(std::vector::const_iterator ite = tris.begin(); ite != tris.end(); ite++) { for(int i = 0; i < 3; i++) { @@ -587,7 +602,7 @@ TrianglesCommand::Triangles AutoPolygon::triangulate(const std::vector& po if(found) { //if we found the same vertex, don't add to verts, but use the same vertex with indices - indices[idx] = j; + indices.push_back(j); idx++; } else @@ -596,8 +611,8 @@ TrianglesCommand::Triangles AutoPolygon::triangulate(const std::vector& po auto c4b = Color4B::WHITE; auto t2f = Tex2F(0,0); // don't worry about tex coords now, we calculate that later V3F_C4B_T2F vert = {v3,c4b,t2f}; - verts[vdx] = vert; - indices[idx] = vdx; + verts.push_back(vert); + indices.push_back(vdx); idx++; vdx++; } @@ -607,7 +622,17 @@ TrianglesCommand::Triangles AutoPolygon::triangulate(const std::vector& po { delete j; }; - TrianglesCommand::Triangles triangles = {verts, indices, vdx, idx}; + + // now that we know the size of verts and indices we can create the buffers + V3F_C4B_T2F* vertsBuf = new (std::nothrow) V3F_C4B_T2F[verts.size()]; + memcpy(vertsBuf, verts.data(), verts.size() * sizeof(V3F_C4B_T2F)); + + unsigned short* indicesBuf = new (std::nothrow) unsigned short[indices.size()]; + memcpy(indicesBuf, indices.data(), indices.size() * sizeof(short)); + + // Triangles should really use std::vector and not arrays for verts and indices. + // Then the above memcpy would not be necessary + TrianglesCommand::Triangles triangles = { vertsBuf, indicesBuf, static_cast(verts.size()), static_cast(indices.size()) }; return triangles; } @@ -679,6 +704,5 @@ PolygonInfo AutoPolygon::generateTriangles(const Rect& rect, const float& epsilo PolygonInfo AutoPolygon::generatePolygon(const std::string& filename, const Rect& rect, const float epsilon, const float threshold) { AutoPolygon ap(filename); - auto ret = ap.generateTriangles(rect, epsilon, threshold); - return ret; + return ap.generateTriangles(rect, epsilon, threshold); } diff --git a/cocos/2d/CCAutoPolygon.h b/cocos/2d/CCAutoPolygon.h index 25cebe9303ad..422128dd60a4 100644 --- a/cocos/2d/CCAutoPolygon.h +++ b/cocos/2d/CCAutoPolygon.h @@ -54,17 +54,8 @@ class CC_DLL PolygonInfo * @memberof PolygonInfo * @return PolygonInfo object */ - PolygonInfo(): - rect(cocos2d::Rect::ZERO), - filename(""), - isVertsOwner(true) - { - triangles.verts = nullptr; - triangles.indices = nullptr; - triangles.vertCount = 0; - triangles.indexCount = 0; - }; - + PolygonInfo(); + /** * Create an polygoninfo from the data of another Polygoninfo * @param other another PolygonInfo to be copied @@ -95,7 +86,7 @@ class CC_DLL PolygonInfo * as the verts memory are managed by other objects * @param triangles a pointer to the TrianglesCommand::Triangles object */ - void setTriangles(TrianglesCommand::Triangles triangles); + void setTriangles(const TrianglesCommand::Triangles& triangles); /** * get vertex count @@ -260,7 +251,7 @@ class CC_DLL AutoPolygon int getIndexFromPos(const unsigned int& x, const unsigned int& y){return y*_width+x;}; cocos2d::Vec2 getPosFromIndex(const unsigned int& i){return cocos2d::Vec2(i%_width, i/_width);}; - std::vector rdp(std::vector v, const float& optimization); + std::vector rdp(const std::vector& v, float optimization); float perpendicularDistance(const cocos2d::Vec2& i, const cocos2d::Vec2& start, const cocos2d::Vec2& end); //real rect is the size that is in scale with the texture file diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index b5229c8bd4b5..d7e4b7fa257c 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -107,9 +107,7 @@ bool ClippingNode::init() bool ClippingNode::init(Node *stencil) { - CC_SAFE_RELEASE(_stencil); setStencil(stencil); - CC_SAFE_RETAIN(_stencil); return true; } @@ -292,6 +290,9 @@ Node* ClippingNode::getStencil() const void ClippingNode::setStencil(Node *stencil) { + if (_stencil == stencil) + return; + #if CC_ENABLE_GC_FOR_NATIVE_OBJECTS auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); if (sEngine) diff --git a/cocos/2d/CCDrawingPrimitives.h b/cocos/2d/CCDrawingPrimitives.h index 38379c027d98..21370d99e330 100644 --- a/cocos/2d/CCDrawingPrimitives.h +++ b/cocos/2d/CCDrawingPrimitives.h @@ -196,7 +196,7 @@ namespace DrawPrimitives * @param origin The origin of the bezier path. * @param control The control of the bezier path. * @param destination The destination of the bezier path. - * @param segments The The number of segments. + * @param segments The number of segments. * @warning This function could be pretty slow. Use it only for debugging purposes. * @since v0.8 */ @@ -208,7 +208,7 @@ namespace DrawPrimitives * @param control1 The first control of the bezier path. * @param control2 The second control of the bezier path. * @param destination The destination of the bezier path. - * @param segments The The number of segments. + * @param segments The number of segments. * @warning This function could be pretty slow. Use it only for debugging purposes. * @since v0.8 */ @@ -217,7 +217,7 @@ namespace DrawPrimitives /** Draws a Catmull Rom path. * * @param arrayOfControlPoints A point array of control point. - * @param segments The The number of segments. + * @param segments The number of segments. * @warning This function could be pretty slow. Use it only for debugging purposes. * @since v2.0 */ @@ -227,7 +227,7 @@ namespace DrawPrimitives * * @param config A array point. * @param tension The tension of the spline. - * @param segments The The number of segments. + * @param segments The number of segments. * @warning This function could be pretty slow. Use it only for debugging purposes. * @since v2.0 */ diff --git a/cocos/2d/CCFastTMXLayer.cpp b/cocos/2d/CCFastTMXLayer.cpp index 34e4f046cc54..6d367cc0375f 100644 --- a/cocos/2d/CCFastTMXLayer.cpp +++ b/cocos/2d/CCFastTMXLayer.cpp @@ -828,7 +828,7 @@ void TMXLayer::setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags flag } } -void TMXLayer::setupTileSprite(Sprite* sprite, Vec2 pos, int gid) +void TMXLayer::setupTileSprite(Sprite* sprite, const Vec2& pos, int gid) { sprite->setPosition(getPositionAt(pos)); sprite->setPositionZ((float)getVertexZForPos(pos)); diff --git a/cocos/2d/CCFastTMXLayer.h b/cocos/2d/CCFastTMXLayer.h index 745f93fc06c4..085bfb659982 100644 --- a/cocos/2d/CCFastTMXLayer.h +++ b/cocos/2d/CCFastTMXLayer.h @@ -261,7 +261,7 @@ class CC_DLL TMXLayer : public Node * @param pos The tile coordinate. * @param gid The tile gid. */ - void setupTileSprite(Sprite* sprite, Vec2 pos, int gid); + void setupTileSprite(Sprite* sprite, const Vec2& pos, int gid); // // Override diff --git a/cocos/2d/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp index 5b4ce9d6a7cf..cd8ae17e3d2d 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -316,8 +316,8 @@ std::set* BMFontConfiguration::parseConfigFile(const std::string& auto next = strchr(contents, '\n'); auto base = contents; - int lineLength = 0; - int parseCount = 0; + size_t lineLength = 0; + size_t parseCount = 0; while (next) { lineLength = ((int)(next - base)); diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 1dd85af6f788..31e161080ddc 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -779,9 +779,9 @@ bool Label::alignText() do { _fontAtlas->prepareLetterDefinitions(_utf16Text); auto& textures = _fontAtlas->getTextures(); - if (textures.size() > _batchNodes.size()) + if (textures.size() > static_cast(_batchNodes.size())) { - for (auto index = _batchNodes.size(); index < textures.size(); ++index) + for (auto index = static_cast(_batchNodes.size()); index < textures.size(); ++index) { auto batchNode = SpriteBatchNode::createWithTexture(textures.at(index)); if (batchNode) diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index fc63904ab7b7..2edb1123f49e 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -34,7 +34,6 @@ THE SOFTWARE. #if CC_LABELATLAS_DEBUG_DRAW #include "renderer/CCRenderer.h" -#include "base/CCDirector.h" #endif NS_CC_BEGIN diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index 43519e7c5355..acbe318fc18b 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -35,6 +35,7 @@ #include "renderer/CCQuadCommand.h" #include "renderer/CCRenderer.h" #include "renderer/CCTextureAtlas.h" +#include "base/CCProfiling.h" #include "deprecated/CCString.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index 0cd468f232d3..338902bcb1d4 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -51,6 +51,7 @@ THE SOFTWARE. #include "base/base64.h" #include "base/ZipUtils.h" #include "base/CCDirector.h" +#include "base/CCProfiling.h" #include "renderer/CCTextureCache.h" #include "deprecated/CCString.h" #include "platform/CCFileUtils.h" @@ -932,6 +933,12 @@ void ParticleSystem::update(float dt) } else { + //Why use so many for-loop separately instead of putting them together? + //When the processor needs to read from or write to a location in memory, + //it first checks whether a copy of that data is in the cache. + //And every property's memory of the particle system is continuous, + //for the purpose of improving cache hit rate, we should process only one property in one for-loop AFAP. + //It was proved to be effective especially for low-end machine. for (int i = 0; i < _particleCount; ++i) { _particleData.modeB.angle[i] += _particleData.modeB.degreesPerSecond[i] * dt; diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 4e9e3dfef201..e4fcb45dd5d3 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -1183,7 +1183,7 @@ std::string Sprite::getDescription() const return StringUtils::format("", _tag, texture_id ); } -PolygonInfo& Sprite::getPolygonInfo() +const PolygonInfo& Sprite::getPolygonInfo() const { return _polyInfo; } diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index d408bcba14e5..c5adf0eced2c 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -406,9 +406,9 @@ class CC_DLL Sprite : public Node, public TextureProtocol /** * returns a reference of the polygon information associated with this sprite * - * @return a copy of PolygonInfo + * @return a reference of PolygonInfo */ - PolygonInfo& getPolygonInfo(); + const PolygonInfo& getPolygonInfo() const; /** * set the sprite to use this new PolygonInfo @@ -470,9 +470,6 @@ class CC_DLL Sprite : public Node, public TextureProtocol virtual void setIgnoreAnchorPointForPosition(bool value) override; - // @deprecated Use setIgnoreAnchorPointForPosition() instead. - CC_DEPRECATED_ATTRIBUTE virtual void ignoreAnchorPointForPosition(bool value) override { setIgnoreAnchorPointForPosition(value); } - virtual void setVisible(bool bVisible) override; virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void setOpacityModifyRGB(bool modify) override; diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 6d2eae4079e0..eb3aaf02de69 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -29,6 +29,7 @@ THE SOFTWARE. #include "2d/CCSpriteBatchNode.h" #include "2d/CCSprite.h" #include "base/CCDirector.h" +#include "base/CCProfiling.h" #include "renderer/CCTextureCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCQuadCommand.h" diff --git a/cocos/2d/CCSpriteFrame.cpp b/cocos/2d/CCSpriteFrame.cpp index 809fcbac89f9..18bf7fbc61cb 100644 --- a/cocos/2d/CCSpriteFrame.cpp +++ b/cocos/2d/CCSpriteFrame.cpp @@ -188,7 +188,7 @@ void SpriteFrame::setAnchorPoint(const Vec2& anchorPoint) bool SpriteFrame::hasAnchorPoint() const { - return !isnan(_anchorPoint.x); + return !std::isnan(_anchorPoint.x); } void SpriteFrame::setTexture(Texture2D * texture) @@ -218,7 +218,7 @@ void SpriteFrame::setPolygonInfo(const PolygonInfo &polygonInfo) _polygonInfo = polygonInfo; } -const PolygonInfo &SpriteFrame::getPolygonInfo() const +const PolygonInfo& SpriteFrame::getPolygonInfo() const { return _polygonInfo; } diff --git a/cocos/2d/CCSpriteFrame.h b/cocos/2d/CCSpriteFrame.h index ae443b1ff301..a91ac54bea64 100644 --- a/cocos/2d/CCSpriteFrame.h +++ b/cocos/2d/CCSpriteFrame.h @@ -215,9 +215,9 @@ class CC_DLL SpriteFrame : public Ref, public Clonable /** Get the polygonInfo for this sprite * - * @return polygonInfo structure + * @return a reference to the polygonInfo structure */ - const PolygonInfo &getPolygonInfo() const; + const PolygonInfo& getPolygonInfo() const; /** Check if sprite frame is a polygon sprite * diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index 85758eeac2f7..86e73362a3bd 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -322,7 +322,7 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dict, const std:: {"I8", Texture2D::PixelFormat::I8}, {"AI88", Texture2D::PixelFormat::AI88}, {"ALPHA_INTENSITY", Texture2D::PixelFormat::AI88}, - //{"BGRA8888", Texture2D::PixelFormat::BGRA8888}, no Image convertion RGBA -> BGRA + //{"BGRA8888", Texture2D::PixelFormat::BGRA8888}, no Image conversion RGBA -> BGRA {"RGB888", Texture2D::PixelFormat::RGB888} }; diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index 05217b29901d..49a2314f029a 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -224,7 +224,7 @@ void TMXLayer::parseInternalProperties() } } -void TMXLayer::setupTileSprite(Sprite* sprite, Vec2 pos, int gid) +void TMXLayer::setupTileSprite(Sprite* sprite, const Vec2& pos, int gid) { sprite->setPosition(getPositionAt(pos)); sprite->setPositionZ((float)getVertexZForPos(pos)); @@ -281,7 +281,7 @@ void TMXLayer::setupTileSprite(Sprite* sprite, Vec2 pos, int gid) } } -Sprite* TMXLayer::reusedTileWithRect(Rect rect) +Sprite* TMXLayer::reusedTileWithRect(const Rect& rect) { if (! _reusedTile) { diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index c0936db07a50..33bfbb475cb6 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -307,8 +307,8 @@ class CC_DLL TMXLayer : public SpriteBatchNode /* The layer recognizes some special properties, like cc_vertexz */ void parseInternalProperties(); - void setupTileSprite(Sprite* sprite, Vec2 pos, int gid); - Sprite* reusedTileWithRect(Rect rect); + void setupTileSprite(Sprite* sprite, const Vec2& pos, int gid); + Sprite* reusedTileWithRect(const Rect& rect); int getVertexZForPos(const Vec2& pos); // index diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index fd9216a18bd5..a592686e850f 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -34,7 +34,7 @@ NS_CC_BEGIN #define CURSOR_TIME_SHOW_HIDE 0.5f #define CURSOR_DEFAULT_CHAR '|' - +#define PASSWORD_STYLE_TEXT_DEFAULT "\xe2\x80\xa2" static int _calcCharCount(const char * text) { int n = 0; @@ -63,7 +63,7 @@ TextFieldTTF::TextFieldTTF() , _placeHolder("") // prevent Label initWithString assertion , _colorText(Color4B::WHITE) , _secureTextEntry(false) -,_passwordStyleText("\u25CF") +, _passwordStyleText(PASSWORD_STYLE_TEXT_DEFAULT) , _cursorEnabled(false) , _cursorPosition(0) , _cursorChar(CURSOR_DEFAULT_CHAR) @@ -134,7 +134,7 @@ bool TextFieldTTF::initWithPlaceHolder(const std::string& placeholder, const std // If fontName is ttf file and it corrected, use TTFConfig if (FileUtils::getInstance()->isFileExist(fontName)) { - TTFConfig ttfConfig(fontName.c_str(), fontSize, GlyphCollection::DYNAMIC); + TTFConfig ttfConfig(fontName, fontSize, GlyphCollection::DYNAMIC); if (setTTFConfig(ttfConfig)) { break; diff --git a/cocos/2d/win10_props/cocos2d_win10.props b/cocos/2d/win10_props/cocos2d_win10.props index b298cac4ff89..44df4754432f 100644 --- a/cocos/2d/win10_props/cocos2d_win10.props +++ b/cocos/2d/win10_props/cocos2d_win10.props @@ -10,7 +10,7 @@ $(EngineRoot)cocos\editor-support;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\include;$(EngineRoot)external\freetype2\include\$(COCOS2D_PLATFORM)\freetype2;$(EngineRoot)external\curl\include\$(COCOS2D_PLATFORM);$(EngineRoot)external\websockets\include\$(COCOS2D_PLATFORM);$(EngineRoot)external\chipmunk\include;$(EngineRoot)external\sqlite3\include;$(EngineRoot)cocos;$(EngineRoot)extensions;$(EngineRoot)external;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\unzip;$(EngineRoot)external\tinyxml2;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\xxhash;$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalIncludeDirectories) - WINRT;_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_UNICODE;UNICODE;RAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN;%(PreprocessorDefinitions) + WINRT;_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_UNICODE;UNICODE;RAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN;_USRJSSTATIC;%(PreprocessorDefinitions) true true false 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 e4f953eb8308..600edb48cb05 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 @@ -10,7 +10,7 @@ $(EngineRoot)cocos\editor-support;$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\include;$(EngineRoot)external\freetype2\include\$(COCOS2D_PLATFORM)\freetype2;$(EngineRoot)external\curl\include\$(COCOS2D_PLATFORM);$(EngineRoot)external\websockets\include\$(COCOS2D_PLATFORM);$(EngineRoot)external\chipmunk\include;$(EngineRoot)external\sqlite3\include;$(EngineRoot)cocos;$(EngineRoot)extensions;$(EngineRoot)external;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\unzip;$(EngineRoot)external\tinyxml2;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\xxhash;$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalIncludeDirectories) - WINRT;_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_UNICODE;UNICODE;RAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN;%(PreprocessorDefinitions) + WINRT;_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_UNICODE;UNICODE;RAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN;_USRJSSTATIC;%(PreprocessorDefinitions) true true false diff --git a/cocos/2d/winrt_8.1_props/cocos2d_winrt_8.1_app.props b/cocos/2d/winrt_8.1_props/cocos2d_winrt_8.1_app.props index c974f7009a7c..db92b65200ee 100644 --- a/cocos/2d/winrt_8.1_props/cocos2d_winrt_8.1_app.props +++ b/cocos/2d/winrt_8.1_props/cocos2d_winrt_8.1_app.props @@ -4,6 +4,7 @@ $(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\prebuilt\$(Platform)\ $(EngineRoot)external\curl\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\ + $(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform)\ $(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\ $(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform)\ $(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\OggDecoder\prebuilt\$(Platform)\ @@ -14,6 +15,9 @@ true + + + true true diff --git a/cocos/3d/CCAnimate3D.cpp b/cocos/3d/CCAnimate3D.cpp index 325c9437a714..7163ddbbb372 100644 --- a/cocos/3d/CCAnimate3D.cpp +++ b/cocos/3d/CCAnimate3D.cpp @@ -248,7 +248,7 @@ void Animate3D::startWithTarget(Node *target) action->_accTransTime = 0.0f; action->_weight = 1.0f; action->_lastTime = 0.f; - + s_runningAnimates.erase(target); s_fadeInAnimates[target] = this; _accTransTime = 0.0f; _state = Animate3D::Animate3DState::FadeIn; diff --git a/cocos/3d/CCMeshSkin.cpp b/cocos/3d/CCMeshSkin.cpp index 878e4d1eedc9..437a5fdf4db9 100644 --- a/cocos/3d/CCMeshSkin.cpp +++ b/cocos/3d/CCMeshSkin.cpp @@ -23,7 +23,6 @@ ****************************************************************************/ #include "3d/CCMeshSkin.h" -#include "3d/CCSkeleton3D.h" #include "3d/CCBundle3D.h" #include "3d/CCSkeleton3D.h" diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 587986b5b38f..4b2bac5bec0a 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -29,7 +29,6 @@ #include "3d/CCSprite3DMaterial.h" #include "3d/CCAttachNode.h" #include "3d/CCMesh.h" -#include "3d/CCSprite3DMaterial.h" #include "base/CCDirector.h" #include "base/CCAsyncTaskPool.h" @@ -589,6 +588,7 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m setScaleY(scale.y); setScaleZ(scale.z); + node = this; } } else diff --git a/cocos/3d/CCTerrain.cpp b/cocos/3d/CCTerrain.cpp index 03a5959c48b0..e7e9d7da4039 100644 --- a/cocos/3d/CCTerrain.cpp +++ b/cocos/3d/CCTerrain.cpp @@ -294,7 +294,7 @@ Terrain::Terrain() #endif } -void Terrain::setChunksLOD(Vec3 cameraPos) +void Terrain::setChunksLOD(const Vec3& cameraPos) { int chunk_amount_y = _imageHeight/_chunkSize.height; int chunk_amount_x = _imageWidth/_chunkSize.width; @@ -369,9 +369,9 @@ float Terrain::getHeight(float x, float z, Vec3 * normal) const } } -float Terrain::getHeight(Vec2 pos, Vec3*Normal) const +float Terrain::getHeight(const Vec2& pos, Vec3* normal) const { - return getHeight(pos.x,pos.y,Normal); + return getHeight(pos.x, pos.y, normal); } float Terrain::getImageHeight(int pixel_x,int pixel_y) const @@ -606,7 +606,7 @@ void Terrain::setMaxDetailMapAmount(int max_value) _maxDetailMapValue = max_value; } -cocos2d::Vec2 Terrain::convertToTerrainSpace(Vec2 worldSpaceXZ) const +cocos2d::Vec2 Terrain::convertToTerrainSpace(const Vec2& worldSpaceXZ) const { Vec2 pos(worldSpaceXZ.x,worldSpaceXZ.y); @@ -1638,14 +1638,14 @@ Terrain::DetailMap::DetailMap() _detailMapSize = 35; } -Terrain::Triangle::Triangle(Vec3 p1, Vec3 p2, Vec3 p3) +Terrain::Triangle::Triangle(const Vec3& p1, const Vec3& p2, const Vec3& p3) { _p1 = p1; _p2 = p2; _p3 = p3; } -void Terrain::Triangle::transform(cocos2d::Mat4 matrix) +void Terrain::Triangle::transform(const cocos2d::Mat4& matrix) { matrix.transformPoint(&_p1); matrix.transformPoint(&_p2); diff --git a/cocos/3d/CCTerrain.h b/cocos/3d/CCTerrain.h index 173d4fb3e046..00a259a2a845 100644 --- a/cocos/3d/CCTerrain.h +++ b/cocos/3d/CCTerrain.h @@ -114,9 +114,9 @@ class CC_DLL Terrain : public Node */ struct Triangle { - Triangle(Vec3 p1, Vec3 p2, Vec3 p3); + Triangle(const Vec3& p1, const Vec3& p2, const Vec3& p3); bool getInsterctPoint(const Ray &ray, Vec3& interScetPoint) const; - void transform(Mat4 matrix); + void transform(const Mat4& matrix); Vec3 _p1, _p2, _p3; }; @@ -181,7 +181,7 @@ class CC_DLL Terrain : public Node { /*constructor*/ TerrainVertexData(){}; - TerrainVertexData(Vec3 v1, Tex2F v2) + TerrainVertexData(const Vec3& v1, const Tex2F& v2) { _position = v1; _texcoord = v2; @@ -334,7 +334,7 @@ class CC_DLL Terrain : public Node * @param normal the specified position's normal vector in terrain . if this argument is NULL or nullptr,Normal calculation shall be skip. * @return the height value of the specified position of the terrain, if the (X,Z) position is out of the terrain bounds,it shall return 0; **/ - float getHeight(Vec2 pos, Vec3*Normal = nullptr) const; + float getHeight(const Vec2& pos, Vec3* normal = nullptr) const; /**get the normal of the specified position in terrain * @return the normal vector of the specified position of the terrain. @@ -387,7 +387,7 @@ class CC_DLL Terrain : public Node /** * Convert a world Space position (X,Z) to terrain space position (X,Z) */ - Vec2 convertToTerrainSpace(Vec2 worldSpace) const; + Vec2 convertToTerrainSpace(const Vec2& worldSpace) const; /** * reset the heightmap data. @@ -442,7 +442,7 @@ class CC_DLL Terrain : public Node * recursively set each chunk's LOD * @param cameraPos the camera position in world space **/ - void setChunksLOD(Vec3 cameraPos); + void setChunksLOD(const Vec3& cameraPos); /** * load Vertices from height filed for the whole terrain. diff --git a/cocos/audio/AudioEngine.cpp b/cocos/audio/AudioEngine.cpp index f638b535541f..0f822147befe 100644 --- a/cocos/audio/AudioEngine.cpp +++ b/cocos/audio/AudioEngine.cpp @@ -40,6 +40,8 @@ #include "audio/winrt/AudioEngine-winrt.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "audio/linux/AudioEngine-linux.h" +#elif CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN +#include "audio/tizen/AudioEngine-tizen.h" #endif #define TIME_DELAY_PRECISION 0.0001 diff --git a/cocos/audio/android/AudioEngine-inl.cpp b/cocos/audio/android/AudioEngine-inl.cpp index f5dbd3a64b7e..2e1f2e9e14f3 100644 --- a/cocos/audio/android/AudioEngine-inl.cpp +++ b/cocos/audio/android/AudioEngine-inl.cpp @@ -38,6 +38,7 @@ #include "base/CCDirector.h" #include "base/CCScheduler.h" #include "platform/android/CCFileUtils-android.h" +#include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" using namespace cocos2d; using namespace cocos2d::experimental; @@ -104,27 +105,31 @@ bool AudioPlayer::init(SLEngineItf engineEngine, SLObjectItf outputMixObject,con SLDataFormat_MIME format_mime = {SL_DATAFORMAT_MIME, NULL, SL_CONTAINERTYPE_UNSPECIFIED}; audioSrc.pFormat = &format_mime; - if (fileFullPath[0] != '/'){ - std::string relativePath = ""; - + if (fileFullPath[0] != '/') { + off_t start, length; + std::string relativePath; size_t position = fileFullPath.find("assets/"); + if (0 == position) { // "assets/" is at the beginning of the path and we don't want it - relativePath += fileFullPath.substr(strlen("assets/")); + relativePath = fileFullPath.substr(strlen("assets/")); } else { - relativePath += fileFullPath; + relativePath = fileFullPath; } - auto asset = AAssetManager_open(cocos2d::FileUtilsAndroid::getAssetManager(), relativePath.c_str(), AASSET_MODE_UNKNOWN); - - // open asset as file descriptor - off_t start, length; - _assetFd = AAsset_openFileDescriptor(asset, &start, &length); - if (_assetFd <= 0){ + if (cocos2d::FileUtilsAndroid::getObbFile() != nullptr) { + _assetFd = getObbAssetFileDescriptorJNI(relativePath.c_str(), &start, &length); + } else { + auto asset = AAssetManager_open(cocos2d::FileUtilsAndroid::getAssetManager(), relativePath.c_str(), AASSET_MODE_UNKNOWN); + // open asset as file descriptor + _assetFd = AAsset_openFileDescriptor(asset, &start, &length); AAsset_close(asset); + } + + if (_assetFd <= 0) { + CCLOGERROR("Failed to open file descriptor for '%s'", fileFullPath.c_str()); break; } - AAsset_close(asset); // configure audio source loc_fd = {SL_DATALOCATOR_ANDROIDFD, _assetFd, start, length}; diff --git a/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp index ddc27202c4e8..03125a95208c 100644 --- a/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp +++ b/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp @@ -75,12 +75,12 @@ AndroidJavaEngine::~AndroidJavaEngine() void AndroidJavaEngine::preloadBackgroundMusic(const char* filePath) { std::string fullPath = CocosDenshion::android::getFullPathWithoutAssetsPrefix(filePath); - JniHelper::callStaticVoidMethod(helperClassName, "preloadBackgroundMusic", filePath); + JniHelper::callStaticVoidMethod(helperClassName, "preloadBackgroundMusic", fullPath); } void AndroidJavaEngine::playBackgroundMusic(const char* filePath, bool loop) { std::string fullPath = CocosDenshion::android::getFullPathWithoutAssetsPrefix(filePath); - JniHelper::callStaticVoidMethod(helperClassName, "playBackgroundMusic", filePath, loop); + JniHelper::callStaticVoidMethod(helperClassName, "playBackgroundMusic", fullPath, loop); } void AndroidJavaEngine::stopBackgroundMusic(bool releaseData) { diff --git a/cocos/audio/apple/AudioCache.mm b/cocos/audio/apple/AudioCache.mm index 944b2de016ac..a5deccdcb26d 100644 --- a/cocos/audio/apple/AudioCache.mm +++ b/cocos/audio/apple/AudioCache.mm @@ -102,7 +102,7 @@ static ALvoid alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* da AudioBufferList theDataBuffer; ExtAudioFileRef extRef = nullptr; - NSString *fileFullPath = [[NSString alloc] initWithCString:_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]]; + NSString *fileFullPath = [[NSString alloc] initWithCString:_fileFullPath.c_str() encoding:NSUTF8StringEncoding]; auto fileURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:fileFullPath]; [fileFullPath release]; diff --git a/cocos/audio/apple/AudioPlayer.mm b/cocos/audio/apple/AudioPlayer.mm index d6266fc13c21..7b82d69289dd 100644 --- a/cocos/audio/apple/AudioPlayer.mm +++ b/cocos/audio/apple/AudioPlayer.mm @@ -145,7 +145,7 @@ of this software and associated documentation files (the "Software"), to deal ALint bufferProcessed = 0; ExtAudioFileRef extRef = nullptr; - NSString *fileFullPath = [[NSString alloc] initWithCString:_audioCache->_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]]; + NSString *fileFullPath = [[NSString alloc] initWithCString:_audioCache->_fileFullPath.c_str() encoding:NSUTF8StringEncoding]; auto fileURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:fileFullPath]; [fileFullPath release]; char* tmpBuffer = (char*)malloc(_audioCache->_queBufferBytes); diff --git a/cocos/audio/linux/AudioEngine-linux.cpp b/cocos/audio/linux/AudioEngine-linux.cpp index 5b8e2a7ca64f..b53c63f8a87a 100644 --- a/cocos/audio/linux/AudioEngine-linux.cpp +++ b/cocos/audio/linux/AudioEngine-linux.cpp @@ -1,7 +1,8 @@ /** * @author cesarpachon - */ + */ #include +#include #include "audio/linux/AudioEngine-linux.h" #include "base/CCDirector.h" @@ -13,13 +14,15 @@ using namespace cocos2d::experimental; AudioEngineImpl * g_AudioEngineImpl = nullptr; -void ERRCHECKWITHEXIT(FMOD_RESULT result) { +void ERRCHECKWITHEXIT(FMOD_RESULT result) +{ if (result != FMOD_OK) { printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); } } -bool ERRCHECK(FMOD_RESULT result) { +bool ERRCHECK(FMOD_RESULT result) +{ if (result != FMOD_OK) { printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result)); return true; @@ -27,280 +30,306 @@ bool ERRCHECK(FMOD_RESULT result) { return false; } -FMOD_RESULT F_CALLBACK channelCallback(FMOD_CHANNELCONTROL *channelcontrol, - FMOD_CHANNELCONTROL_TYPE controltype, - FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype, +FMOD_RESULT F_CALLBACK channelCallback(FMOD_CHANNELCONTROL *channelcontrol, + FMOD_CHANNELCONTROL_TYPE controltype, + FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype, void *commandData1, void *commandData2) { - - if(controltype == FMOD_CHANNELCONTROL_CHANNEL && callbacktype == FMOD_CHANNELCONTROL_CALLBACK_END){ + if (controltype == FMOD_CHANNELCONTROL_CHANNEL && callbacktype == FMOD_CHANNELCONTROL_CALLBACK_END) { g_AudioEngineImpl->onSoundFinished((FMOD::Channel *)channelcontrol); - }else{ } return FMOD_OK; } +AudioEngineImpl::AudioEngineImpl() +{ +} + +AudioEngineImpl::~AudioEngineImpl() +{ + FMOD_RESULT result; + result = pSystem->close(); + ERRCHECKWITHEXIT(result); + result = pSystem->release(); + ERRCHECKWITHEXIT(result); +} + +bool AudioEngineImpl::init() +{ + FMOD_RESULT result; + /* + Create a System object and initialize. + */ + result = FMOD::System_Create(&pSystem); + ERRCHECKWITHEXIT(result); + + result = pSystem->setOutput(FMOD_OUTPUTTYPE_PULSEAUDIO); + ERRCHECKWITHEXIT(result); + + result = pSystem->init(32, FMOD_INIT_NORMAL, 0); + ERRCHECKWITHEXIT(result); + + mapChannelInfo.clear(); + mapSound.clear(); -AudioEngineImpl::AudioEngineImpl(){ -}; - -AudioEngineImpl::~AudioEngineImpl(){ - FMOD_RESULT result; - result = pSystem->close(); - ERRCHECKWITHEXIT(result); - result = pSystem->release(); - ERRCHECKWITHEXIT(result); -}; - - -bool AudioEngineImpl::init(){ - FMOD_RESULT result; - /* - Create a System object and initialize. - */ - result = FMOD::System_Create(&pSystem); - ERRCHECKWITHEXIT(result); - - result = pSystem->setOutput(FMOD_OUTPUTTYPE_PULSEAUDIO); - ERRCHECKWITHEXIT(result); - - result = pSystem->init(32, FMOD_INIT_NORMAL, 0); - ERRCHECKWITHEXIT(result); - - mapChannelInfo.clear(); - mapSound.clear(); - - auto scheduler = cocos2d::Director::getInstance()->getScheduler(); - scheduler->schedule(schedule_selector(AudioEngineImpl::update), this, 0.05f, false); - - g_AudioEngineImpl = this; - - return true; -}; - -int AudioEngineImpl::play2d(const std::string &fileFullPath ,bool loop ,float volume){ - int id = preload(fileFullPath, nullptr); - if(id >= 0){ - mapChannelInfo[id].loop=loop; - mapChannelInfo[id].channel->setPaused(true); - mapChannelInfo[id].volume = volume; - AudioEngine::_audioIDInfoMap[id].state = AudioEngine::AudioState::PAUSED; - resume(id); - } - return id; -}; - -void AudioEngineImpl::setVolume(int audioID,float volume){ - try{ - mapChannelInfo[audioID].channel->setVolume(volume); - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::setVolume: invalid audioID: %d\n", audioID); - } -}; - -void AudioEngineImpl::setLoop(int audioID, bool loop){ - try{ - mapChannelInfo[audioID].channel->setLoopCount(loop?-1:0); - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::setLoop: invalid audioID: %d\n", audioID); - } -}; - -bool AudioEngineImpl::pause(int audioID){ - try{ - mapChannelInfo[audioID].channel->setPaused(true); - AudioEngine::_audioIDInfoMap[audioID].state = AudioEngine::AudioState::PAUSED; - return true; - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::pause: invalid audioID: %d\n", audioID); - return false; - } -}; - -bool AudioEngineImpl::resume(int audioID){ -try{ - - if(!mapChannelInfo[audioID].channel){ - FMOD::Channel *channel = nullptr; - FMOD::ChannelGroup *channelgroup = nullptr; - //starts the sound in pause mode, use the channel to unpause - FMOD_RESULT result = pSystem->playSound(mapChannelInfo[audioID].sound, channelgroup, true, &channel); - if(ERRCHECK(result)){ - return false; - } - channel->setMode(mapChannelInfo[audioID].loop?FMOD_LOOP_NORMAL:FMOD_LOOP_OFF); - channel->setLoopCount(mapChannelInfo[audioID].loop?-1:0); - channel->setVolume(mapChannelInfo[audioID].volume); - channel->setUserData((void *)mapChannelInfo[audioID].id); - mapChannelInfo[audioID].channel = channel; + auto scheduler = cocos2d::Director::getInstance()->getScheduler(); + scheduler->schedule(schedule_selector(AudioEngineImpl::update), this, 0.05f, false); + + g_AudioEngineImpl = this; + + return true; +} + +int AudioEngineImpl::play2d(const std::string &fileFullPath, bool loop, float volume) +{ + int id = preload(fileFullPath, nullptr); + if (id >= 0) { + mapChannelInfo[id].loop=loop; + mapChannelInfo[id].channel->setPaused(true); + mapChannelInfo[id].volume = volume; + AudioEngine::_audioIDInfoMap[id].state = AudioEngine::AudioState::PAUSED; + resume(id); } - - mapChannelInfo[audioID].channel->setPaused(false); - AudioEngine::_audioIDInfoMap[audioID].state = AudioEngine::AudioState::PLAYING; - - return true; - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::resume: invalid audioID: %d\n", audioID); - return false; - } -}; - -bool AudioEngineImpl::stop(int audioID){ - try{ - mapChannelInfo[audioID].channel->stop(); - mapChannelInfo[audioID].channel = nullptr; - return true; - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::stop: invalid audioID: %d\n", audioID); - return false; - } -}; - -void AudioEngineImpl::stopAll(){ - for (auto it = mapChannelInfo.begin(); it != mapChannelInfo.end(); ++it) { - ChannelInfo & audioRef = it->second; - audioRef.channel->stop(); - audioRef.channel = nullptr; - } -}; - -float AudioEngineImpl::getDuration(int audioID){ - try{ - FMOD::Sound * sound = mapChannelInfo[audioID].sound; - unsigned int length; - FMOD_RESULT result = sound->getLength(&length, FMOD_TIMEUNIT_MS); - ERRCHECK(result); - float duration = (float)length / 1000.0f; - return duration; - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::getDuration: invalid audioID: %d\n", audioID); - return AudioEngine::TIME_UNKNOWN; - } -}; - -float AudioEngineImpl::getCurrentTime(int audioID){ - try{ - unsigned int position; - FMOD_RESULT result = mapChannelInfo[audioID].channel->getPosition(&position, FMOD_TIMEUNIT_MS); - ERRCHECK(result); - float currenttime = position /1000.0f; - return currenttime; - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::getCurrentTime: invalid audioID: %d\n", audioID); - return AudioEngine::TIME_UNKNOWN; - } -}; - -bool AudioEngineImpl::setCurrentTime(int audioID, float time){ - try{ - unsigned int position = (unsigned int)(time * 1000.0f); - FMOD_RESULT result = mapChannelInfo[audioID].channel->setPosition(position, FMOD_TIMEUNIT_MS); - ERRCHECK(result); - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::setCurrentTime: invalid audioID: %d\n", audioID); - } -}; - -void AudioEngineImpl::setFinishCallback(int audioID, const std::function &callback){ - try{ - FMOD::Channel * channel = mapChannelInfo[audioID].channel; - mapChannelInfo[audioID].callback = callback; - FMOD_RESULT result = channel->setCallback(channelCallback); - ERRCHECK(result); - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::setFinishCallback: invalid audioID: %d\n", audioID); - } -}; - - -void AudioEngineImpl::onSoundFinished(FMOD::Channel * channel){ - size_t id; - try{ - void * data; - channel->getUserData(&data); - id = (size_t) data; - if(mapChannelInfo[id].callback){ - mapChannelInfo[id].callback(id, mapChannelInfo[id].path); + return id; +} + +void AudioEngineImpl::setVolume(int audioID, float volume) +{ + try { + mapChannelInfo[audioID].channel->setVolume(volume); + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::setVolume: invalid audioID: %d\n", audioID); + } +} + +void AudioEngineImpl::setLoop(int audioID, bool loop) +{ + try { + mapChannelInfo[audioID].channel->setLoopCount(loop ? -1 : 0); + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::setLoop: invalid audioID: %d\n", audioID); + } +} + +bool AudioEngineImpl::pause(int audioID) +{ + try { + mapChannelInfo[audioID].channel->setPaused(true); + AudioEngine::_audioIDInfoMap[audioID].state = AudioEngine::AudioState::PAUSED; + return true; + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::pause: invalid audioID: %d\n", audioID); + return false; + } +} + +bool AudioEngineImpl::resume(int audioID) +{ + try { + if (!mapChannelInfo[audioID].channel) { + FMOD::Channel *channel = nullptr; + FMOD::ChannelGroup *channelgroup = nullptr; + //starts the sound in pause mode, use the channel to unpause + FMOD_RESULT result = pSystem->playSound(mapChannelInfo[audioID].sound, channelgroup, true, &channel); + if (ERRCHECK(result)) { + return false; + } + channel->setMode(mapChannelInfo[audioID].loop ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF); + channel->setLoopCount(mapChannelInfo[audioID].loop ? -1 : 0); + channel->setVolume(mapChannelInfo[audioID].volume); + channel->setUserData(reinterpret_cast(static_cast(mapChannelInfo[audioID].id))); + mapChannelInfo[audioID].channel = channel; + } + + mapChannelInfo[audioID].channel->setPaused(false); + AudioEngine::_audioIDInfoMap[audioID].state = AudioEngine::AudioState::PLAYING; + + return true; + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::resume: invalid audioID: %d\n", audioID); + return false; + } +} + +bool AudioEngineImpl::stop(int audioID) +{ + try { + mapChannelInfo[audioID].channel->stop(); + mapChannelInfo[audioID].channel = nullptr; + return true; + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::stop: invalid audioID: %d\n", audioID); + return false; } - mapChannelInfo[id].channel = nullptr; - }catch(const std::out_of_range& oor){ - printf("AudioEngineImpl::onSoundFinished: invalid audioID: %d\n", id); - } -}; - - -void AudioEngineImpl::uncache(const std::string& path){ - std::string fullPath = FileUtils::getInstance()->fullPathForFilename(path); - std::map::const_iterator it = mapSound.find(fullPath); - if(it!=mapSound.end()){ - FMOD::Sound * sound = it->second; - if(sound){ - sound->release(); +} + +void AudioEngineImpl::stopAll() +{ + for (auto it = mapChannelInfo.begin(); it != mapChannelInfo.end(); ++it) { + ChannelInfo & audioRef = it->second; + audioRef.channel->stop(); + audioRef.channel = nullptr; + } +} + +float AudioEngineImpl::getDuration(int audioID) +{ + try { + FMOD::Sound * sound = mapChannelInfo[audioID].sound; + unsigned int length; + FMOD_RESULT result = sound->getLength(&length, FMOD_TIMEUNIT_MS); + ERRCHECK(result); + float duration = (float)length / 1000.0f; + return duration; + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::getDuration: invalid audioID: %d\n", audioID); + return AudioEngine::TIME_UNKNOWN; + } +} + +float AudioEngineImpl::getCurrentTime(int audioID) +{ + try { + unsigned int position; + FMOD_RESULT result = mapChannelInfo[audioID].channel->getPosition(&position, FMOD_TIMEUNIT_MS); + ERRCHECK(result); + float currenttime = position /1000.0f; + return currenttime; + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::getCurrentTime: invalid audioID: %d\n", audioID); + return AudioEngine::TIME_UNKNOWN; + } +} + +bool AudioEngineImpl::setCurrentTime(int audioID, float time) +{ + try { + unsigned int position = (unsigned int)(time * 1000.0f); + FMOD_RESULT result = mapChannelInfo[audioID].channel->setPosition(position, FMOD_TIMEUNIT_MS); + ERRCHECK(result); + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::setCurrentTime: invalid audioID: %d\n", audioID); + } +} + +void AudioEngineImpl::setFinishCallback(int audioID, const std::function &callback) +{ + try { + FMOD::Channel * channel = mapChannelInfo[audioID].channel; + mapChannelInfo[audioID].callback = callback; + FMOD_RESULT result = channel->setCallback(channelCallback); + ERRCHECK(result); + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::setFinishCallback: invalid audioID: %d\n", audioID); } - mapSound.erase(it); - } -}; +} +void AudioEngineImpl::onSoundFinished(FMOD::Channel * channel) +{ + int id = 0; + try { + void * data; + channel->getUserData(&data); + id = static_cast(reinterpret_cast(data)); + if (mapChannelInfo[id].callback) { + mapChannelInfo[id].callback(id, mapChannelInfo[id].path); + } + mapChannelInfo[id].channel = nullptr; + } + catch (const std::out_of_range& oor) { + printf("AudioEngineImpl::onSoundFinished: invalid audioID: %d\n", id); + } +} -void AudioEngineImpl::uncacheAll(){ -for (auto it = mapSound.cbegin(); it != mapSound.cend(); ++it) { - auto sound = it->second; - if(sound){ - sound->release(); +void AudioEngineImpl::uncache(const std::string& path) +{ + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(path); + std::map::const_iterator it = mapSound.find(fullPath); + if (it!=mapSound.end()) { + FMOD::Sound * sound = it->second; + if (sound) { + sound->release(); + } + mapSound.erase(it); } - } - mapSound.clear(); -}; - - -int AudioEngineImpl::preload(const std::string& filePath, std::function callback){ - FMOD::Sound * sound = findSound(filePath); - if(!sound){ - std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filePath); - FMOD_RESULT result = pSystem->createSound(fullPath.c_str(), FMOD_LOOP_OFF, 0, &sound); - if (ERRCHECK(result)){ - printf("sound effect in %s could not be preload\n", filePath.c_str()); - if(callback){ - callback(false); - } - return -1; + if (mapId.find(path) != mapId.end()) + mapId.erase(path); +} + +void AudioEngineImpl::uncacheAll() +{ + for (auto it = mapSound.cbegin(); it != mapSound.cend(); ++it) { + auto sound = it->second; + if (sound) { + sound->release(); + } } - mapSound[fullPath] = sound; - } - - int id = mapChannelInfo.size() + 1; - auto& chanelInfo = mapChannelInfo[id]; - chanelInfo.sound = sound; - chanelInfo.id = (size_t) id; - chanelInfo.channel = nullptr; - chanelInfo.callback = nullptr; - chanelInfo.path = filePath; - //we are going to use UserData to store pointer to Channel when playing - chanelInfo.sound->setUserData((void *)id); - - if(callback){ - callback(true); - } - return id; -}; - - -void AudioEngineImpl::update(float dt){ - pSystem->update(); -}; - - -FMOD::Sound * AudioEngineImpl::findSound(const std::string &path){ - std::string fullPath = FileUtils::getInstance()->fullPathForFilename(path); - std::map::const_iterator it = mapSound.find(fullPath); - return (it!=mapSound.end())?(it->second):nullptr; + mapSound.clear(); + mapId.clear(); } +int AudioEngineImpl::preload(const std::string& filePath, std::function callback) +{ + FMOD::Sound * sound = findSound(filePath); + if (!sound) { + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filePath); + FMOD_RESULT result = pSystem->createSound(fullPath.c_str(), FMOD_LOOP_OFF, 0, &sound); + if (ERRCHECK(result)) { + printf("sound effect in %s could not be preload\n", filePath.c_str()); + if (callback) { + callback(false); + } + return -1; + } + mapSound[fullPath] = sound; + } -FMOD::Channel * AudioEngineImpl::getChannel(FMOD::Sound *sound){ - size_t id; - void * data; - sound->getUserData(&data); - id = (size_t) data; - return mapChannelInfo[id].channel; -}; + int id = static_cast(mapChannelInfo.size()) + 1; + if (mapId.find(filePath) == mapId.end()) + mapId.insert({filePath, id}); + else + id = mapId.at(filePath); + + auto& chanelInfo = mapChannelInfo[id]; + chanelInfo.sound = sound; + chanelInfo.id = id; + chanelInfo.channel = nullptr; + chanelInfo.callback = nullptr; + chanelInfo.path = filePath; + //we are going to use UserData to store pointer to Channel when playing + chanelInfo.sound->setUserData(reinterpret_cast(static_cast(id))); + + if (callback) { + callback(true); + } + return id; +} + +void AudioEngineImpl::update(float dt) +{ + pSystem->update(); +} + +FMOD::Sound * AudioEngineImpl::findSound(const std::string &path) +{ + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(path); + std::map::const_iterator it = mapSound.find(fullPath); + return (it != mapSound.end()) ? (it->second) : nullptr; +} + +FMOD::Channel * AudioEngineImpl::getChannel(FMOD::Sound *sound) +{ + void * data; + sound->getUserData(&data); + int id = static_cast(reinterpret_cast(data)); + return mapChannelInfo[id].channel; +} diff --git a/cocos/audio/linux/AudioEngine-linux.h b/cocos/audio/linux/AudioEngine-linux.h index 79d5d1595bab..a0a48651827b 100644 --- a/cocos/audio/linux/AudioEngine-linux.h +++ b/cocos/audio/linux/AudioEngine-linux.h @@ -83,7 +83,7 @@ class CC_DLL AudioEngineImpl : public cocos2d::Ref FMOD::Channel * getChannel(FMOD::Sound *); struct ChannelInfo{ - size_t id; + int id; std::string path; FMOD::Sound * sound; FMOD::Channel * channel; @@ -93,6 +93,8 @@ class CC_DLL AudioEngineImpl : public cocos2d::Ref }; std::map mapChannelInfo; + + std::map mapId; std::map mapSound; diff --git a/cocos/audio/linux/SimpleAudioEngine.cpp b/cocos/audio/linux/SimpleAudioEngine.cpp index e63f9a40d0c7..8d79b0428278 100644 --- a/cocos/audio/linux/SimpleAudioEngine.cpp +++ b/cocos/audio/linux/SimpleAudioEngine.cpp @@ -7,205 +7,224 @@ using namespace CocosDenshion; using namespace cocos2d; using namespace cocos2d::experimental; - -struct SimpleAudioEngineLinux{ - SimpleAudioEngine * engine = nullptr; - int musicid; - float effectsvolume; - std::string musicpath; +struct SimpleAudioEngineLinux { + SimpleAudioEngine * engine = nullptr; + int musicid; + float effectsvolume; + std::string musicpath; }; -SimpleAudioEngineLinux * g_SimpleAudioEngineLinux = nullptr; - - -SimpleAudioEngine* SimpleAudioEngine::getInstance(){ - if(!g_SimpleAudioEngineLinux){ - g_SimpleAudioEngineLinux = new SimpleAudioEngineLinux(); - g_SimpleAudioEngineLinux->engine = new SimpleAudioEngine(); - } - return g_SimpleAudioEngineLinux->engine; -}; +SimpleAudioEngineLinux * g_SimpleAudioEngineLinux = nullptr; - void SimpleAudioEngine::end(){ - if(g_SimpleAudioEngineLinux){ - delete g_SimpleAudioEngineLinux->engine; - delete g_SimpleAudioEngineLinux; +SimpleAudioEngine* SimpleAudioEngine::getInstance() +{ + if (!g_SimpleAudioEngineLinux) { + g_SimpleAudioEngineLinux = new SimpleAudioEngineLinux(); + g_SimpleAudioEngineLinux->engine = new SimpleAudioEngine(); + } + return g_SimpleAudioEngineLinux->engine; +} + +void SimpleAudioEngine::end() +{ + if (g_SimpleAudioEngineLinux) { + delete g_SimpleAudioEngineLinux->engine; + delete g_SimpleAudioEngineLinux; + } + g_SimpleAudioEngineLinux = nullptr; +} + +SimpleAudioEngine::SimpleAudioEngine() +{ + g_SimpleAudioEngineLinux->musicid = -1; + g_SimpleAudioEngineLinux->effectsvolume = 1.0f; +} + +SimpleAudioEngine::~SimpleAudioEngine() +{ +} + +void SimpleAudioEngine::preloadBackgroundMusic(const char* filePath) +{ + g_SimpleAudioEngineLinux->musicpath = filePath; + AudioEngine::preload(filePath); +} + +void SimpleAudioEngine::playBackgroundMusic(const char* filePath, bool loop) +{ + g_SimpleAudioEngineLinux->musicpath = filePath; + g_SimpleAudioEngineLinux->musicid = AudioEngine::play2d(filePath, loop); +} + +void SimpleAudioEngine::stopBackgroundMusic(bool releaseData) +{ + AudioEngine::stop(g_SimpleAudioEngineLinux->musicid); + if (releaseData) { + AudioEngine::uncache(g_SimpleAudioEngineLinux->musicpath.c_str()); } - g_SimpleAudioEngineLinux = nullptr; - }; - - - SimpleAudioEngine::SimpleAudioEngine(){ - g_SimpleAudioEngineLinux->musicid = -1; - g_SimpleAudioEngineLinux->effectsvolume = 1.0f; - }; - - SimpleAudioEngine::~SimpleAudioEngine(){ - - }; - - void SimpleAudioEngine::preloadBackgroundMusic(const char* filePath){ - g_SimpleAudioEngineLinux->musicpath = filePath; - AudioEngine::preload(filePath); - }; - - void SimpleAudioEngine::playBackgroundMusic(const char* filePath, bool loop){ - g_SimpleAudioEngineLinux->musicpath = filePath; - g_SimpleAudioEngineLinux->musicid = AudioEngine::play2d(filePath, loop); - }; - - void SimpleAudioEngine::stopBackgroundMusic(bool releaseData){ - AudioEngine::stop(g_SimpleAudioEngineLinux->musicid); - if(releaseData){ - AudioEngine::uncache(g_SimpleAudioEngineLinux->musicpath.c_str()); - } - }; - - void SimpleAudioEngine::pauseBackgroundMusic(){ - AudioEngine::pause(g_SimpleAudioEngineLinux->musicid); - }; - - void SimpleAudioEngine::resumeBackgroundMusic(){ - AudioEngine::resume(g_SimpleAudioEngineLinux->musicid); - }; - - void SimpleAudioEngine::rewindBackgroundMusic(){ - AudioEngine::setCurrentTime(g_SimpleAudioEngineLinux->musicid, 0); - }; - - bool SimpleAudioEngine::willPlayBackgroundMusic(){ - return g_SimpleAudioEngineLinux->musicid != -1; - }; - - bool SimpleAudioEngine::isBackgroundMusicPlaying(){ - return AudioEngine::getState(g_SimpleAudioEngineLinux->musicid) == AudioEngine::AudioState::PLAYING; - }; - - // - // properties - // - - /** - * The volume of the background music within the range of 0.0 as the minimum and 1.0 as the maximum. - * @js getMusicVolume - * @lua getMusicVolume - */ - float SimpleAudioEngine::getBackgroundMusicVolume(){ - return AudioEngine::getVolume(g_SimpleAudioEngineLinux->musicid); - }; - - /** - * Set the volume of background music. - * - * @param volume must be within the range of 0.0 as the minimum and 1.0 as the maximum. - * @js setMusicVolume - * @lua setMusicVolume - */ - void SimpleAudioEngine::setBackgroundMusicVolume(float volume){ - AudioEngine::setVolume(g_SimpleAudioEngineLinux->musicid, volume); - }; - - /** - * The volume of the effects within the range of 0.0 as the minimum and 1.0 as the maximum. - */ - float SimpleAudioEngine::getEffectsVolume(){ - return g_SimpleAudioEngineLinux->effectsvolume; - }; - - /** - * Set the volume of sound effects. - * - * @param volume must be within the range of 0.0 as the minimum and 1.0 as the maximum. - */ - void SimpleAudioEngine::setEffectsVolume(float volume){ - g_SimpleAudioEngineLinux->effectsvolume = volume; - }; - - /** - * Play sound effect with a file path, pitch, pan and gain. - * - * @param filePath The path of the effect file. - * @param loop Determines whether to loop the effect playing or not. The default value is false. - * @param pitch Frequency, normal value is 1.0. Will also change effect play time. - * @param pan Stereo effect, in the range of [-1..1] where -1 enables only left channel. - * @param gain Volume, in the range of [0..1]. The normal value is 1. - * @return The sound id. - * - * @note Full support is under development, now there are limitations: - * - no pitch effect on Samsung Galaxy S2 with OpenSL backend enabled; - * - no pitch/pan/gain on win32. - */ - unsigned int SimpleAudioEngine::playEffect(const char* filePath, bool loop, float pitch, float pan, float gain){ - return AudioEngine::play2d(filePath, loop, gain); - }; - - /** - * Pause playing sound effect. - * - * @param soundId The return value of function playEffect. - */ - void SimpleAudioEngine::pauseEffect(unsigned int soundId){ - AudioEngine::pause(soundId); - }; - - /** - * Pause all playing sound effect. - */ - void SimpleAudioEngine::pauseAllEffects(){ - AudioEngine::pauseAll(); - }; - - /** - * Resume playing sound effect. - * - * @param soundId The return value of function playEffect. - */ - void SimpleAudioEngine::resumeEffect(unsigned int soundId){ - AudioEngine::resume(soundId); - }; - - /** - * Resume all playing sound effect. - */ - void SimpleAudioEngine::resumeAllEffects(){ - AudioEngine::resumeAll(); - }; - - /** - * Stop playing sound effect. - * - * @param soundId The return value of function playEffect. - */ - void SimpleAudioEngine::stopEffect(unsigned int soundId){ - AudioEngine::stop(soundId); - }; - - /** - * Stop all playing sound effects. - */ - void SimpleAudioEngine::stopAllEffects(){ - AudioEngine::stopAll(); - }; - - /** - * Preload a compressed audio file. - * - * The compressed audio will be decoded to wave, then written into an internal buffer in SimpleAudioEngine. - * - * @param filePath The path of the effect file. - * @js NA - */ - void SimpleAudioEngine::preloadEffect(const char* filePath){ - AudioEngine::preload(filePath); - }; - - /** - * Unload the preloaded effect from internal buffer. - * - * @param filePath The path of the effect file. - */ - void SimpleAudioEngine::unloadEffect(const char* filePath){ - AudioEngine::uncache(filePath); - }; - - \ No newline at end of file +} + +void SimpleAudioEngine::pauseBackgroundMusic() +{ + AudioEngine::pause(g_SimpleAudioEngineLinux->musicid); +} + +void SimpleAudioEngine::resumeBackgroundMusic() +{ + AudioEngine::resume(g_SimpleAudioEngineLinux->musicid); +} + +void SimpleAudioEngine::rewindBackgroundMusic() +{ + AudioEngine::setCurrentTime(g_SimpleAudioEngineLinux->musicid, 0); +} + +bool SimpleAudioEngine::willPlayBackgroundMusic() +{ + return g_SimpleAudioEngineLinux->musicid != -1; +} + +bool SimpleAudioEngine::isBackgroundMusicPlaying() +{ + return AudioEngine::getState(g_SimpleAudioEngineLinux->musicid) == AudioEngine::AudioState::PLAYING; +} + +// +// properties +// + +/** + * The volume of the background music within the range of 0.0 as the minimum and 1.0 as the maximum. + * @js getMusicVolume + * @lua getMusicVolume + */ +float SimpleAudioEngine::getBackgroundMusicVolume() +{ + return AudioEngine::getVolume(g_SimpleAudioEngineLinux->musicid); +} + +/** + * Set the volume of background music. + * + * @param volume must be within the range of 0.0 as the minimum and 1.0 as the maximum. + * @js setMusicVolume + * @lua setMusicVolume + */ +void SimpleAudioEngine::setBackgroundMusicVolume(float volume) +{ + AudioEngine::setVolume(g_SimpleAudioEngineLinux->musicid, volume); +} + +/** + * The volume of the effects within the range of 0.0 as the minimum and 1.0 as the maximum. + */ +float SimpleAudioEngine::getEffectsVolume() +{ + return g_SimpleAudioEngineLinux->effectsvolume; +} + +/** + * Set the volume of sound effects. + * + * @param volume must be within the range of 0.0 as the minimum and 1.0 as the maximum. + */ +void SimpleAudioEngine::setEffectsVolume(float volume) +{ + g_SimpleAudioEngineLinux->effectsvolume = volume; +} + +/** + * Play sound effect with a file path, pitch, pan and gain. + * + * @param filePath The path of the effect file. + * @param loop Determines whether to loop the effect playing or not. The default value is false. + * @param pitch Frequency, normal value is 1.0. Will also change effect play time. + * @param pan Stereo effect, in the range of [-1..1] where -1 enables only left channel. + * @param gain Volume, in the range of [0..1]. The normal value is 1. + * @return The sound id. + * + * @note Full support is under development, now there are limitations: + * - no pitch effect on Samsung Galaxy S2 with OpenSL backend enabled; + * - no pitch/pan/gain on win32. + */ +unsigned int SimpleAudioEngine::playEffect(const char* filePath, bool loop, float pitch, float pan, float gain) +{ + return AudioEngine::play2d(filePath, loop, gain); +} + +/** + * Pause playing sound effect. + * + * @param soundId The return value of function playEffect. + */ +void SimpleAudioEngine::pauseEffect(unsigned int soundId) +{ + AudioEngine::pause(soundId); +} + +/** + * Pause all playing sound effect. + */ +void SimpleAudioEngine::pauseAllEffects() +{ + AudioEngine::pauseAll(); +} + +/** + * Resume playing sound effect. + * + * @param soundId The return value of function playEffect. + */ +void SimpleAudioEngine::resumeEffect(unsigned int soundId) +{ + AudioEngine::resume(soundId); +} + +/** + * Resume all playing sound effect. + */ +void SimpleAudioEngine::resumeAllEffects() +{ + AudioEngine::resumeAll(); +} + +/** + * Stop playing sound effect. + * + * @param soundId The return value of function playEffect. + */ +void SimpleAudioEngine::stopEffect(unsigned int soundId) +{ + AudioEngine::stop(soundId); +} + +/** + * Stop all playing sound effects. + */ +void SimpleAudioEngine::stopAllEffects() +{ + AudioEngine::stopAll(); +} + +/** + * Preload a compressed audio file. + * + * The compressed audio will be decoded to wave, then written into an internal buffer in SimpleAudioEngine. + * + * @param filePath The path of the effect file. + * @js NA + */ +void SimpleAudioEngine::preloadEffect(const char* filePath) +{ + AudioEngine::preload(filePath); +} + +/** + * Unload the preloaded effect from internal buffer. + * + * @param filePath The path of the effect file. + */ +void SimpleAudioEngine::unloadEffect(const char* filePath) +{ + AudioEngine::uncache(filePath); +} diff --git a/cocos/audio/tizen/AudioEngine-tizen.cpp b/cocos/audio/tizen/AudioEngine-tizen.cpp new file mode 100644 index 000000000000..43fe9b22d3cd --- /dev/null +++ b/cocos/audio/tizen/AudioEngine-tizen.cpp @@ -0,0 +1,402 @@ +/**************************************************************************** + 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" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#include "audio/tizen/AudioEngine-tizen.h" + +// for native asset manager +#include +#include +#include +#include "audio/include/AudioEngine.h" +#include "base/CCDirector.h" +#include "base/CCScheduler.h" +#include "platform/CCFileUtils.h" + +#include + +class AudioEngineThreadPool +{ +public: + AudioEngineThreadPool() + : _running(true) { + _threads = std::thread(std::bind(&AudioEngineThreadPool::threadFunc, this)); + } + + ~AudioEngineThreadPool() + { + _running = false; + _sleepCondition.notify_one(); + _threads.join(); + } + + void addTask(const std::function &task) { + _tasks.push(task); + _sleepCondition.notify_one(); + } +private: + bool _running; + std::thread _threads; + std::queue< std::function > _tasks; + + void threadFunc(void) { + while (true) { + std::function task = nullptr; + + if (_tasks.empty()) + { + if (!_running) + { + break; + } + std::unique_lock lk(_sleepMutex); + _sleepCondition.wait(lk); + continue; + } + + task = _tasks.front(); + + task(); + + _tasks.pop(); + } + } + + std::mutex _sleepMutex; + std::condition_variable _sleepCondition; +}; + +static AudioEngineThreadPool* _threadPool = nullptr; + +using namespace cocos2d; +using namespace cocos2d::experimental; + +AudioPlayer::AudioPlayer() + : _playerHandle(nullptr) + , _finishCallback(nullptr) + , _initCallback(nullptr) + , _duration(0.0f) + , _playOver(false) + , _initSucceed(false) +{ +} + +static void _stopPlayer(player_h player) +{ + player_state_e state = PLAYER_STATE_NONE; + player_get_state(player, &state); + if (state == PLAYER_STATE_PLAYING || state == PLAYER_STATE_PAUSED) + { + player_stop(player); + } + player_unprepare(player); +} + +static void _pausePlayer(player_h player) +{ + player_state_e state; + player_get_state(player, &state); + + if(state == PLAYER_STATE_PLAYING) + { + player_pause(player); + } +} + +static void _resumePlayer(player_h player) +{ + player_state_e state; + player_get_state(player, &state); + + if(state != PLAYER_STATE_PLAYING) + { + player_start(player); + } +} + +AudioPlayer::~AudioPlayer() +{ + _taskMutex.lock(); + _threadPool->addTask(std::bind(_stopPlayer, _playerHandle)); + _threadPool->addTask(std::bind(player_destroy, _playerHandle)); + _taskMutex.unlock(); +} + +void AudioPlayer::stopPlayer() +{ + _playOver = true; +} + +static void completed_callback(void* user_data) +{ + AudioPlayer* player = (AudioPlayer*)user_data; + player->stopPlayer(); +} + +void AudioPlayer::init(const std::string& fileFullPath, float volume, bool loop) +{ + do + { + player_h player; + auto playerRet = player_create(&player); + if(playerRet != PLAYER_ERROR_NONE) + { + log("Fail to create player.Error code:%d",playerRet); + break; + } + + _playerHandle = player; + playerRet = player_set_uri(player, fileFullPath.c_str()); + if(playerRet != PLAYER_ERROR_NONE) + { + log("Fail to sets the data source for player.Error code:%d",playerRet); + break; + } + + player_set_volume(player, volume, volume); + player_set_completed_cb(player, completed_callback, this); + if (loop) + { + player_set_looping(player, true); + } + playerRet = player_prepare(player); + if(playerRet != PLAYER_ERROR_NONE){ + log("Fail to prepares the media player for playback.Error code:%d",playerRet); + break; + } + + playerRet = player_start(player); + if(playerRet != PLAYER_ERROR_NONE){ + log("Fail to starts playback.Error code:%d",playerRet); + break; + } + + _initSucceed = true; + } while (0); + + if (_initCallback) + { + _initCallback(); + } + _taskMutex.unlock(); +} + +//==================================================== +AudioEngineImpl::AudioEngineImpl() + : currentAudioID(0) + , _lazyInitLoop(true) +{ + +} + +AudioEngineImpl::~AudioEngineImpl() +{ + this->stopAll(); + + if (_threadPool) + { + delete _threadPool; + _threadPool = nullptr; + } + auto scheduler = Director::getInstance()->getScheduler(); + scheduler->unschedule(schedule_selector(AudioEngineImpl::update), this); +} + +bool AudioEngineImpl::init() +{ + sound_manager_set_session_type(SOUND_SESSION_TYPE_MEDIA); + sound_manager_set_media_session_option(SOUND_SESSION_OPTION_MIX_WITH_OTHERS_WHEN_START, + SOUND_SESSION_OPTION_INTERRUPTIBLE_DURING_PLAY); + sound_manager_set_media_session_resumption_option(SOUND_SESSION_OPTION_RESUMPTION_BY_SYSTEM_OR_MEDIA_PAUSED); + + if (!_threadPool) + { + _threadPool = new (std::nothrow) AudioEngineThreadPool(); + } + + return true; +} + +int AudioEngineImpl::play2d(const std::string &filePath ,bool loop ,float volume) +{ + auto audioId = AudioEngine::INVALID_AUDIO_ID; + + do + { + audioId = currentAudioID++; + + auto& player = _audioPlayers[audioId]; + player._audioID = audioId; + player._initCallback = std::bind(&AudioEngineImpl::initPlayerCallback,this,&player,audioId); + + player._taskMutex.lock(); + _threadPool->addTask(std::bind(&AudioPlayer::init,&player,FileUtils::getInstance()->fullPathForFilename(filePath), volume, loop)); + + if (_lazyInitLoop) { + _lazyInitLoop = false; + + auto scheduler = Director::getInstance()->getScheduler(); + scheduler->schedule(schedule_selector(AudioEngineImpl::update), this, 0.03f, false); + } + } while (0); + + return audioId; +} + +void AudioEngineImpl::initPlayerCallback(AudioPlayer *player, int audioID) +{ + if (player->_initSucceed) + { + AudioEngine::_audioIDInfoMap[audioID].state = AudioEngine::AudioState::PLAYING; + } + else + { + _threadMutex.lock(); + _toRemoveAudioIDs.push_back(audioID); + _threadMutex.unlock(); + } +} + +void AudioEngineImpl::update(float dt) +{ + if (_threadMutex.try_lock()) { + int audioID; + 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); + } + } + _threadMutex.unlock(); + } + + auto itend = _audioPlayers.end(); + for (auto iter = _audioPlayers.begin(); iter != itend; ++iter) + { + if(iter->second._playOver) + { + if (iter->second._finishCallback) + iter->second._finishCallback(iter->second._audioID, *AudioEngine::_audioIDInfoMap[iter->second._audioID].filePath); + + AudioEngine::remove(iter->second._audioID); + _audioPlayers.erase(iter); + break; + } + } + + if(_audioPlayers.empty()){ + _lazyInitLoop = true; + + auto scheduler = Director::getInstance()->getScheduler(); + scheduler->unschedule(schedule_selector(AudioEngineImpl::update), this); + } +} + +void AudioEngineImpl::setVolume(int audioID,float volume) +{ + auto& player = _audioPlayers[audioID]; + player_set_volume(player._playerHandle, volume, volume); +} + +void AudioEngineImpl::setLoop(int audioID, bool loop) +{ + auto& player = _audioPlayers[audioID]; + player_set_looping(player._playerHandle, loop); +} + +void AudioEngineImpl::pause(int audioID) +{ + auto& player = _audioPlayers[audioID]; + _threadPool->addTask(std::bind(_pausePlayer, player._playerHandle)); +} + +void AudioEngineImpl::resume(int audioID) +{ + auto& player = _audioPlayers[audioID]; + _threadPool->addTask(std::bind(_resumePlayer, player._playerHandle)); +} + +void AudioEngineImpl::stop(int audioID) +{ + _audioPlayers.erase(audioID); +} + +void AudioEngineImpl::stopAll() +{ + _audioPlayers.clear(); +} + +float AudioEngineImpl::getDuration(int audioID) +{ + int duration; + auto& player = _audioPlayers[audioID]; + auto ret = player_get_duration(player._playerHandle, &duration); + if(ret != PLAYER_ERROR_NONE) + { + log("Fail to get duration:%d",ret); + } + return duration / 1000.0f; +} + +float AudioEngineImpl::getCurrentTime(int audioID) +{ + int currPos; + auto& player = _audioPlayers[audioID]; + auto ret = player_get_play_position(player._playerHandle, &currPos); + if(ret != PLAYER_ERROR_NONE) + { + CCLOG("Fail to get position:%d",ret); + } + return currPos / 1000.0f; +} + +bool AudioEngineImpl::setCurrentTime(int audioID, float time) +{ + auto& player = _audioPlayers[audioID]; + int pos = 1000 * time; + player_set_play_position(player._playerHandle, pos, true, NULL, NULL); + + return true; +} + +void AudioEngineImpl::setFinishCallback(int audioID, const std::function &callback) +{ + _audioPlayers[audioID]._finishCallback = callback; +} + +void AudioEngineImpl::preload(const std::string& filePath, std::function callback) +{ + //TODO: implement preload on Tizen platform. +} + +#endif diff --git a/cocos/audio/tizen/AudioEngine-tizen.h b/cocos/audio/tizen/AudioEngine-tizen.h new file mode 100644 index 000000000000..9616fc60141b --- /dev/null +++ b/cocos/audio/tizen/AudioEngine-tizen.h @@ -0,0 +1,117 @@ +/**************************************************************************** + 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" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#ifndef __AUDIO_ENGINE_TIZEN_H_ +#define __AUDIO_ENGINE_TIZEN_H_ + +#include +#include +#include +#include +#include + +#include "base/CCRef.h" +#include "base/ccUtils.h" + +#define MAX_AUDIOINSTANCES 8 + +#define ERRORLOG(msg) log("fun:%s,line:%d,msg:%s",__func__,__LINE__,#msg) + +NS_CC_BEGIN + namespace experimental{ +class AudioEngineImpl; + +class AudioPlayer +{ +public: + AudioPlayer(); + ~AudioPlayer(); + + void init(const std::string& fileFullPath, float volume, bool loop); + void stopPlayer(); + + player_h _playerHandle; + std::function _initCallback; + std::mutex _taskMutex; + +private: + bool _playOver; + float _duration; + int _audioID; + bool _initSucceed; + + std::function _finishCallback; + + friend class AudioEngineImpl; +}; + +class 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); + void pause(int audioID); + void resume(int audioID); + void 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); + + void preload(const std::string& filePath, std::function callback); + +private: + void initPlayerCallback(AudioPlayer *player, int audioID); + + //audioID,AudioInfo + std::unordered_map _audioPlayers; + + std::mutex _threadMutex; + std::vector _toRemoveAudioIDs; + + int currentAudioID; + + bool _lazyInitLoop; +}; + + } +NS_CC_END + +#endif // __AUDIO_ENGINE_TIZEN_H_ + +#endif diff --git a/cocos/audio/tizen/SimpleAudioEngineTizen.cpp b/cocos/audio/tizen/SimpleAudioEngineTizen.cpp new file mode 100644 index 000000000000..8d28f8689297 --- /dev/null +++ b/cocos/audio/tizen/SimpleAudioEngineTizen.cpp @@ -0,0 +1,217 @@ +/**************************************************************************** + 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" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#include "audio/include/SimpleAudioEngine.h" +#include "audio/include/AudioEngine.h" + +USING_NS_CC; +using namespace cocos2d::experimental; + +static float s_bgMusicVolume = 1.0f; +static float s_effectVolume = 1.0f; + +namespace CocosDenshion { + +SimpleAudioEngine::SimpleAudioEngine() { + +} + +SimpleAudioEngine::~SimpleAudioEngine() { +} + +SimpleAudioEngine* SimpleAudioEngine::getInstance() { + static SimpleAudioEngine s_SharedEngine; + return &s_SharedEngine; +} + +void SimpleAudioEngine::end() { + AudioEngine::end(); +} + +static int s_bgAudioID = AudioEngine::INVALID_AUDIO_ID; +static std::string bgMusicFilePath; +////////////////////////////////////////////////////////////////////////// +// BackgroundMusic +////////////////////////////////////////////////////////////////////////// + +void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath,bool bLoop) { + if (s_bgAudioID != AudioEngine::INVALID_AUDIO_ID) + { + AudioEngine::stop(s_bgAudioID); + s_bgAudioID = AudioEngine::INVALID_AUDIO_ID; + } + + if (pszFilePath) + { + bgMusicFilePath = pszFilePath; + s_bgAudioID = AudioEngine::play2d(pszFilePath,bLoop,s_bgMusicVolume); + } +} + +void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData) { + AudioEngine::stop(s_bgAudioID); +} + +void SimpleAudioEngine::pauseBackgroundMusic() { + AudioEngine::pause(s_bgAudioID); +} + +void SimpleAudioEngine::resumeBackgroundMusic() { + AudioEngine::resume(s_bgAudioID); +} + +void SimpleAudioEngine::rewindBackgroundMusic() { + AudioEngine::stop(s_bgAudioID); + if (!bgMusicFilePath.empty()) + { + s_bgAudioID = AudioEngine::play2d(bgMusicFilePath); + } +} + +bool SimpleAudioEngine::willPlayBackgroundMusic() { + return false; +} + +bool SimpleAudioEngine::isBackgroundMusicPlaying() { + auto state = AudioEngine::getState(s_bgAudioID); + if (state == AudioEngine::AudioState::PLAYING) + { + return true; + } + return false; +} + +void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath) { + bgMusicFilePath = pszFilePath; +} + +////////////////////////////////////////////////////////////////////////// +// effect function +////////////////////////////////////////////////////////////////////////// + +unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop, + float pitch, float pan, float gain) { + return AudioEngine::play2d(pszFilePath,bLoop,s_effectVolume); +} + +void SimpleAudioEngine::stopEffect(unsigned int nSoundId) { + AudioEngine::stop(nSoundId); +} + +void SimpleAudioEngine::preloadEffect(const char* pszFilePath) { + // FIXME: need implementation +} + +void SimpleAudioEngine::unloadEffect(const char* pszFilePath) { + AudioEngine::uncache(pszFilePath); +} + +void SimpleAudioEngine::pauseEffect(unsigned int uSoundId) { + AudioEngine::pause(uSoundId); +} + +void SimpleAudioEngine::pauseAllEffects() { + bool resumeBGMusic = false; + auto state = AudioEngine::getState(s_bgAudioID); + if (state == AudioEngine::AudioState::PLAYING) + { + resumeBGMusic = true; + } + AudioEngine::pauseAll(); + if (resumeBGMusic) + { + AudioEngine::resume(s_bgAudioID); + } +} + +void SimpleAudioEngine::resumeEffect(unsigned int uSoundId) { + AudioEngine::resume(uSoundId); +} + +void SimpleAudioEngine::resumeAllEffects() { + bool pauseBGMusic = false; + auto state = AudioEngine::getState(s_bgAudioID); + if (state == AudioEngine::AudioState::PAUSED) + { + pauseBGMusic = true; + } + AudioEngine::resumeAll(); + if (pauseBGMusic) + { + AudioEngine::pause(s_bgAudioID); + } +} + +void SimpleAudioEngine::stopAllEffects() { + //FIXME + AudioEngine::stopAll(); +} + + + +////////////////////////////////////////////////////////////////////////// +// volume interface +////////////////////////////////////////////////////////////////////////// + +float SimpleAudioEngine::getBackgroundMusicVolume() { + return s_bgMusicVolume; +} + +void SimpleAudioEngine::setBackgroundMusicVolume(float volume) { + if (volume > 1.0f) + { + volume = 1.0f; + } + else if(volume < 0.0f) + { + volume = 0.0f; + } + s_bgMusicVolume = volume; + AudioEngine::setVolume(s_bgAudioID, s_bgMusicVolume); +} + +float SimpleAudioEngine::getEffectsVolume() { + return s_effectVolume; +} + +void SimpleAudioEngine::setEffectsVolume(float volume) { + if (volume > 1.0f) + { + volume = 1.0f; + } + else if(volume < 0.0f) + { + volume = 0.0f; + } + s_effectVolume = volume; + //FIXME +} + + +} // end of namespace CocosDenshion + +#endif diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 1509d62fde00..d8048fc1321f 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -247,7 +247,7 @@ std::vector Console::Utility::split(const std::string& s, char deli } //isFloat taken from http://stackoverflow.com/questions/447206/c-isfloat-function -bool Console::Utility::isFloat(std::string myString) { +bool Console::Utility::isFloat(const std::string& myString) { std::istringstream iss(myString); float f; iss >> std::noskipws >> f; // noskipws considers leading whitespace invalid @@ -422,7 +422,7 @@ bool Console::listenOnTCP(int port) bzero(&hints, sizeof(struct addrinfo)); hints.ai_flags = AI_PASSIVE; - hints.ai_family = AF_INET; // AF_UNSPEC: Do we need IPv6 ? + hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index ea18b874036c..f9b66b361846 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -88,7 +88,7 @@ class CC_DLL Console static std::vector split(const std::string& s, char delim); /** Checks myString is a floating-point type. */ - static bool isFloat(std::string myString); + static bool isFloat(const std::string& myString); /** send a message to console */ static ssize_t sendToConsole(int fd, const void* buffer, size_t length, int flags = 0); diff --git a/cocos/base/CCData.cpp b/cocos/base/CCData.cpp index 7c5a1e1bdf68..9ad33a2cfccb 100644 --- a/cocos/base/CCData.cpp +++ b/cocos/base/CCData.cpp @@ -1,7 +1,7 @@ /**************************************************************************** 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 @@ -77,7 +77,7 @@ void Data::move(Data& other) { _bytes = other._bytes; _size = other._size; - + other._bytes = nullptr; other._size = 0; } @@ -100,7 +100,7 @@ ssize_t Data::getSize() const void Data::copy(const unsigned char* bytes, const ssize_t size) { clear(); - + if (size > 0) { _size = size; @@ -122,4 +122,13 @@ void Data::clear() _size = 0; } +unsigned char* Data::takeBuffer(ssize_t* size) +{ + auto buffer = getBytes(); + if (size) + *size = getSize(); + fastSet(nullptr, 0); + return buffer; +} + NS_CC_END diff --git a/cocos/base/CCData.h b/cocos/base/CCData.h index 4c0d5aea3d0d..5fb840d7c1ae 100644 --- a/cocos/base/CCData.h +++ b/cocos/base/CCData.h @@ -1,7 +1,7 @@ /**************************************************************************** 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 @@ -41,64 +41,64 @@ NS_CC_BEGIN class CC_DLL Data { friend class Properties; - + public: /** * This parameter is defined for convenient reference if a null Data object is needed. */ static const Data Null; - + /** * Constructor of Data. */ Data(); - + /** * Copy constructor of Data. */ Data(const Data& other); - + /** * Copy constructor of Data. */ Data(Data&& other); - + /** * Destructor of Data. */ ~Data(); - + /** * Overloads of operator=. */ Data& operator= (const Data& other); - + /** * Overloads of operator=. */ Data& operator= (Data&& other); - + /** * Gets internal bytes of Data. It will return the pointer directly used in Data, so don't delete it. * * @return Pointer of bytes used internal in Data. */ unsigned char* getBytes() const; - + /** * Gets the size of the bytes. * * @return The size of bytes of Data. */ ssize_t getSize() const; - + /** Copies the buffer pointer and its size. * @note This method will copy the whole buffer. * Developer should free the pointer after invoking this method. * @see Data::fastSet */ void copy(const unsigned char* bytes, const ssize_t size); - + /** Fast set the buffer pointer and its size. Please use it carefully. * @param bytes The buffer pointer, note that it have to be allocated by 'malloc' or 'calloc', * since in the destructor of Data, the buffer will be deleted by 'free'. @@ -107,22 +107,45 @@ class CC_DLL Data * @see Data::copy */ void fastSet(unsigned char* bytes, const ssize_t size); - - /** + + /** * Clears data, free buffer and reset data size. */ void clear(); - - /** + + /** * Check whether the data is null. * * @return True if the Data is null, false if not. */ bool isNull() const; - + + /** + * Get the internal buffer of data and set data to empty state. + * + * The ownership of the buffer removed from the data object. + * That is the user have to free the returned buffer. + * The data object is set to empty state, that is internal buffer is set to nullptr + * and size is set to zero. + * Usage: + *
+     *  {@code
+     *  Data d;
+     *  // ...
+     *  ssize_t size;
+     *  unsigned char* buffer = d.takeBuffer(&size);
+     *  // use buffer and size
+     *  free(buffer);
+     *  }
+     * 
getScriptEngine()->sendEvent(&scriptEvent); #endif } diff --git a/cocos/base/CCEventDispatcher.cpp b/cocos/base/CCEventDispatcher.cpp index 40eb42458321..b477ffca8fe9 100644 --- a/cocos/base/CCEventDispatcher.cpp +++ b/cocos/base/CCEventDispatcher.cpp @@ -604,6 +604,10 @@ void EventDispatcher::removeEventListener(EventListener* listener) { if (listener == nullptr) return; + + // just return if listener is in _toRemovedListeners to avoid remove listeners more than once + if (std::find(_toRemovedListeners.begin(), _toRemovedListeners.end(), listener) != _toRemovedListeners.end()) + return; bool isFound = false; diff --git a/cocos/base/CCIMEDispatcher.cpp b/cocos/base/CCIMEDispatcher.cpp index ab2420f0e5d7..e6f2baf5e8e7 100644 --- a/cocos/base/CCIMEDispatcher.cpp +++ b/cocos/base/CCIMEDispatcher.cpp @@ -273,7 +273,7 @@ void IMEDispatcher::dispatchKeyboardWillShow(IMEKeyboardNotificationInfo& info) { if (_impl) { - IMEDelegate * delegate = 0; + IMEDelegate * delegate = nullptr; DelegateIter last = _impl->_delegateList.end(); for (DelegateIter first = _impl->_delegateList.begin(); first != last; ++first) { @@ -290,7 +290,7 @@ void IMEDispatcher::dispatchKeyboardDidShow(IMEKeyboardNotificationInfo& info) { if (_impl) { - IMEDelegate * delegate = 0; + IMEDelegate * delegate = nullptr; DelegateIter last = _impl->_delegateList.end(); for (DelegateIter first = _impl->_delegateList.begin(); first != last; ++first) { @@ -307,7 +307,7 @@ void IMEDispatcher::dispatchKeyboardWillHide(IMEKeyboardNotificationInfo& info) { if (_impl) { - IMEDelegate * delegate = 0; + IMEDelegate * delegate = nullptr; DelegateIter last = _impl->_delegateList.end(); for (DelegateIter first = _impl->_delegateList.begin(); first != last; ++first) { @@ -324,7 +324,7 @@ void IMEDispatcher::dispatchKeyboardDidHide(IMEKeyboardNotificationInfo& info) { if (_impl) { - IMEDelegate * delegate = 0; + IMEDelegate * delegate = nullptr; DelegateIter last = _impl->_delegateList.end(); for (DelegateIter first = _impl->_delegateList.begin(); first != last; ++first) { diff --git a/cocos/base/CCProperties.h b/cocos/base/CCProperties.h index 651e6ec453aa..fc4a49269d3e 100644 --- a/cocos/base/CCProperties.h +++ b/cocos/base/CCProperties.h @@ -159,8 +159,6 @@ class Data; */ class CC_DLL Properties { - friend class Game; - public: /** diff --git a/cocos/base/CCRefPtr.h b/cocos/base/CCRefPtr.h index 60f833f1be3f..a2c19c863042 100644 --- a/cocos/base/CCRefPtr.h +++ b/cocos/base/CCRefPtr.h @@ -29,6 +29,7 @@ #include "base/CCRef.h" #include "base/ccMacros.h" +#include #include NS_CC_BEGIN @@ -212,8 +213,6 @@ template class RefPtr inline bool operator > (typename std::remove_const::type * other) const { return _ptr > other; } - inline bool operator > (const std::nullptr_t other) const { return _ptr > other; } - inline bool operator < (const RefPtr & other) const { return _ptr < other._ptr; } @@ -221,8 +220,6 @@ template class RefPtr inline bool operator < (typename std::remove_const::type * other) const { return _ptr < other; } - inline bool operator < (const std::nullptr_t other) const { return _ptr < other; } - inline bool operator >= (const RefPtr & other) const { return _ptr >= other._ptr; } @@ -230,8 +227,6 @@ template class RefPtr inline bool operator >= (typename std::remove_const::type * other) const { return _ptr >= other; } - inline bool operator >= (const std::nullptr_t other) const { return _ptr >= other; } - inline bool operator <= (const RefPtr & other) const { return _ptr <= other._ptr; } @@ -239,8 +234,6 @@ template class RefPtr inline bool operator <= (typename std::remove_const::type * other) const { return _ptr <= other; } - inline bool operator <= (const std::nullptr_t other) const { return _ptr <= other; } - inline operator bool() const { return _ptr != nullptr; } @@ -283,6 +276,54 @@ template class RefPtr Ref * _ptr; }; +template inline +bool operator<(const RefPtr& r, std::nullptr_t) +{ + return std::less()(r.get(), nullptr); +} + +template inline +bool operator<(std::nullptr_t, const RefPtr& r) +{ + return std::less()(nullptr, r.get()); +} + +template inline +bool operator>(const RefPtr& r, std::nullptr_t) +{ + return nullptr < r; +} + +template inline +bool operator>(std::nullptr_t, const RefPtr& r) +{ + return r < nullptr; +} + +template inline +bool operator<=(const RefPtr& r, std::nullptr_t) +{ + return !(nullptr < r); +} + +template inline +bool operator<=(std::nullptr_t, const RefPtr& r) +{ + return !(r < nullptr); +} + +template inline +bool operator>=(const RefPtr& r, std::nullptr_t) +{ + return !(r < nullptr); +} + +template inline +bool operator>=(std::nullptr_t, const RefPtr& r) +{ + return !(nullptr < r); +} + /** * Cast between RefPtr types statically. */ diff --git a/cocos/base/CCUserDefault.cpp b/cocos/base/CCUserDefault.cpp index ebc674877c98..34c4e6167a0f 100644 --- a/cocos/base/CCUserDefault.cpp +++ b/cocos/base/CCUserDefault.cpp @@ -394,7 +394,7 @@ void UserDefault::setDataForKey(const char* pKey, const Data& value) { return; } - char *encodedData = 0; + char *encodedData = nullptr; base64Encode(value.getBytes(), static_cast(value.getSize()), &encodedData); diff --git a/cocos/base/ZipUtils.cpp b/cocos/base/ZipUtils.cpp index db9d35cc6102..4737384b89d3 100644 --- a/cocos/base/ZipUtils.cpp +++ b/cocos/base/ZipUtils.cpp @@ -645,6 +645,35 @@ unsigned char *ZipFile::getFileData(const std::string &fileName, ssize_t *size) return buffer; } +bool ZipFile::getFileData(const std::string &fileName, ResizableBuffer* buffer) +{ + bool res = false; + do + { + CC_BREAK_IF(!_data->zipFile); + CC_BREAK_IF(fileName.empty()); + + ZipFilePrivate::FileListContainer::const_iterator it = _data->fileList.find(fileName); + CC_BREAK_IF(it == _data->fileList.end()); + + ZipEntryInfo fileInfo = it->second; + + int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos); + CC_BREAK_IF(UNZ_OK != nRet); + + nRet = unzOpenCurrentFile(_data->zipFile); + CC_BREAK_IF(UNZ_OK != nRet); + + buffer->resize(fileInfo.uncompressed_size); + int CC_UNUSED nSize = unzReadCurrentFile(_data->zipFile, buffer->buffer(), static_cast(fileInfo.uncompressed_size)); + CCASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); + unzCloseCurrentFile(_data->zipFile); + res = true; + } while (0); + + return res; +} + std::string ZipFile::getFirstFilename() { if (unzGoToFirstFile(_data->zipFile) != UNZ_OK) return emptyFilename; diff --git a/cocos/base/ZipUtils.h b/cocos/base/ZipUtils.h index a06ac9fa1f40..4a6352e32f4b 100644 --- a/cocos/base/ZipUtils.h +++ b/cocos/base/ZipUtils.h @@ -31,6 +31,7 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" #include "platform/CCPlatformMacros.h" #include "platform/CCPlatformDefine.h" +#include "platform/CCFileUtils.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/CCFileUtils-android.h" @@ -275,6 +276,14 @@ typedef struct unz_file_info_s unz_file_info; * @since v2.0.5 */ unsigned char *getFileData(const std::string &fileName, ssize_t *size); + + /** + * Get resource file data from a zip file. + * @param fileName File name + * @param[out] buffer If the file read operation succeeds, if will contain the file data. + * @return True if successful. + */ + bool getFileData(const std::string &fileName, ResizableBuffer* buffer); std::string getFirstFilename(); std::string getNextFilename(); diff --git a/cocos/base/allocator/CCAllocatorMutex.h b/cocos/base/allocator/CCAllocatorMutex.h index 48e52ce1a486..026aca94752f 100644 --- a/cocos/base/allocator/CCAllocatorMutex.h +++ b/cocos/base/allocator/CCAllocatorMutex.h @@ -29,7 +29,7 @@ #include "platform/CCPlatformMacros.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "pthread.h" #define MUTEX pthread_mutex_t #define MUTEX_INIT(m) \ diff --git a/cocos/base/ccUTF8.cpp b/cocos/base/ccUTF8.cpp index 8b4f1e94a68d..513f7a536145 100644 --- a/cocos/base/ccUTF8.cpp +++ b/cocos/base/ccUTF8.cpp @@ -228,7 +228,7 @@ std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret) return utf8Str; } -jstring newStringUTFJNI(JNIEnv* env, std::string utf8Str, bool* ret) +jstring newStringUTFJNI(JNIEnv* env, const std::string& utf8Str, bool* ret) { std::u16string utf16Str; bool flag = cocos2d::StringUtils::UTF8ToUTF16(utf8Str, utf16Str); @@ -435,7 +435,8 @@ unsigned short* cc_utf8_to_utf16(const char* str_old, int length/* = -1*/, int* unsigned short* ret = nullptr; std::u16string outUtf16; - bool succeed = StringUtils::UTF8ToUTF16(str_old, outUtf16); + std::string inUtf8 = length == -1 ? std::string(str_old) : std::string(str_old, length); + bool succeed = StringUtils::UTF8ToUTF16(inUtf8, outUtf16); if (succeed) { diff --git a/cocos/base/ccUTF8.h b/cocos/base/ccUTF8.h index 4e6a85253302..90cc4d40505e 100644 --- a/cocos/base/ccUTF8.h +++ b/cocos/base/ccUTF8.h @@ -118,7 +118,7 @@ CC_DLL std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret * @param ret True if the conversion succeeds and the ret pointer isn't null * @returns the result of jstring,the jstring need to DeleteLocalRef(jstring); */ -CC_DLL jstring newStringUTFJNI(JNIEnv* env, std::string utf8Str, bool* ret = nullptr); +CC_DLL jstring newStringUTFJNI(JNIEnv* env, const std::string& utf8Str, bool* ret = nullptr); #endif /** diff --git a/cocos/base/ccUtils.cpp b/cocos/base/ccUtils.cpp index 83d35a562465..1b3cd03c4b96 100644 --- a/cocos/base/ccUtils.cpp +++ b/cocos/base/ccUtils.cpp @@ -33,9 +33,12 @@ THE SOFTWARE. #include "base/base64.h" #include "renderer/CCCustomCommand.h" #include "renderer/CCRenderer.h" +#include "renderer/CCTextureCache.h" + #include "platform/CCImage.h" #include "platform/CCFileUtils.h" #include "2d/CCSprite.h" +#include "2d/CCRenderTexture.h" NS_CC_BEGIN @@ -174,6 +177,49 @@ void captureScreen(const std::function& afterCap }); } +Image* captureNode(Node* startNode, float scale) +{ // The best snapshot API, support Scene and any Node + auto& size = startNode->getContentSize(); + + Director::getInstance()->setNextDeltaTimeZero(true); + + RenderTexture* finalRtx = nullptr; + + auto rtx = RenderTexture::create(size.width, size.height, Texture2D::PixelFormat::RGBA8888, GL_DEPTH24_STENCIL8); + // rtx->setKeepMatrix(true); + Point savedPos = startNode->getPosition(); + Point anchor; + if (!startNode->isIgnoreAnchorPointForPosition()) { + anchor = startNode->getAnchorPoint(); + } + startNode->setPosition(Point(size.width * anchor.x, size.height * anchor.y)); + rtx->begin(); + startNode->visit(); + rtx->end(); + startNode->setPosition(savedPos); + + if (std::abs(scale - 1.0f) < 1e-6/* no scale */) + finalRtx = rtx; + else { + /* scale */ + auto finalRect = Rect(0, 0, size.width, size.height); + Sprite *sprite = Sprite::createWithTexture(rtx->getSprite()->getTexture(), finalRect); + sprite->setAnchorPoint(Point(0, 0)); + sprite->setFlippedY(true); + + finalRtx = RenderTexture::create(size.width * scale, size.height * scale, Texture2D::PixelFormat::RGBA8888, GL_DEPTH24_STENCIL8); + + sprite->setScale(scale); // or use finalRtx->setKeepMatrix(true); + finalRtx->begin(); + sprite->visit(); + finalRtx->end(); + } + + Director::getInstance()->getRenderer()->render(); + + return finalRtx->newImage(); +} + std::vector findChildren(const Node &node, const std::string &name) { std::vector vec; @@ -266,10 +312,33 @@ Rect getCascadeBoundingBox(Node *node) return cbb; } +Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key) +{ + Texture2D* texture = Director::getInstance()->getTextureCache()->getTextureForKey(key); + + if (texture == nullptr) + { + unsigned char* decoded; + int length = base64Decode((const unsigned char*)base64String, (unsigned int)strlen(base64String), &decoded); + + Image *image = new (std::nothrow) Image(); + bool imageResult = image->initWithImageData(decoded, length); + CCASSERT(imageResult, "Failed to create image from base64!"); + free(decoded); + + texture = Director::getInstance()->getTextureCache()->addImage(image, key); + image->release(); + } + + Sprite* sprite = Sprite::createWithTexture(texture); + + return sprite; +} + Sprite* createSpriteFromBase64(const char* base64String) { unsigned char* decoded; - int length = base64Decode((const unsigned char*) base64String, (unsigned int) strlen(base64String), &decoded); + int length = base64Decode((const unsigned char*)base64String, (unsigned int)strlen(base64String), &decoded); Image *image = new (std::nothrow) Image(); bool imageResult = image->initWithImageData(decoded, length); @@ -283,10 +352,55 @@ Sprite* createSpriteFromBase64(const char* base64String) Sprite* sprite = Sprite::createWithTexture(texture); texture->release(); - + return sprite; } +Node* findChild(Node* levelRoot, const char* name) +{ + if (levelRoot == nullptr) + return nullptr; + + // Find this node + { + auto target = levelRoot->getChildByName(name); + if (target != nullptr) + return target; + } + + // Find recursively + for (auto& child : levelRoot->getChildren()) + { + auto target = findChild(child, name); + if (target != nullptr) + return target; + } + return nullptr; +} + +Node* findChild(Node* levelRoot, int tag) +{ + if (levelRoot == nullptr) + return nullptr; + + // Find this node + { + auto target = levelRoot->getChildByTag(tag); + if (target != nullptr) + return target; + } + + // Find recursively + for (auto& child : levelRoot->getChildren()) + { + auto target = findChild(child, tag); + if (target != nullptr) + return target; + } + + return nullptr; +} + } NS_CC_END diff --git a/cocos/base/ccUtils.h b/cocos/base/ccUtils.h index 1617e413aacd..4c3bb5820a8d 100644 --- a/cocos/base/ccUtils.h +++ b/cocos/base/ccUtils.h @@ -53,6 +53,7 @@ ccNextPOT function is licensed under the same license that is used in Texture2D. int ccNextPOT(int value); class Sprite; +class Image; namespace utils { @@ -64,7 +65,16 @@ namespace utils * base filename ("hello.png" etc.), don't use a relative path containing directory names.("mydir/hello.png" etc.). * @since v3.2 */ - void CC_DLL captureScreen(const std::function& afterCaptured, const std::string& filename); + CC_DLL void captureScreen(const std::function& afterCaptured, const std::string& filename); + + /** Capture a specific Node. + * @param startNode: specify the snapshot Node. It chould be cocos2d::Scene + * @param scale + * @returns: return a Image, then can call saveToFile to save the image as "xxx.png or xxx.jpg". + * @since v3.11 + * !!! remark: Caller is responsible for releasing it by calling delete. + */ + CC_DLL Image* captureNode(Node* startNode, float scale = 1.0f); /** Find children by name, it will return all child that has the same name. * It supports c++ 11 regular expression. It is a helper function of `Node::enumerateChildren()`. @@ -75,7 +85,7 @@ namespace utils * @return Array of Nodes that matches the name * @since v3.2 */ - std::vector CC_DLL findChildren(const Node &node, const std::string &name); + CC_DLL std::vector findChildren(const Node &node, const std::string &name); /** Same to ::atof, but strip the string, remain 7 numbers after '.' before call atof. * Why we need this? Because in android c++_static, atof ( and std::atof ) is unsupported for numbers have long decimal part and contain @@ -83,33 +93,76 @@ namespace utils * @param str The string be to converted to double. * @return Returns converted value of a string. */ - double CC_DLL atof(const char* str); + CC_DLL double atof(const char* str); /** Get current exact time, accurate to nanoseconds. * @return Returns the time in seconds since the Epoch. */ - double CC_DLL gettime(); + CC_DLL double gettime(); /** * Get current time in milliseconds, accurate to nanoseconds * * @return Returns the time in milliseconds since the Epoch. */ - long long CC_DLL getTimeInMilliseconds(); + CC_DLL long long getTimeInMilliseconds(); /** * Calculate unionof bounding box of a node and its children. * @return Returns unionof bounding box of a node and its children. */ - Rect CC_DLL getCascadeBoundingBox(Node *node); + CC_DLL Rect getCascadeBoundingBox(Node *node); /** - * Create a sprite instance from base64 encoded image. + * Create a sprite instance from base64 encoded image and adds the texture to the Texture Cache. * @return Returns an instance of sprite */ - Sprite* createSpriteFromBase64(const char* base64String); + CC_DLL Sprite* createSpriteFromBase64Cached(const char* base64String, const char* key); + /** + * Create a sprite instance from base64 encoded image. + + * @return Returns an instance of sprite + */ + CC_DLL Sprite* createSpriteFromBase64(const char* base64String); + + + /** + * Find a child by name recursively + + * @return Returns found node or nullptr + */ + CC_DLL Node* findChild(Node* levelRoot, const char* name); + + /** + * Find a child by tag recursively + + * @return Returns found node or nullptr + */ + CC_DLL Node* findChild(Node* levelRoot, int tag); + + /** + * Find a child by name recursively + + * @return Returns found node or nullptr with specified type 'T' + */ + template inline + T findChild(Node* levelRoot, const char* name) + { + return dynamic_cast(findChild(levelRoot, name)); + } + + /** + * Find a child by tag recursively + + * @return Returns found node or nullptr with specified type 'T' + */ + template inline + T findChild(Node* levelRoot, int tag) + { + return dynamic_cast(findChild(levelRoot, tag)); + } } NS_CC_END diff --git a/cocos/cocos2d.cpp b/cocos/cocos2d.cpp index 46d042001077..02c8f1b20fd5 100644 --- a/cocos/cocos2d.cpp +++ b/cocos/cocos2d.cpp @@ -31,7 +31,7 @@ NS_CC_BEGIN CC_DLL const char* cocos2dVersion() { - return "cocos2d-x-3.11"; + return "cocos2d-x-3.11.1"; } NS_CC_END diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index ac3868ace04d..6a4e6410e858 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -30,7 +30,7 @@ THE SOFTWARE. // 0x00 HI ME LO // 00 03 08 00 -#define COCOS2D_VERSION 0x00031100 +#define COCOS2D_VERSION 0x00031101 // // all cocos2d include files @@ -169,13 +169,6 @@ THE SOFTWARE. #include "renderer/CCVertexAttribBinding.h" #include "renderer/CCVertexIndexBuffer.h" #include "renderer/CCVertexIndexData.h" -#include "renderer/CCPrimitive.h" -#include "renderer/CCPrimitiveCommand.h" -#include "renderer/CCTrianglesCommand.h" -#include "renderer/CCMaterial.h" -#include "renderer/CCTechnique.h" -#include "renderer/CCPass.h" -#include "renderer/CCRenderState.h" #include "renderer/CCFrameBuffer.h" #include "renderer/ccGLStateCache.h" #include "renderer/ccShaders.h" @@ -249,6 +242,13 @@ THE SOFTWARE. #include "platform/winrt/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_WINRT +#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) + #include "platform/tizen/CCApplication-tizen.h" + #include "platform/tizen/CCGLViewImpl-tizen.h" + #include "platform/tizen/CCGL-tizen.h" + #include "platform/tizen/CCStdC-tizen.h" +#endif + // script_support #include "base/CCScriptSupport.h" diff --git a/cocos/deprecated/CCArray.cpp b/cocos/deprecated/CCArray.cpp index 14d3fa2dbbc1..2f394bdd49e8 100644 --- a/cocos/deprecated/CCArray.cpp +++ b/cocos/deprecated/CCArray.cpp @@ -695,7 +695,7 @@ void __Array::exchangeObjectAtIndex(ssize_t index1, ssize_t index2) void __Array::replaceObjectAtIndex(ssize_t index, Ref* object, bool releaseObject/* = true*/) { ccArrayInsertObjectAtIndex(data, object, index); - ccArrayRemoveObjectAtIndex(data, index + 1); + ccArrayRemoveObjectAtIndex(data, index + 1, releaseObject); } void __Array::reverseObjects() @@ -732,10 +732,16 @@ __Array* __Array::clone() const ret->autorelease(); ret->initWithCapacity(this->data->num > 0 ? this->data->num : 1); + if (data->num <= 0) { + return ret; + } + Ref* obj = nullptr; Ref* tmpObj = nullptr; Clonable* clonable = nullptr; - CCARRAY_FOREACH(this, obj) + CC_ASSERT(data->num > 0); + for (Ref** arr = data->arr, **end = data->arr + data->num - 1; + arr <= end && ((obj = *arr) != nullptr); arr++) { clonable = dynamic_cast(obj); if (clonable) diff --git a/cocos/deprecated/CCDeprecated.h b/cocos/deprecated/CCDeprecated.h index d841c6c46fad..8b5dedf525af 100644 --- a/cocos/deprecated/CCDeprecated.h +++ b/cocos/deprecated/CCDeprecated.h @@ -90,7 +90,6 @@ #include "platform/CCFileUtils.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramCache.h" -#include "renderer/CCGLProgramCache.h" #include "renderer/CCTextureAtlas.h" #include "renderer/ccGLStateCache.h" diff --git a/cocos/deprecated/CCDictionary.cpp b/cocos/deprecated/CCDictionary.cpp index ecee5f5e6a88..23a3f4eae6f9 100644 --- a/cocos/deprecated/CCDictionary.cpp +++ b/cocos/deprecated/CCDictionary.cpp @@ -25,8 +25,6 @@ #include "deprecated/CCDictionary.h" #include -#include "deprecated/CCString.h" -#include "deprecated/CCInteger.h" #include "platform/CCFileUtils.h" #include "deprecated/CCString.h" #include "deprecated/CCBool.h" @@ -572,7 +570,8 @@ __Dictionary* __Dictionary::clone() const Clonable* obj = nullptr; if (_dictType == kDictInt) { - CCDICT_FOREACH(this, element) + DictElement* tmp = nullptr; + HASH_ITER(hh, _elements, element, tmp) { obj = dynamic_cast(element->getObject()); if (obj) @@ -591,7 +590,8 @@ __Dictionary* __Dictionary::clone() const } else if (_dictType == kDictStr) { - CCDICT_FOREACH(this, element) + DictElement* tmp = nullptr; + HASH_ITER(hh, _elements, element, tmp) { obj = dynamic_cast(element->getObject()); if (obj) diff --git a/cocos/editor-support/cocosbuilder/Android.mk b/cocos/editor-support/cocosbuilder/Android.mk index a93f8cf5aa19..0406e4d5781e 100644 --- a/cocos/editor-support/cocosbuilder/Android.mk +++ b/cocos/editor-support/cocosbuilder/Android.mk @@ -5,6 +5,10 @@ LOCAL_MODULE := cocosbuilder_static LOCAL_MODULE_FILENAME := libcocosbuilder +ifeq ($(USE_ARM_MODE),1) +LOCAL_ARM_MODE := arm +endif + LOCAL_SRC_FILES := CCBAnimationManager.cpp \ CCBFileLoader.cpp \ CCBKeyframe.cpp \ diff --git a/cocos/editor-support/cocostudio/Android.mk b/cocos/editor-support/cocostudio/Android.mk index 5a1ed035b6a9..720774bd7e49 100644 --- a/cocos/editor-support/cocostudio/Android.mk +++ b/cocos/editor-support/cocostudio/Android.mk @@ -5,6 +5,10 @@ LOCAL_MODULE := cocostudio_static LOCAL_MODULE_FILENAME := libcocostudio +ifeq ($(USE_ARM_MODE),1) +LOCAL_ARM_MODE := arm +endif + LOCAL_SRC_FILES := CCActionFrame.cpp \ CCActionFrameEasing.cpp \ CCActionManagerEx.cpp \ diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp index f36a9d303042..d359a12043cc 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp @@ -33,10 +33,10 @@ static ActionManagerEx* sharedActionManager = nullptr; ActionManagerEx* ActionManagerEx::getInstance() { - if (!sharedActionManager) { - sharedActionManager = new (std::nothrow) ActionManagerEx(); - } - return sharedActionManager; + if (!sharedActionManager) { + sharedActionManager = new (std::nothrow) ActionManagerEx(); + } + return sharedActionManager; } void ActionManagerEx::destroyInstance() @@ -55,30 +55,31 @@ ActionManagerEx::ActionManagerEx() ActionManagerEx::~ActionManagerEx() { - _actionDic.clear(); + _actionDic.clear(); } -void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::Value &dic, Ref* root) +void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::Value &dic, Ref* root, int version) { - std::string path = jsonName; - ssize_t pos = path.find_last_of("/"); - std::string fileName = path.substr(pos+1,path.length()); - cocos2d::Vector actionList; - int actionCount = DICTOOL->getArrayCount_json(dic, "actionlist"); - for (int i=0; iautorelease(); - const rapidjson::Value &actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i); - action->initWithDictionary(actionDic,root); - actionList.pushBack(action); - } - _actionDic[fileName] = actionList; + std::string path = jsonName; + this->_studioVersionNumber = version; + ssize_t pos = path.find_last_of("/"); + std::string fileName = path.substr(pos+1,path.length()); + cocos2d::Vector actionList; + int actionCount = DICTOOL->getArrayCount_json(dic, "actionlist"); + for (int i=0; iautorelease(); + const rapidjson::Value &actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i); + action->initWithDictionary(actionDic,root); + actionList.pushBack(action); + } + _actionDic[fileName] = actionList; } void ActionManagerEx::initWithBinary(const char* file, cocos2d::Ref *root, CocoLoader* cocoLoader, - stExpCocoNode* pCocoNode) + stExpCocoNode* pCocoNode) { std::string path = file; ssize_t pos = path.find_last_of("/"); @@ -113,54 +114,54 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::V ActionObject* ActionManagerEx::getActionByName(const char* jsonName,const char* actionName) { - std::string path = jsonName; - ssize_t pos = path.find_last_of("/"); - std::string fileName = path.substr(pos+1,path.length()); - auto iterator = _actionDic.find(fileName); - if (iterator == _actionDic.end()) - { - return nullptr; - } - auto actionList = iterator->second; - for (int i = 0; i < actionList.size(); i++) - { - ActionObject* action = actionList.at(i); - if (strcmp(actionName, action->getName()) == 0) - { - return action; - } - } - return nullptr; + std::string path = jsonName; + ssize_t pos = path.find_last_of("/"); + std::string fileName = path.substr(pos+1,path.length()); + auto iterator = _actionDic.find(fileName); + if (iterator == _actionDic.end()) + { + return nullptr; + } + auto actionList = iterator->second; + for (int i = 0; i < actionList.size(); i++) + { + ActionObject* action = actionList.at(i); + if (strcmp(actionName, action->getName()) == 0) + { + return action; + } + } + return nullptr; } ActionObject* ActionManagerEx::playActionByName(const char* jsonName,const char* actionName) { - ActionObject* action = getActionByName(jsonName,actionName); - if (action) - { - action->play(); - } - return action; + ActionObject* action = getActionByName(jsonName,actionName); + if (action) + { + action->play(); + } + return action; } ActionObject* ActionManagerEx::playActionByName(const char* jsonName,const char* actionName, CallFunc* func) { - ActionObject* action = getActionByName(jsonName,actionName); - if (action) - { - action->play(func); - } - return action; + ActionObject* action = getActionByName(jsonName,actionName); + if (action) + { + action->play(func); + } + return action; } ActionObject* ActionManagerEx::stopActionByName(const char* jsonName,const char* actionName) { - ActionObject* action = getActionByName(jsonName,actionName); - if (action) - { - action->stop(); - } - return action; + ActionObject* action = getActionByName(jsonName,actionName); + if (action) + { + action->stop(); + } + return action; } void ActionManagerEx::releaseActions() @@ -182,4 +183,9 @@ void ActionManagerEx::releaseActions() _actionDic.clear(); } +int ActionManagerEx::getStudioVersionNumber() const +{ + return this->_studioVersionNumber; +} + } diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.h b/cocos/editor-support/cocostudio/CCActionManagerEx.h index eec3ba75cd26..01b9cd17b329 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.h +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.h @@ -110,7 +110,7 @@ class CC_STUDIO_DLL ActionManagerEx:public cocos2d::Ref ActionObject* stopActionByName(const char* jsonName,const char* actionName); /*init properties with json dictionary*/ - void initWithDictionary(const char* jsonName,const rapidjson::Value &dic, Ref* root); + void initWithDictionary(const char* jsonName,const rapidjson::Value &dic, Ref* root, int version = 1600); void initWithBinary(const char* file, Ref* root, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode); /** @@ -119,8 +119,11 @@ class CC_STUDIO_DLL ActionManagerEx:public cocos2d::Ref */ void releaseActions(); + int getStudioVersionNumber() const; + protected: std::unordered_map> _actionDic; + int _studioVersionNumber; }; } diff --git a/cocos/editor-support/cocostudio/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp index 9000018a6532..ed2c9dc20020 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -29,6 +29,8 @@ THE SOFTWARE. #include "ui/UILayout.h" #include "editor-support/cocostudio/CocoLoader.h" #include "base/ccUtils.h" +#include "editor-support/cocostudio/CCActionManagerEx.h" + using namespace cocos2d; using namespace ui; @@ -107,7 +109,7 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic, Ref* root) { float positionX = DICTOOL->getFloatValue_json(actionFrameDic, "positionx"); float positionY = DICTOOL->getFloatValue_json(actionFrameDic, "positiony"); - if (positionOffset && (nullptr != node->getParent())) + if (positionOffset && (nullptr != node->getParent()) && ActionManagerEx::getInstance()->getStudioVersionNumber() < 1600) { Vec2 AnchorPointIn = node->getParent()->getAnchorPointInPoints(); positionX += AnchorPointIn.x; @@ -136,7 +138,7 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic, Ref* root) actionFrame->setScaleY(scaleY); auto cActionArray = _frameArray.at((int)kKeyframeScale); cActionArray->pushBack(actionFrame); - actionFrame->release(); + actionFrame->release(); } bool existRotation = DICTOOL->checkObjectExist_json(actionFrameDic,"rotation"); @@ -454,26 +456,44 @@ Spawn * ActionNode::refreshActionProperty() Vector cSequenceArray; auto frameCount = cArray->size(); - for (int i = 0; i < frameCount; i++) - { - auto frame = cArray->at(i); - if (i == 0) - { - } - else - { - auto srcFrame = cArray->at(i-1); - float duration = (frame->getFrameIndex() - srcFrame->getFrameIndex()) * getUnitTime(); - Action* cAction = frame->getAction(duration); - if(cAction != nullptr) - cSequenceArray.pushBack(static_cast(cAction)); - } - } - Sequence* cSequence = Sequence::create(cSequenceArray); - if (cSequence != nullptr) - { - cSpawnArray.pushBack(cSequence); - } + if(frameCount > 1) + { + for (int i = 0; i < frameCount; i++) + { + auto frame = cArray->at(i); + if (i == 0) + { +// #11173 Fixed every node of UI animation(json) is starting at frame 0. +// if (frame->getFrameIndex() > 0) +// { +// DelayTime* cDelayTime = DelayTime::create(frame->getFrameIndex() * getUnitTime()); +// if (cDelayTime != nullptr) +// cSequenceArray.pushBack(static_cast(cDelayTime)); +// } + } + else + { + auto srcFrame = cArray->at(i-1); + float duration = (frame->getFrameIndex() - srcFrame->getFrameIndex()) * getUnitTime(); + Action* cAction = frame->getAction(duration); + if(cAction != nullptr) + cSequenceArray.pushBack(static_cast(cAction)); + } + } + } + else if (frameCount == 1) + { + auto frame = cArray->at(0); + float duration = 0.0f; + Action* cAction = frame->getAction(duration); + if (cAction != nullptr) + cSequenceArray.pushBack(static_cast(cAction)); + } + Sequence* cSequence = Sequence::create(cSequenceArray); + if (cSequence != nullptr) + { + cSpawnArray.pushBack(cSequence); + } } if (_action == nullptr) @@ -637,7 +657,7 @@ void ActionNode::easingToFrame(float duration,float delayTime,ActionFrame* srcFr if (cAction == nullptr || cNode == nullptr) { return; - } + } cAction->startWithTarget(cNode); cAction->update(delayTime); } diff --git a/cocos/editor-support/cocostudio/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp index e8e5651a36ff..39f9536ca6d9 100644 --- a/cocos/editor-support/cocostudio/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -196,7 +196,7 @@ bool ComAttribute::serialize(void* r) { filePath.assign(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); } - if (parse(filePath.c_str())) + if (parse(filePath)) { ret = true; } diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/CCDataReaderHelper.h index 45ca45b3a08b..55685c8eac59 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.h @@ -32,7 +32,6 @@ THE SOFTWARE. #include "editor-support/cocostudio/CocosStudioExport.h" #include "json/document.h" -#include "editor-support/cocostudio/DictionaryHelper.h" #include #include diff --git a/cocos/editor-support/cocostudio/CCDisplayFactory.h b/cocos/editor-support/cocostudio/CCDisplayFactory.h index f53cf1d982be..086c284ae566 100644 --- a/cocos/editor-support/cocostudio/CCDisplayFactory.h +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.h @@ -28,7 +28,6 @@ THE SOFTWARE. #include "editor-support/cocostudio/CCArmatureDefine.h" #include "editor-support/cocostudio/CCDatas.h" #include "editor-support/cocostudio/CocosStudioExport.h" -#include "editor-support/cocostudio/CocosStudioExport.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 600827c06735..2d95821d234c 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -48,6 +48,7 @@ THE SOFTWARE. #include "editor-support/cocostudio/CocoLoader.h" #include "tinyxml2.h" + using namespace cocos2d; using namespace cocos2d::ui; diff --git a/cocos/editor-support/cocostudio/CocoStudio.h b/cocos/editor-support/cocostudio/CocoStudio.h index b6eae114f5bc..df29a6b2418e 100644 --- a/cocos/editor-support/cocostudio/CocoStudio.h +++ b/cocos/editor-support/cocostudio/CocoStudio.h @@ -64,9 +64,7 @@ THE SOFTWARE. #include "editor-support/cocostudio/ActionTimeline/CCActionTimelineNode.h" #include "editor-support/cocostudio/ActionTimeline/CCBoneNode.h" #include "editor-support/cocostudio/ActionTimeline/CCSkeletonNode.h" -#include "editor-support/cocostudio/CocosStudioExport.h" #include "editor-support/cocostudio/ActionTimeline/CSLoader.h" - #include "editor-support/cocostudio/CocosStudioExport.h" namespace cocostudio diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp index 52df55763cff..7690f03cf08b 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp @@ -1280,7 +1280,7 @@ flatbuffers::Offset FlatBuffersSerialize::createEasingD /* create flat buffers with XML */ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulator(const std::string &xmlFileName) { - std::string inFullpath = FileUtils::getInstance()->fullPathForFilename(xmlFileName).c_str(); + std::string inFullpath = FileUtils::getInstance()->fullPathForFilename(xmlFileName); // xml read if (!FileUtils::getInstance()->isFileExist(inFullpath)) diff --git a/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp index dba7e5569491..164412b4219d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp @@ -161,26 +161,26 @@ namespace cocostudio const tinyxml2::XMLElement* child = objectData->FirstChildElement(); while (child) { - std::string name = child->Name(); + std::string childName = child->Name(); - if (name == "LeftImage") + if (childName == "LeftImage") { attribute = child->FirstAttribute(); while (attribute) { - name = attribute->Name(); + std::string attributeName = attribute->Name(); std::string value = attribute->Value(); - if (name == "Path") + if (attributeName == "Path") { leftPath = value; } - else if (name == "Type") + else if (attributeName == "Type") { leftResourceType = getResourceType(value);; } - else if (name == "Plist") + else if (attributeName == "Plist") { leftPlistFile = value; } @@ -194,24 +194,24 @@ namespace cocostudio fbs->_textures.push_back(builder->CreateString(leftPlistFile)); } } - else if (name == "RightImage") + else if (childName == "RightImage") { attribute = child->FirstAttribute(); while (attribute) { - name = attribute->Name(); + std::string attributeName = attribute->Name(); std::string value = attribute->Value(); - if (name == "Path") + if (attributeName == "Path") { rightPath = value; } - else if (name == "Type") + else if (attributeName == "Type") { rightResourceType = getResourceType(value);; } - else if (name == "Plist") + else if (attributeName == "Plist") { rightPlistFile = value; } @@ -225,24 +225,24 @@ namespace cocostudio fbs->_textures.push_back(builder->CreateString(rightPlistFile)); } } - else if (name == "UpImage") + else if (childName == "UpImage") { attribute = child->FirstAttribute(); while (attribute) { - name = attribute->Name(); + std::string attributeName = attribute->Name(); std::string value = attribute->Value(); - if (name == "Path") + if (attributeName == "Path") { upPath = value; } - else if (name == "Type") + else if (attributeName == "Type") { upResourceType = getResourceType(value);; } - else if (name == "Plist") + else if (attributeName == "Plist") { upPlistFile = value; } @@ -256,24 +256,24 @@ namespace cocostudio fbs->_textures.push_back(builder->CreateString(upPlistFile)); } } - else if (name == "DownImage") + else if (childName == "DownImage") { attribute = child->FirstAttribute(); while (attribute) { - name = attribute->Name(); + std::string attributeName = attribute->Name(); std::string value = attribute->Value(); - if (name == "Path") + if (attributeName == "Path") { downPath = value; } - else if (name == "Type") + else if (attributeName == "Type") { downResourceType = getResourceType(value);; } - else if (name == "Plist") + else if (attributeName == "Plist") { downPlistFile = value; } @@ -287,24 +287,24 @@ namespace cocostudio fbs->_textures.push_back(builder->CreateString(downPlistFile)); } } - else if (name == "ForwardImage") + else if (childName == "ForwardImage") { attribute = child->FirstAttribute(); while (attribute) { - name = attribute->Name(); + std::string attributeName = attribute->Name(); std::string value = attribute->Value(); - if (name == "Path") + if (attributeName == "Path") { forwardPath = value; } - else if (name == "Type") + else if (attributeName == "Type") { forwardResourceType = getResourceType(value);; } - else if (name == "Plist") + else if (attributeName == "Plist") { forwardPlistFile = value; } @@ -318,24 +318,24 @@ namespace cocostudio fbs->_textures.push_back(builder->CreateString(forwardPlistFile)); } } - else if (name == "BackImage") + else if (childName == "BackImage") { attribute = child->FirstAttribute(); while (attribute) { - name = attribute->Name(); + std::string attributeName = attribute->Name(); std::string value = attribute->Value(); - if (name == "Path") + if (attributeName == "Path") { backPath = value; } - else if (name == "Type") + else if (attributeName == "Type") { backResourceType = getResourceType(value);; } - else if (name == "Plist") + else if (attributeName == "Plist") { backPlistFile = value; } diff --git a/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp index ca009461c438..b7538acc1493 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp @@ -161,7 +161,7 @@ namespace cocostudio float intensity = options->intensity(); float range = options->range(); float outerAngle = options->outerAngle()*0.5f; - bool enabled = options->enabled(); + bool enabled = (options->enabled() != 0); switch (type) { case cocos2d::LightType::DIRECTIONAL: diff --git a/cocos/editor-support/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp index 0e542c3b1ee0..350154ccdba8 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp @@ -180,7 +180,7 @@ void TabControlReader::setPropsWithFlatBuffers(cocos2d::Node* node, const flatbu auto options = (flatbuffers::TabControlOption*)nodeOption; int headerPlace = options->headerPlace(); - tabControl->ignoreHeadersTextureSize((bool)options->ignoreHeaderTextureSize()); + tabControl->ignoreHeadersTextureSize(options->ignoreHeaderTextureSize() != 0); tabControl->setHeaderDockPlace((cocos2d::ui::TabControl::Dock)headerPlace); tabControl->setHeaderWidth(options->headerWidth()); tabControl->setHeaderHeight(options->headerHeight()); diff --git a/cocos/editor-support/spine/Android.mk b/cocos/editor-support/spine/Android.mk index cfc8769eb408..f357b68771c9 100644 --- a/cocos/editor-support/spine/Android.mk +++ b/cocos/editor-support/spine/Android.mk @@ -5,6 +5,10 @@ LOCAL_MODULE := spine_static LOCAL_MODULE_FILENAME := libspine +ifeq ($(USE_ARM_MODE),1) +LOCAL_ARM_MODE := arm +endif + LOCAL_SRC_FILES := Animation.c \ AnimationState.c \ AnimationStateData.c \ diff --git a/cocos/navmesh/CCNavMesh.cpp b/cocos/navmesh/CCNavMesh.cpp index eb7d71211585..cc98bebc7dfc 100644 --- a/cocos/navmesh/CCNavMesh.cpp +++ b/cocos/navmesh/CCNavMesh.cpp @@ -229,7 +229,7 @@ bool NavMesh::loadNavMeshFile() bool NavMesh::loadGeomFile() { - unsigned char* buf = 0; + unsigned char* buf = nullptr; auto data = FileUtils::getInstance()->getDataFromFile(_geomFilePath); if (data.isNull()) return false; buf = data.getBytes(); diff --git a/cocos/navmesh/CCNavMeshUtils.cpp b/cocos/navmesh/CCNavMeshUtils.cpp index b332c9b91ed8..76341678c2cf 100644 --- a/cocos/navmesh/CCNavMeshUtils.cpp +++ b/cocos/navmesh/CCNavMeshUtils.cpp @@ -193,8 +193,8 @@ int fixupShortcuts(dtPolyRef* path, int npath, dtNavMeshQuery* navQuery) dtPolyRef neis[maxNeis]; int nneis = 0; - const dtMeshTile* tile = 0; - const dtPoly* poly = 0; + const dtMeshTile* tile = nullptr; + const dtPoly* poly = nullptr; if (dtStatusFailed(navQuery->getAttachedNavMesh()->getTileAndPolyByRef(path[0], &tile, &poly))) return npath; diff --git a/cocos/navmesh/CCNavMeshUtils.h b/cocos/navmesh/CCNavMeshUtils.h index 47299a56a5bc..83f3e8962491 100644 --- a/cocos/navmesh/CCNavMeshUtils.h +++ b/cocos/navmesh/CCNavMeshUtils.h @@ -125,7 +125,7 @@ bool getSteerTarget(dtNavMeshQuery* navQuery, const float* startPos, const float const float minTargetDist, const dtPolyRef* path, const int pathSize, float* steerPos, unsigned char& steerPosFlag, dtPolyRef& steerPosRef, - float* outPoints = 0, int* outPointCount = 0); + float* outPoints = nullptr, int* outPointCount = nullptr); /** @} */ NS_CC_END diff --git a/cocos/network/CCDownloader-apple.h b/cocos/network/CCDownloader-apple.h index 7f59d0c52d13..7c08eb47a940 100644 --- a/cocos/network/CCDownloader-apple.h +++ b/cocos/network/CCDownloader-apple.h @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2015 Chukong Technologies Inc. - + Copyright (c) 2015-2016 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 @@ -34,9 +34,9 @@ namespace cocos2d { namespace network public: DownloaderApple(const DownloaderHints& hints); virtual ~DownloaderApple(); - + virtual IDownloadTask *createCoTask(std::shared_ptr& task) override; - + private: void* _impl; }; diff --git a/cocos/network/CCDownloader-apple.mm b/cocos/network/CCDownloader-apple.mm index ce296f2fc041..8af5c95863bc 100644 --- a/cocos/network/CCDownloader-apple.mm +++ b/cocos/network/CCDownloader-apple.mm @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2015 Chukong Technologies Inc. - + Copyright (c) 2015-2016 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 @@ -79,12 +79,12 @@ -(void)doDestroy; { DLLOG("Construct DownloadTaskApple %p", this); } - + virtual ~DownloadTaskApple() { DLLOG("Destruct DownloadTaskApple %p", this); } - + NSURLSessionDataTask *dataTask; NSURLSessionDownloadTask *downloadTask; }; @@ -96,7 +96,7 @@ -(void)doDestroy; DLLOG("Construct DownloaderApple %p", this); _impl = (__bridge void*)[[DownloaderAppleImpl alloc] init: this hints:hints]; } - + DownloaderApple::~DownloaderApple() { DeclareDownloaderImplVar; @@ -148,7 +148,7 @@ -(int64_t) transferDataToBuffer:(void*)buffer lengthOfBuffer:(int64_t)len { int64_t bytesReceived = 0; int receivedDataObject = 0; - + __block char *p = (char *)buffer; for (NSData* data in _dataArray) { @@ -157,7 +157,7 @@ -(int64_t) transferDataToBuffer:(void*)buffer lengthOfBuffer:(int64_t)len { break; } - + // copy data [data enumerateByteRangesUsingBlock:^(const void *bytes, NSRange byteRange, @@ -167,12 +167,12 @@ -(int64_t) transferDataToBuffer:(void*)buffer lengthOfBuffer:(int64_t)len p += byteRange.length; *stop = NO; }]; - + // accumulate bytesReceived += data.length; ++receivedDataObject; } - + // remove receivedNSDataObject from dataArray [_dataArray removeObjectsInRange:NSMakeRange(0, receivedDataObject)]; self.bytesReceived -= bytesReceived; @@ -196,10 +196,10 @@ - (id)init: (const cocos2d::network::DownloaderApple*)o hints:(const cocos2d::ne // save outer task ref _outer = o; _hints = hints; - + // create task dictionary self.taskDict = [NSMutableDictionary dictionary]; - + // create download session NSURLSessionConfiguration *defaultConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; self.downloadSession = [NSURLSession sessionWithConfiguration:defaultConfig delegate:self delegateQueue:[NSOperationQueue mainQueue]]; @@ -281,7 +281,7 @@ -(void)doDestroy for (NSURLSessionDownloadTask *task in enumeratorKey) { DownloadTaskWrapper *wrapper = [self.taskDict objectForKey:task]; - + // no resume support for a data task std::string storagePath = [wrapper get]->storagePath; if(storagePath.length() == 0) { @@ -321,7 +321,7 @@ -(void)doDestroy } } _outer = nullptr; - + [self.downloadSession invalidateAndCancel]; [self release]; } @@ -386,7 +386,7 @@ - (void)URLSession:(NSURLSession *)session task :(NSURLSessionTask *)task // clean wrapper C++ object DownloadTaskWrapper *wrapper = [self.taskDict objectForKey:task]; - + if(_outer) { if(error) @@ -408,7 +408,7 @@ - (void)URLSession:(NSURLSession *)session task :(NSURLSessionTask *)task char buf[buflen]; [wrapper transferDataToBuffer:buf lengthOfBuffer:buflen]; std::vector data(buf, buf + buflen); - + _outer->onTaskFinish(*[wrapper get], cocos2d::network::DownloadTask::ERROR_NO_ERROR, 0, @@ -418,14 +418,14 @@ - (void)URLSession:(NSURLSession *)session task :(NSURLSessionTask *)task else { NSInteger statusCode = ((NSHTTPURLResponse*)task.response).statusCode; - + // Check for error status code if (statusCode >= 400) { std::vector buf; // just a placeholder const char *orignalURL = [task.originalRequest.URL.absoluteString cStringUsingEncoding:NSUTF8StringEncoding]; std::string errorMessage = cocos2d::StringUtils::format("Downloader: Failed to download %s with status code (%d)", orignalURL, (int)statusCode); - + _outer->onTaskFinish(*[wrapper get], cocos2d::network::DownloadTask::ERROR_IMPL_INTERNAL, 0, @@ -487,13 +487,13 @@ - (void)URLSession:(NSURLSession *)session dataTask :(NSURLSessionDataTask *)dat } DownloadTaskWrapper *wrapper = [self.taskDict objectForKey:dataTask]; [wrapper addData:data]; - + std::function transferDataToBuffer = [wrapper](void *buffer, int64_t bufLen)->int64_t { return [wrapper transferDataToBuffer:buffer lengthOfBuffer: bufLen]; }; - + _outer->onTaskProgress(*[wrapper get], wrapper.bytesReceived, wrapper.totalBytesReceived, @@ -528,7 +528,7 @@ - (void)URLSession:(NSURLSession *)session downloadTask :(NSURLSessionDownloadTa { return; } - + // On iOS 9 a response with status code 4xx(Client Error) or 5xx(Server Error) // might end up calling this delegate method, saving the error message to the storage path // and treating this download task as a successful one, so we need to check the status code here @@ -537,7 +537,7 @@ - (void)URLSession:(NSURLSession *)session downloadTask :(NSURLSessionDownloadTa { return; } - + DownloadTaskWrapper *wrapper = [self.taskDict objectForKey:downloadTask]; const char * storagePath = [wrapper get]->storagePath.c_str(); NSString *destPath = [NSString stringWithUTF8String:storagePath]; @@ -550,27 +550,27 @@ - (void)URLSession:(NSURLSession *)session downloadTask :(NSURLSessionDownloadTa { break; } - + if ('/' == [destPath characterAtIndex:0]) { destURL = [NSURL fileURLWithPath:destPath]; break; } - + // relative path, store to user domain default NSArray *URLs = [fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask]; NSURL *documentsDirectory = URLs[0]; destURL = [documentsDirectory URLByAppendingPathComponent:destPath]; } while (0); - + // Make sure we overwrite anything that's already there [fileManager removeItemAtURL:destURL error:NULL]; - + // copy file to dest location int errorCode = cocos2d::network::DownloadTask::ERROR_NO_ERROR; int errorCodeInternal = 0; std::string errorString; - + NSError *error = nil; if ([fileManager copyItemAtURL:location toURL:destURL error:&error]) { @@ -609,9 +609,9 @@ - (void)URLSession:(NSURLSession *)session downloadTask :(NSURLSessionDownloadTa { return; } - + DownloadTaskWrapper *wrapper = [self.taskDict objectForKey:downloadTask]; - + std::function transferDataToBuffer; // just a placeholder _outer->onTaskProgress(*[wrapper get], bytesWritten, totalBytesWritten, totalBytesExpectedToWrite, transferDataToBuffer); } @@ -631,3 +631,4 @@ - (void)URLSession:(NSURLSession *)session downloadTask :(NSURLSessionDownloadTa } @end + diff --git a/cocos/network/CCDownloader-curl.cpp b/cocos/network/CCDownloader-curl.cpp index 248e70686c80..9f9a01eebd90 100644 --- a/cocos/network/CCDownloader-curl.cpp +++ b/cocos/network/CCDownloader-curl.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2015 Chukong Technologies Inc. + Copyright (c) 2015-2016 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -40,20 +40,20 @@ namespace cocos2d { namespace network { using namespace std; - + //////////////////////////////////////////////////////////////////////////////// // Implementation DownloadTaskCURL class DownloadTaskCURL : public IDownloadTask { static int _sSerialId; - + // if more than one task write to one file, cause file broken // so use a set to check this situation static set _sStoragePathSet; public: int serialId; - + DownloadTaskCURL() : serialId(_sSerialId++) , _fp(nullptr) @@ -61,7 +61,7 @@ namespace cocos2d { namespace network { _initInternal(); DLLOG("Construct DownloadTaskCURL %p", this); } - + virtual ~DownloadTaskCURL() { // if task destroyed unnormally, we should release WritenFileName stored in set. @@ -77,7 +77,7 @@ namespace cocos2d { namespace network { } DLLOG("Destruct DownloadTaskCURL %p", this); } - + bool init(const string& filename, const string& tempSuffix) { if (0 == filename.length()) @@ -86,12 +86,12 @@ namespace cocos2d { namespace network { _buf.reserve(CURL_MAX_WRITE_SIZE); return true; } - + // file task _fileName = filename; _tempFileName = filename; _tempFileName.append(tempSuffix); - + if (_sStoragePathSet.end() != _sStoragePathSet.find(_tempFileName)) { // there is another task uses this storage path @@ -102,13 +102,13 @@ namespace cocos2d { namespace network { return false; } _sStoragePathSet.insert(_tempFileName); - + // open temp file handle for write bool ret = false; do { string dir; - unsigned long found = _tempFileName.find_last_of("/\\"); + size_t found = _tempFileName.find_last_of("/\\"); if (found == string::npos) { _errCode = DownloadTask::ERROR_INVALID_PARAMS; @@ -116,7 +116,7 @@ namespace cocos2d { namespace network { _errDescription = "Can't find dirname in storagePath."; break; } - + // ensure directory is exist auto util = FileUtils::getInstance(); dir = _tempFileName.substr(0, found+1); @@ -152,7 +152,7 @@ namespace cocos2d { namespace network { lock_guard lock(_mutex); _initInternal(); } - + void setErrorProc(int code, int codeInternal, const char *desc) { lock_guard lock(_mutex); @@ -160,7 +160,7 @@ namespace cocos2d { namespace network { _errCodeInternal = codeInternal; _errDescription = desc; } - + size_t writeDataProc(unsigned char *buffer, size_t size, size_t count) { lock_guard lock(_mutex); @@ -187,35 +187,35 @@ namespace cocos2d { namespace network { } return ret; } - + private: friend class DownloaderCURL; - + // for lock object instance mutex _mutex; - + // header info bool _acceptRanges; bool _headerAchieved; int64_t _totalBytesExpected; - + string _header; // temp buffer for receive header string, only used in thread proc - + // progress int64_t _bytesReceived; int64_t _totalBytesReceived; - + // error int _errCode; int _errCodeInternal; string _errDescription; - + // for saving data string _fileName; string _tempFileName; vector _buf; FILE* _fp; - + void _initInternal() { _acceptRanges = (false); @@ -231,9 +231,9 @@ namespace cocos2d { namespace network { }; int DownloadTaskCURL::_sSerialId; set DownloadTaskCURL::_sStoragePathSet; - + typedef pair< shared_ptr, DownloadTaskCURL *> TaskWrapper; - + //////////////////////////////////////////////////////////////////////////////// // Implementation DownloaderCURL::Impl // This class shared by DownloaderCURL and work thread. @@ -241,18 +241,18 @@ namespace cocos2d { namespace network { { public: DownloaderHints hints; - + Impl() // : _thread(nullptr) { DLLOG("Construct DownloaderCURL::Impl %p", this); } - + ~Impl() { DLLOG("Destruct DownloaderCURL::Impl %p %d", this, _thread.joinable()); } - + void addTask(std::shared_ptr task, DownloadTaskCURL* coTask) { if (DownloadTask::ERROR_NO_ERROR == coTask->_errCode) @@ -266,7 +266,7 @@ namespace cocos2d { namespace network { _finishedQueue.push_back(make_pair(task, coTask)); } } - + void run() { lock_guard lock(_threadMutex); @@ -276,7 +276,7 @@ namespace cocos2d { namespace network { _thread.swap(newThread); } } - + void stop() { lock_guard lock(_threadMutex); @@ -285,20 +285,20 @@ namespace cocos2d { namespace network { _thread.detach(); } } - + bool stoped() { lock_guard lock(_threadMutex); return false == _thread.joinable() ? true : false; } - + void getProcessTasks(vector& outList) { lock_guard lock(_processMutex); outList.reserve(_processSet.size()); outList.insert(outList.end(), _processSet.begin(), _processSet.end()); } - + void getFinishedTasks(vector& outList) { lock_guard lock(_finishedMutex); @@ -316,7 +316,7 @@ namespace cocos2d { namespace network { coTask._header.append((const char *)buffer, strLen); return strLen; } - + static size_t _outputDataCallbackProc(void *buffer, size_t size, size_t count, void *userdata) { // DLLOG(" _outputDataCallbackProc: size(%ld), count(%ld)", size, count); @@ -333,10 +333,10 @@ namespace cocos2d { namespace network { { const DownloadTask& task = *wrapper.first; const DownloadTaskCURL* coTask = wrapper.second; - + // set url curl_easy_setopt(handle, CURLOPT_URL, task.requestURL.c_str()); - + // set write func if (forContent) { @@ -347,14 +347,14 @@ namespace cocos2d { namespace network { curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, DownloaderCURL::Impl::_outputHeaderCallbackProc); } curl_easy_setopt(handle, CURLOPT_WRITEDATA, coTask); - + curl_easy_setopt(handle, CURLOPT_NOPROGRESS, true); // curl_easy_setopt(handle, CURLOPT_XFERINFOFUNCTION, DownloaderCURL::Impl::_progressCallbackProc); // curl_easy_setopt(handle, CURLOPT_XFERINFODATA, coTask); curl_easy_setopt(handle, CURLOPT_FAILONERROR, true); curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1L); - + if (forContent) { /** if server acceptRanges and local has part of file, we continue to download **/ @@ -378,12 +378,12 @@ namespace cocos2d { namespace network { { curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, hints.timeoutInSeconds); } - + static const long LOW_SPEED_LIMIT = 1; static const long LOW_SPEED_TIME = 5; curl_easy_setopt(handle, CURLOPT_LOW_SPEED_LIMIT, LOW_SPEED_LIMIT); curl_easy_setopt(handle, CURLOPT_LOW_SPEED_TIME, LOW_SPEED_TIME); - + static const int MAX_REDIRS = 2; if (MAX_REDIRS) { @@ -391,7 +391,7 @@ namespace cocos2d { namespace network { curl_easy_setopt(handle, CURLOPT_MAXREDIRS, MAX_REDIRS); } } - + // get header info, if success set handle to content download state bool _getHeaderInfoProc(CURL *handle, TaskWrapper& wrapper) { @@ -414,7 +414,7 @@ namespace cocos2d { namespace network { , httpResponseCode); coTask.setErrorProc(DownloadTask::ERROR_IMPL_INTERNAL, CURLE_OK, buf); } - + // curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, &effectiveUrl); // curl_easy_getinfo(handle, CURLINFO_CONTENT_TYPE, &contentType); double contentLen = 0; @@ -423,9 +423,9 @@ namespace cocos2d { namespace network { { break; } - + bool acceptRanges = (string::npos != coTask._header.find("Accept-Ranges")) ? true : false; - + // get current file size int64_t fileSize = 0; if (acceptRanges && coTask._tempFileName.length()) @@ -443,14 +443,14 @@ namespace cocos2d { namespace network { } coTask._headerAchieved = true; } while (0); - + if (CURLE_OK != rc) { coTask.setErrorProc(DownloadTask::ERROR_IMPL_INTERNAL, rc, curl_easy_strerror(rc)); } return coTask._headerAchieved; } - + void _threadProc() { DLLOG("++++DownloaderCURL::Impl::_threadProc begin %p", this); @@ -464,7 +464,7 @@ namespace cocos2d { namespace network { int runningHandles = 0; CURLMcode mcode = CURLM_OK; int rc = 0; // select return code - + do { // check the thread should exit or not @@ -482,28 +482,28 @@ namespace cocos2d { namespace network { // get timeout setting from multi-handle long timeoutMS = -1; curl_multi_timeout(curlmHandle, &timeoutMS); - + if(timeoutMS < 0) { timeoutMS = 1000; } - + /* get file descriptors from the transfers */ fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd = -1; - + FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); - + mcode = curl_multi_fdset(curlmHandle, &fdread, &fdwrite, &fdexcep, &maxfd); if (CURLM_OK != mcode) { break; } - + // do wait action if(maxfd == -1) { @@ -513,19 +513,19 @@ namespace cocos2d { namespace network { else { struct timeval timeout; - + timeout.tv_sec = timeoutMS / 1000; timeout.tv_usec = (timeoutMS % 1000) * 1000; - + rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); } - + if (rc < 0) { DLLOG(" _threadProc: select return unexpect code: %d", rc); } } - + if (coTaskMap.size()) { mcode = CURLM_CALL_MULTI_PERFORM; @@ -537,7 +537,7 @@ namespace cocos2d { namespace network { { break; } - + struct CURLMsg *m; do { int msgq = 0; @@ -548,7 +548,7 @@ namespace cocos2d { namespace network { CURLcode errCode = m->data.result; TaskWrapper wrapper = coTaskMap[curlHandle]; - + // remove from multi-handle curl_multi_remove_handle(curlmHandle, curlHandle); bool reinited = false; @@ -559,13 +559,13 @@ namespace cocos2d { namespace network { wrapper.second->setErrorProc(DownloadTask::ERROR_IMPL_INTERNAL, errCode, curl_easy_strerror(errCode)); break; } - + // if the task is content download task, cleanup the handle if (wrapper.second->_headerAchieved) { break; } - + // the task is get header task // first, we get info from response if (false == _getHeaderInfoProc(curlHandle, wrapper)) @@ -573,7 +573,7 @@ namespace cocos2d { namespace network { // the error info has been set in _getHeaderInfoProc break; } - + // after get header info success // wrapper.second->_totalBytesReceived inited by local file size // if the local file size equal with the content size from header, the file has downloaded finish @@ -595,17 +595,17 @@ namespace cocos2d { namespace network { } reinited = true; } while (0); - + if (reinited) { continue; } curl_easy_cleanup(curlHandle); DLLOG(" _threadProc task clean cur handle :%p with errCode:%d", curlHandle, errCode); - + // remove from coTaskMap coTaskMap.erase(curlHandle); - + // remove from _processSet { lock_guard lock(_processMutex); @@ -613,7 +613,7 @@ namespace cocos2d { namespace network { _processSet.erase(wrapper); } } - + // add to finishedQueue { lock_guard lock(_finishedMutex); @@ -622,7 +622,7 @@ namespace cocos2d { namespace network { } } while(m); } - + // process tasks in _requestList while (0 == countOfMaxProcessingTasks || coTaskMap.size() < countOfMaxProcessingTasks) { @@ -636,18 +636,18 @@ namespace cocos2d { namespace network { _requestQueue.pop_front(); } } - + // if request queue is empty, the wrapper.first is nullptr if (! wrapper.first) { break; } - + wrapper.second->initProc(); - + // create curl handle from task and add into curl multi handle CURL* curlHandle = curl_easy_init(); - + if (nullptr == curlHandle) { wrapper.second->setErrorProc(DownloadTask::ERROR_IMPL_INTERNAL, 0, "Alloc curl handle failed."); @@ -655,10 +655,10 @@ namespace cocos2d { namespace network { _finishedQueue.push_back(wrapper); continue; } - + // init curl handle for get header info _initCurlHandleProc(curlHandle, wrapper); - + // add curl handle to process list mcode = curl_multi_add_handle(curlmHandle, curlHandle); if (CURLM_OK != mcode) @@ -668,30 +668,30 @@ namespace cocos2d { namespace network { _finishedQueue.push_back(wrapper); continue; } - + DLLOG(" _threadProc task create curl handle:%p", curlHandle); coTaskMap[curlHandle] = wrapper; lock_guard lock(_processMutex); _processSet.insert(wrapper); } } while (coTaskMap.size()); - + curl_multi_cleanup(curlmHandle); this->stop(); DLLOG("----DownloaderCURL::Impl::_threadProc end"); } - + thread _thread; deque _requestQueue; set _processSet; deque _finishedQueue; - + mutex _threadMutex; mutex _requestMutex; mutex _processMutex; mutex _finishedMutex; }; - + //////////////////////////////////////////////////////////////////////////////// // Implementation DownloaderCURL @@ -703,7 +703,7 @@ namespace cocos2d { namespace network { _impl->hints = hints; _scheduler = Director::getInstance()->getScheduler(); _scheduler->retain(); - + _transferDataToBuffer = [this](void *buf, int64_t len)->int64_t { DownloadTaskCURL& coTask = *_currTask; @@ -712,37 +712,37 @@ namespace cocos2d { namespace network { { return 0; } - + memcpy(buf, coTask._buf.data(), dataLen); coTask._buf.resize(0); return dataLen; }; - + char key[128]; sprintf(key, "DownloaderCURL(%p)", this); _schedulerKey = key; - + _scheduler->schedule(bind(&DownloaderCURL::_onSchedule, this, placeholders::_1), this, 0.1f, true, _schedulerKey); } - + DownloaderCURL::~DownloaderCURL() { _scheduler->unschedule(_schedulerKey, this); _scheduler->release(); - + _impl->stop(); DLLOG("Destruct DownloaderCURL %p", this); } - + IDownloadTask *DownloaderCURL::createCoTask(std::shared_ptr& task) { DownloadTaskCURL *coTask = new (std::nothrow) DownloadTaskCURL; coTask->init(task->storagePath, _impl->hints.tempFileNameSuffix); - + DLLOG(" DownloaderCURL: createTask: Id(%d)", coTask->serialId); _impl->addTask(task, coTask); @@ -754,14 +754,14 @@ namespace cocos2d { namespace network { void DownloaderCURL::_onSchedule(float) { vector tasks; - + // update processing tasks _impl->getProcessTasks(tasks); for (auto& wrapper : tasks) { const DownloadTask& task = *wrapper.first; DownloadTaskCURL& coTask = *wrapper.second; - + lock_guard lock(coTask._mutex); if (coTask._bytesReceived) { @@ -776,10 +776,9 @@ namespace cocos2d { namespace network { } } tasks.resize(0); - + // update finished tasks _impl->getFinishedTasks(tasks); - if (_impl->stoped()) { _scheduler->pauseTarget(this); @@ -789,7 +788,7 @@ namespace cocos2d { namespace network { { const DownloadTask& task = *wrapper.first; DownloadTaskCURL& coTask = *wrapper.second; - + // if there is bytesReceived, call progress update first if (coTask._bytesReceived) { @@ -802,7 +801,7 @@ namespace cocos2d { namespace network { coTask._bytesReceived = 0; _currTask = nullptr; } - + // if file task, close file handle and rename file if needed if (coTask._fp) { @@ -814,7 +813,7 @@ namespace cocos2d { namespace network { { break; } - + auto util = FileUtils::getInstance(); // if file already exist, remove it if (util->isFileExist(coTask._fileName)) @@ -828,7 +827,7 @@ namespace cocos2d { namespace network { break; } } - + // rename file if (util->renameFile(coTask._tempFileName, coTask._fileName)) { @@ -844,12 +843,13 @@ namespace cocos2d { namespace network { coTask._errDescription.append(" to: "); coTask._errDescription.append(coTask._fileName); } while (0); - + } // needn't lock coTask here, because tasks has removed form _impl onTaskFinish(task, coTask._errCode, coTask._errCodeInternal, coTask._errDescription, coTask._buf); DLLOG(" DownloaderCURL: finish Task: Id(%d)", coTask.serialId); } } - + }} // namespace cocos2d::network + diff --git a/cocos/network/CCDownloader-curl.h b/cocos/network/CCDownloader-curl.h index 6e877ba6a1cd..4cfe5e3dda86 100644 --- a/cocos/network/CCDownloader-curl.h +++ b/cocos/network/CCDownloader-curl.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2015 Chukong Technologies Inc. + Copyright (c) 2015-2016 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -34,7 +34,7 @@ namespace cocos2d { namespace network { class DownloadTaskCURL; class DownloaderHints; - + class DownloaderCURL : public IDownloaderImpl { public: @@ -46,11 +46,11 @@ namespace cocos2d { namespace network protected: class Impl; std::shared_ptr _impl; - + // for transfer data on schedule DownloadTaskCURL* _currTask; // temp ref std::function _transferDataToBuffer; - + // scheduler for update processing and finished task in main schedule void _onSchedule(float); std::string _schedulerKey; diff --git a/cocos/network/CCDownloader.cpp b/cocos/network/CCDownloader.cpp index 105b0cfd28ab..bce110f4b3fb 100644 --- a/cocos/network/CCDownloader.cpp +++ b/cocos/network/CCDownloader.cpp @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - + Copyright (c) 2015-2016 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 @@ -54,7 +54,7 @@ namespace cocos2d { namespace network { { DLLOG("Construct DownloadTask %p", this); } - + DownloadTask::~DownloadTask() { DLLOG("Destruct DownloadTask %p", this); @@ -72,7 +72,7 @@ namespace cocos2d { namespace network { }; new(this)Downloader(hints); } - + Downloader::Downloader(const DownloaderHints& hints) { DLLOG("Construct Downloader %p", this); @@ -88,7 +88,7 @@ namespace cocos2d { namespace network { onTaskProgress(task, bytesReceived, totalBytesReceived, totalBytesExpected); } }; - + _impl->onTaskFinish = [this](const DownloadTask& task, int errorCode, int errorCodeInternal, @@ -122,12 +122,12 @@ namespace cocos2d { namespace network { } }; } - + Downloader::~Downloader() { DLLOG("Destruct Downloader %p", this); } - + std::shared_ptr Downloader::createDownloadDataTask(const std::string& srcUrl, const std::string& identifier/* = ""*/) { DownloadTask *task_ = new (std::nothrow) DownloadTask(); @@ -147,10 +147,10 @@ namespace cocos2d { namespace network { } task_->_coTask.reset(_impl->createCoTask(task)); } while (0); - + return task; } - + std::shared_ptr Downloader::createDownloadFileTask(const std::string& srcUrl, const std::string& storagePath, const std::string& identifier/* = ""*/) @@ -176,7 +176,7 @@ namespace cocos2d { namespace network { return task; } - + //std::string Downloader::getFileNameFromUrl(const std::string& srcUrl) //{ // // Find file name and file extension @@ -188,3 +188,4 @@ namespace cocos2d { namespace network { //} }} // namespace cocos2d::network + diff --git a/cocos/network/CCDownloader.h b/cocos/network/CCDownloader.h index 8caa88b4b824..41730421b847 100644 --- a/cocos/network/CCDownloader.h +++ b/cocos/network/CCDownloader.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 cocos2d-x.org + Copyright (c) 2015-2016 cocos2d-x.org http://www.cocos2d-x.org @@ -36,7 +36,7 @@ namespace cocos2d { namespace network { class IDownloadTask; class IDownloaderImpl; class Downloader; - + class CC_DLL DownloadTask final { public: @@ -44,19 +44,19 @@ namespace cocos2d { namespace network { const static int ERROR_INVALID_PARAMS = -1; const static int ERROR_FILE_OP_FAILED = -2; const static int ERROR_IMPL_INTERNAL = -3; - + std::string identifier; std::string requestURL; std::string storagePath; DownloadTask(); virtual ~DownloadTask(); - + private: friend class Downloader; std::unique_ptr _coTask; }; - + class CC_DLL DownloaderHints { public: @@ -64,35 +64,36 @@ namespace cocos2d { namespace network { uint32_t timeoutInSeconds; std::string tempFileNameSuffix; }; - + class CC_DLL Downloader final { public: Downloader(); Downloader(const DownloaderHints& hints); ~Downloader(); - + std::function& data)> onDataTaskSuccess; std::function onFileTaskSuccess; - + std::function onTaskProgress; - + std::function onTaskError; - + std::shared_ptr createDownloadDataTask(const std::string& srcUrl, const std::string& identifier = ""); - + std::shared_ptr createDownloadFileTask(const std::string& srcUrl, const std::string& storagePath, const std::string& identifier = ""); - + private: std::unique_ptr _impl; }; }} // namespace cocos2d::network + diff --git a/cocos/network/CCIDownloaderImpl.h b/cocos/network/CCIDownloaderImpl.h index ede11b14e2db..82a9465aa2c6 100644 --- a/cocos/network/CCIDownloaderImpl.h +++ b/cocos/network/CCIDownloaderImpl.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2015 Chukong Technologies Inc. +Copyright (c) 2015-2016 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -40,7 +40,7 @@ THE SOFTWARE. namespace cocos2d { namespace network { class DownloadTask; - + class CC_DLL IDownloadTask { public: @@ -51,20 +51,21 @@ namespace cocos2d { namespace network { public: virtual ~IDownloaderImpl(){} - + std::function& transferDataToBuffer)> onTaskProgress; - + std::function& data)> onTaskFinish; - + virtual IDownloadTask *createCoTask(std::shared_ptr& task) = 0; }; }} // namespace cocos2d::network + diff --git a/cocos/network/HttpAsynConnection-apple.h b/cocos/network/HttpAsynConnection-apple.h index 3995cf2c0948..df370a91e98d 100644 --- a/cocos/network/HttpAsynConnection-apple.h +++ b/cocos/network/HttpAsynConnection-apple.h @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2013-2015 Chukong Technologies Inc. - + Copyright (c) 2013-2016 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 @@ -34,18 +34,6 @@ /// @cond @interface HttpAsynConnection : NSObject { - NSString *srcURL; - NSString *sslFile; - NSDictionary *responseHeader; - NSMutableData *responseData; - NSInteger getDataTime; - NSInteger responseCode; - NSString *statusString; - NSError *responseError; - NSError *connError; - NSURLConnection *conn; - bool finish; - NSRunLoop *runLoop; } // The original URL to download. Due to redirects the actual content may come from another URL @@ -80,3 +68,4 @@ /// @endcond #endif //__HTTPASYNCONNECTION_H__ + diff --git a/cocos/network/HttpAsynConnection-apple.m b/cocos/network/HttpAsynConnection-apple.m index 0d926c0a0fc8..e63174b798ce 100644 --- a/cocos/network/HttpAsynConnection-apple.m +++ b/cocos/network/HttpAsynConnection-apple.m @@ -187,13 +187,19 @@ - (BOOL) shouldTrustProtectionSpace:(NSURLProtectionSpace*)protectionSpace CFDataRef errDataRef = SecTrustCopyExceptions(serverTrust); SecTrustSetExceptions(serverTrust, errDataRef); SecTrustEvaluate(serverTrust, &trustResult); - [(id)errDataRef release]; + CFRelease(errDataRef); } [certData release]; - [(id)certArrayRef release]; - [(id)certArrayRef release]; + if (cert) + { + CFRelease(cert); + } + if (certArrayRef) + { + CFRelease(certArrayRef); + } //Did our custom trust chain evaluate successfully? - return trustResult = kSecTrustResultUnspecified || trustResult == kSecTrustResultProceed; + return trustResult == kSecTrustResultUnspecified || trustResult == kSecTrustResultProceed; } - (void) connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge diff --git a/cocos/network/HttpClient-android.cpp b/cocos/network/HttpClient-android.cpp index 1d5d50025945..f167d0160af3 100644 --- a/cocos/network/HttpClient-android.cpp +++ b/cocos/network/HttpClient-android.cpp @@ -383,7 +383,7 @@ class HttpURLConnection return header; } - const std::string getCookieFileName() + const std::string& getCookieFileName() const { return _cookieFileName; } @@ -399,7 +399,7 @@ class HttpURLConnection } private: - void createHttpURLConnection(std::string url) + void createHttpURLConnection(const std::string& url) { JniMethodInfo methodInfo; if (JniHelper::getStaticMethodInfo(methodInfo, @@ -608,7 +608,7 @@ class HttpURLConnection return len; } - const std::string getCookieString() + const std::string& getCookieString() const { return _responseCookies; } @@ -892,7 +892,7 @@ HttpClient::HttpClient() HttpClient::~HttpClient() { CCLOG("In the destructor of HttpClient!"); - CC_SAFE_DELETE(_requestSentinel); + CC_SAFE_RELEASE(_requestSentinel); } //Lazy create semaphore & mutex & thread diff --git a/cocos/network/HttpClient-apple.mm b/cocos/network/HttpClient-apple.mm index 72299bd90e43..2dc16e1a7d36 100644 --- a/cocos/network/HttpClient-apple.mm +++ b/cocos/network/HttpClient-apple.mm @@ -1,20 +1,20 @@ /**************************************************************************** Copyright (c) 2012 greathqy Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - + Copyright (c) 2013-2016 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 @@ -40,7 +40,7 @@ of this software and associated documentation files (the "Software"), to deal NS_CC_BEGIN namespace network { - + static HttpClient *_httpClient = nullptr; // pointer to singleton static int processTask(HttpClient* client, HttpRequest *request, NSString *requestType, void *stream, long *errorCode, void *headerStream, char *errorBuffer); @@ -170,12 +170,7 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque //if request type is post or put,set header and data if([requestType isEqual: @"POST"] || [requestType isEqual: @"PUT"]) - { - if ([requestType isEqual: @"PUT"]) - { - [nsrequest setValue: @"application/x-www-form-urlencoded" forHTTPHeaderField: @"Content-Type"]; - } - + { char* requestDataBuffer = request->getRequestData(); if (nullptr != requestDataBuffer && 0 != request->getRequestDataSize()) { @@ -297,7 +292,7 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque const void* ptr = [httpAsynConn.responseData bytes]; long len = [httpAsynConn.responseData length]; recvBuffer->insert(recvBuffer->end(), (char*)ptr, (char*)ptr+len); - + return 1; } @@ -308,7 +303,7 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque { _httpClient = new (std::nothrow) HttpClient(); } - + return _httpClient; } @@ -319,9 +314,9 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque CCLOG("HttpClient singleton is nullptr"); return; } - + CCLOG("HttpClient::destroyInstance begin"); - + auto thiz = _httpClient; _httpClient = nullptr; @@ -333,10 +328,10 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque thiz->_requestQueueMutex.lock(); thiz->_requestQueue.pushBack(thiz->_requestSentinel); thiz->_requestQueueMutex.unlock(); - + thiz->_sleepCondition.notify_one(); thiz->decreaseThreadCountAndMayDeleteThis(); - + CCLOG("HttpClient::destroyInstance() finished!"); } @@ -353,7 +348,7 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque _cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt"); } _cookieFileMutex.unlock(); - + if (nullptr == _cookie) { _cookie = new(std::nothrow)HttpCookie; @@ -361,7 +356,7 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque _cookie->setCookieFileName(_cookieFilename); _cookie->readFile(); } - + void HttpClient::setSSLVerification(const std::string& caFile) { std::lock_guard lock(_sslCaFileMutex); @@ -376,17 +371,16 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque , _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() { - CC_SAFE_DELETE(_requestSentinel); + CC_SAFE_RELEASE(_requestSentinel); if (!_cookieFilename.empty() && nullptr != _cookie) { _cookie->writeFile(); @@ -408,29 +402,29 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque t.detach(); _isInited = true; } - + return true; } //Add a get task to queue void HttpClient::send(HttpRequest* request) -{ - if (false == lazyInitThreadSemphore()) +{ + if (false == lazyInitThreadSemphore()) { return; } - + if (!request) { return; } - + request->retain(); - + _requestQueueMutex.lock(); _requestQueue.pushBack(request); _requestQueueMutex.unlock(); - + // Notify thread start to work _sleepCondition.notify_one(); } @@ -463,7 +457,7 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque _responseQueue.erase(0); } _responseQueueMutex.unlock(); - + if (response) { HttpRequest *request = response->getHttpRequest(); @@ -479,13 +473,13 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque { (pTarget->*pSelector)(this, response); } - + response->release(); // do not release in other thread request->release(); } } - + // Process Response void HttpClient::processResponse(HttpResponse* response, char* responseMessage) { @@ -493,31 +487,31 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque 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, @@ -525,11 +519,11 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque &responseCode, response->getResponseHeader(), responseMessage); - + // write data to HttpResponse response->setResponseCode(responseCode); - - if (retValue != 0) + + if (retValue != 0) { response->setSucceed(true); } @@ -540,7 +534,7 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque } } - + void HttpClient::increaseThreadCount() { _threadCountMutex.lock(); @@ -557,55 +551,53 @@ static int processTask(HttpClient* client, HttpRequest* request, NSString* reque { 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 #endif // #if CC_TARGET_PLATFORM == CC_PLATFORM_MAC - - diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index c124e70829c8..d6d4fd6d67f4 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -411,7 +411,7 @@ HttpClient::HttpClient() HttpClient::~HttpClient() { - CC_SAFE_DELETE(_requestSentinel); + CC_SAFE_RELEASE(_requestSentinel); CCLOG("HttpClient destructor"); } diff --git a/cocos/network/HttpClient.h b/cocos/network/HttpClient.h index f1ef7a721194..b59ef81f71df 100644 --- a/cocos/network/HttpClient.h +++ b/cocos/network/HttpClient.h @@ -1,20 +1,20 @@ /**************************************************************************** Copyright (c) 2012 greathqy Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - + Copyright (c) 2013-2016 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 @@ -43,7 +43,7 @@ NS_CC_BEGIN namespace network { - + /** Singleton that handles asynchronous http requests. @@ -55,10 +55,10 @@ namespace network { class CC_DLL HttpClient { public: - /** - * The buffer size of _responseMessage - */ - static const int RESPONSE_BUFFER_SIZE = 256; + /** + * The buffer size of _responseMessage + */ + static const int RESPONSE_BUFFER_SIZE = 256; /** * Get instance of HttpClient. @@ -66,40 +66,40 @@ class CC_DLL HttpClient * @return the instance of HttpClient. */ static HttpClient *getInstance(); - - /** - * Release the instance of HttpClient. + + /** + * Release the instance of HttpClient. */ static void destroyInstance(); - /** + /** * Enable cookie support. * * @param cookieFile the filepath of cookie file. */ 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 the ssl CA filename - * + * * @return the ssl CA filename */ const std::string& getSSLVerification(); - + /** * Add a get request to task queue * @@ -115,21 +115,21 @@ class CC_DLL HttpClient 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. */ void setTimeoutForConnect(int value); - + /** * Get the timeout value for connecting. * * @return int the timeout value for connecting. */ int getTimeoutForConnect(); - + /** * Set the timeout value for reading. * @@ -143,17 +143,17 @@ class CC_DLL HttpClient * @return int the timeout value for reading. */ int getTimeoutForRead(); - + HttpCookie* getCookie() const {return _cookie; } - + std::mutex& getCookieFileMutex() {return _cookieFileMutex;} - + std::mutex& getSSLCaFileMutex() {return _sslCaFileMutex;} private: HttpClient(); virtual ~HttpClient(); - bool init(void); - + bool init(); + /** * Init pthread mutex, semaphore, and create new thread for http requests * @return bool @@ -163,44 +163,44 @@ class CC_DLL HttpClient void networkThreadAlone(HttpRequest* request, HttpResponse* response); /** 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]; - + + char _responseMessage[RESPONSE_BUFFER_SIZE]; + HttpRequest* _requestSentinel; }; @@ -212,3 +212,4 @@ NS_CC_END /// @} #endif //__CCHTTPCLIENT_H__ + diff --git a/cocos/network/HttpConnection-winrt.cpp b/cocos/network/HttpConnection-winrt.cpp index 6e344cc0bc2e..d7fcd81ef366 100644 --- a/cocos/network/HttpConnection-winrt.cpp +++ b/cocos/network/HttpConnection-winrt.cpp @@ -53,7 +53,7 @@ namespace network { } // Get user authentication token (Platform specific approach) - static bool getAuthenticationToken(std::string verb, std::string url, std::string headersXST, std::string bodyXST, std::string& token, std::string& signature) + static bool getAuthenticationToken(const std::string& verb, const std::string& url, const std::string& headersXST, const std::string& bodyXST, std::string& token, std::string& signature) { #if defined(_XBOX_ONE) using namespace Windows::Xbox::System; @@ -565,22 +565,22 @@ namespace network { return _isInitialized = SUCCEEDED(hr); } - bool HttpConnection::open(std::string verb) + bool HttpConnection::open(const std::string& verb) { return open(verb, false, ""); } - bool HttpConnection::open(std::string verb, bool userAuthentication) + bool HttpConnection::open(const std::string& verb, bool userAuthentication) { return open(verb, userAuthentication, ""); } - bool HttpConnection::open(std::string verb, std::string cookieFile) + bool HttpConnection::open(const std::string& verb, const std::string& cookieFile) { return open(verb, false, cookieFile); } - bool HttpConnection::open(std::string verb, bool userAuthentication, std::string cookieFile) + bool HttpConnection::open(const std::string& verb, bool userAuthentication, const std::string& cookieFile) { if (!_isInitialized) { return false; @@ -629,7 +629,7 @@ namespace network { return SUCCEEDED(hr); } - HRESULT HttpConnection::authenticateUser(std::string& verb, std::string& url, std::string& headers) + HRESULT HttpConnection::authenticateUser(const std::string& verb, const std::string& url, const std::string& headers) { HRESULT hr = S_OK; std::string authToken; @@ -654,7 +654,7 @@ namespace network { return hr; } - HRESULT HttpConnection::processCookieFile(std::string& url, std::string& cookieFile) + HRESULT HttpConnection::processCookieFile(const std::string& url, const std::string& cookieFile) { HRESULT hr = S_OK; diff --git a/cocos/network/HttpConnection-winrt.h b/cocos/network/HttpConnection-winrt.h index 0cfe480cb295..e211ad883ab3 100644 --- a/cocos/network/HttpConnection-winrt.h +++ b/cocos/network/HttpConnection-winrt.h @@ -132,10 +132,10 @@ namespace network { ~HttpConnection(); bool init(HttpRequest *pRequest, DWORD timeOutInMs = 0); - bool open(std::string verb); - bool open(std::string verb, bool userAuthentication); - bool open(std::string verb, std::string cookieFile); - bool open(std::string verb, bool userAuthentication, std::string cookieFile); + bool open(const std::string& verb); + bool open(const std::string& verb, bool userAuthentication); + bool open(const std::string& verb, const std::string& cookieFile); + bool open(const std::string& verb, bool userAuthentication, const std::string& cookieFile); bool send(); DWORD getStatusCode(); std::string getErrorMessage(); @@ -144,8 +144,8 @@ namespace network { protected: void cancelRequest(HRESULT hrError); - HRESULT authenticateUser(std::string& verb, std::string& url, std::string& headers); - HRESULT processCookieFile(std::string& url, std::string& cookieFile); + HRESULT authenticateUser(const std::string& verb, const std::string& url, const std::string& headers); + HRESULT processCookieFile(const std::string& url, const std::string& cookieFile); private: bool _isInitialized; diff --git a/cocos/network/HttpCookie.cpp b/cocos/network/HttpCookie.cpp index c293819daa34..3c8b60704c05 100644 --- a/cocos/network/HttpCookie.cpp +++ b/cocos/network/HttpCookie.cpp @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - + Copyright (c) 2013-2016 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 @@ -30,48 +30,48 @@ void HttpCookie::readFile() { std::string inString = cocos2d::FileUtils::getInstance()->getStringFromFile(_cookieFileName); - if(inString.length() != 0) + if(!inString.empty()) { std::vector cookiesVec; cookiesVec.clear(); - + std::stringstream stream(inString); std::string item; while(std::getline(stream, item, '\n')) { cookiesVec.push_back(item); } - + if(cookiesVec.empty()) return; - + _cookies.clear(); - + for(auto iter = cookiesVec.begin();iter != cookiesVec.end(); iter++) { std::string cookie = *iter; - + if(cookie.length() == 0) continue; - + if(cookie.find("#HttpOnly_") != std::string::npos) { cookie = cookie.substr(10); } - + if(cookie.at(0) == '#') continue; - + CookiesInfo co; std::stringstream streamInfo(cookie); std::vector elems; std::string elemsItem; - + while (std::getline(streamInfo, elemsItem, '\t')) { elems.push_back(elemsItem); } - + co.domain = elems[0]; if (co.domain.at(0) == '.') { @@ -100,7 +100,7 @@ const CookiesInfo* HttpCookie::getMatchCookie(const std::string& url) const if(url.find(iter->domain) != std::string::npos) return &(*iter); } - + return nullptr; } @@ -126,7 +126,7 @@ void HttpCookie::writeFile() "# This file was generated by cocos2d-x! Edit at your own risk.\n" "# Test cocos2d-x cookie write.\n\n", out); - + std::string line; for(auto iter = _cookies.begin(); iter != _cookies.end(); iter++) { @@ -145,14 +145,15 @@ void HttpCookie::writeFile() line.append(1, '\t'); line.append(iter->value); //line.append(1, '\n'); - + fprintf(out, "%s\n", line.c_str()); } - + fclose(out); } -void HttpCookie::setCookieFileName(std::string filename) +void HttpCookie::setCookieFileName(const std::string& filename) { _cookieFileName = filename; } + diff --git a/cocos/network/HttpCookie.h b/cocos/network/HttpCookie.h index 9dbae315da53..87cc9820cca0 100644 --- a/cocos/network/HttpCookie.h +++ b/cocos/network/HttpCookie.h @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2013-2015 Chukong Technologies Inc. - + Copyright (c) 2013-2016 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 @@ -26,9 +26,6 @@ #define HTTP_COOKIE_H /// @cond DO_NOT_SHOW -#include -#include - struct CookiesInfo { std::string domain; @@ -44,14 +41,14 @@ class HttpCookie { public: void readFile(); - + void writeFile(); - void setCookieFileName(const std::string fileName); - + void setCookieFileName(const std::string& fileName); + const std::vector* getCookies()const; const CookiesInfo* getMatchCookie(const std::string& url) const; void updateOrAddCookie(CookiesInfo* cookie); - + private: std::string _cookieFileName; std::vector _cookies; @@ -59,3 +56,4 @@ class HttpCookie /// @endcond #endif /* HTTP_COOKIE_H */ + diff --git a/cocos/network/HttpRequest.h b/cocos/network/HttpRequest.h index ab61ff927a88..5d3d12fe05f7 100644 --- a/cocos/network/HttpRequest.h +++ b/cocos/network/HttpRequest.h @@ -1,19 +1,19 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - + Copyright (c) 2013-2016 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 @@ -47,7 +47,7 @@ typedef std::function ccHttpRe typedef void (cocos2d::Ref::*SEL_HttpResponse)(HttpClient* client, HttpResponse* response); #define httpresponse_selector(_SELECTOR) (cocos2d::network::SEL_HttpResponse)(&_SELECTOR) -/** +/** * Defines the object which users must packed for HttpClient::send(HttpRequest*) method. * Please refer to tests/test-cpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample * @since v2.0.2 @@ -75,8 +75,8 @@ class CC_DLL HttpRequest : public Ref DELETE, UNKNOWN, }; - - /** + + /** * Constructor. * Because HttpRequest object will be used between UI thread and network thread, requestObj->autorelease() is forbidden to avoid crashes in AutoreleasePool @@ -91,7 +91,7 @@ class CC_DLL HttpRequest : public Ref , _pUserData(nullptr) { } - + /** Destructor. */ virtual ~HttpRequest() { @@ -100,8 +100,8 @@ class CC_DLL HttpRequest : public Ref _pTarget->release(); } } - - /** + + /** * Override autorelease method to avoid developers to call it. * If this function was called, it would trigger assert in debug mode * @@ -113,10 +113,10 @@ class CC_DLL HttpRequest : public Ref therefore, autorelease is forbidden here"); return nullptr; } - + // setter/getters for properties - - /** + + /** * Set request type of HttpRequest object before being sent,now it support the enum value of HttpRequest::Type. * * @param type the request type. @@ -125,7 +125,8 @@ class CC_DLL HttpRequest : public Ref { _requestType = type; } - /** + + /** * Get the request type of HttpRequest object. * * @return HttpRequest::Type. @@ -134,8 +135,8 @@ class CC_DLL HttpRequest : public Ref { return _requestType; } - - /** + + /** * Set the url address of HttpRequest object. * The url value could be like these: "http://httpbin.org/ip" or "https://httpbin.org/get" * @@ -145,7 +146,8 @@ class CC_DLL HttpRequest : public Ref { _url = url; } - /** + + /** * Get the url address of HttpRequest object. * * @return const char* the pointer of _url. @@ -154,8 +156,8 @@ class CC_DLL HttpRequest : public Ref { return _url.c_str(); } - - /** + + /** * Set the request data of HttpRequest object. * * @param buffer the buffer of request data, it support binary data. @@ -165,19 +167,21 @@ class CC_DLL HttpRequest : public Ref { _requestData.assign(buffer, buffer + len); } - /** + + /** * Get the request data pointer of HttpRequest object. * * @return char* the request data pointer. */ inline char* getRequestData() { - if (!_requestData.empty()) { + if(!_requestData.empty()) return _requestData.data(); - } + return nullptr; } - /** + + /** * Get the size of request data * * @return ssize_t the size of request data @@ -186,8 +190,8 @@ class CC_DLL HttpRequest : public Ref { return _requestData.size(); } - - /** + + /** * Set a string tag to identify your request. * This tag can be found in HttpResponse->getHttpRequest->getTag(). * @@ -197,7 +201,8 @@ class CC_DLL HttpRequest : public Ref { _tag = tag; } - /** + + /** * Get the string tag to identify the request. * The best practice is to use it in your MyClass::onMyHttpRequestCompleted(sender, HttpResponse*) callback. * @@ -207,7 +212,7 @@ class CC_DLL HttpRequest : public Ref { return _tag.c_str(); } - + /** * Set user-customed data of HttpRequest object. * You can attach a customed data in each request, and get it back in response callback. @@ -219,16 +224,17 @@ class CC_DLL HttpRequest : public Ref { _pUserData = pUserData; } - /** + + /** * Get the user-customed data pointer which were pre-setted. * Don't forget to delete it. HttpClient/HttpResponse/HttpRequest will do nothing with this pointer. * * @return void* the pointer of user-customed data. */ - inline void* getUserData() + inline void* getUserData() const { return _pUserData; - } + }; /** * Set the target and related callback selector. @@ -269,14 +275,14 @@ class CC_DLL HttpRequest : public Ref * * @return Ref* the target of callback selector function */ - inline Ref* getTarget() + inline Ref* getTarget() const { return _pTarget; } /** * This sub class is just for migration SEL_CallFuncND to SEL_HttpResponse,someday this way will be removed. - * + * * @lua NA */ class _prxy @@ -292,8 +298,8 @@ class CC_DLL HttpRequest : public Ref protected: SEL_HttpResponse _cb; }; - - /** + + /** * Get _prxy object by the _pSelector. * * @return _prxy the _prxy object @@ -302,7 +308,7 @@ class CC_DLL HttpRequest : public Ref { return _prxy(_pSelector); } - + /** * Get ccHttpRequestCallback callback function. * @@ -312,18 +318,18 @@ class CC_DLL HttpRequest : public Ref { return _pCallback; } - - /** + + /** * Set custom-defined headers. * * @param pHeaders the string vector of custom-defined headers. */ - inline void setHeaders(std::vector pHeaders) - { - _headers = pHeaders; - } - - /** + inline void setHeaders(const std::vector& headers) + { + _headers = headers; + } + + /** * Get custom headers. * * @return std::vector the string vector of custom-defined headers. @@ -332,7 +338,7 @@ class CC_DLL HttpRequest : public Ref { return _headers; } - + private: inline void doSetResponseCallback(Ref* pTarget, SEL_HttpResponse pSelector) { @@ -358,8 +364,8 @@ class CC_DLL HttpRequest : public Ref Ref* _pTarget; /// callback target of pSelector function SEL_HttpResponse _pSelector; /// callback function, e.g. MyLayer::onHttpResponse(HttpClient *sender, HttpResponse * response) ccHttpRequestCallback _pCallback; /// C++11 style callbacks - void* _pUserData; /// You can add your customed data here - std::vector _headers; /// custom http headers + void* _pUserData; /// You can add your customed data here + std::vector _headers; /// custom http headers }; } @@ -370,3 +376,4 @@ NS_CC_END /// @} #endif //__HTTP_REQUEST_H__ + diff --git a/cocos/network/HttpResponse.h b/cocos/network/HttpResponse.h index 63db5ac715a5..2eeff51fe937 100644 --- a/cocos/network/HttpResponse.h +++ b/cocos/network/HttpResponse.h @@ -1,19 +1,19 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - + Copyright (c) 2013-2016 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 @@ -37,7 +37,7 @@ NS_CC_BEGIN namespace network { -/** +/** * @brief defines the object which users will receive at onHttpCompleted(sender, HttpResponse) callback. * Please refer to samples/TestCpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample. * @since v2.0.2. @@ -46,21 +46,22 @@ namespace network { class CC_DLL HttpResponse : public cocos2d::Ref { public: - /** + /** * Constructor, it's used by HttpClient internal, users don't need to create HttpResponse manually. * @param request the corresponding HttpRequest which leads to this response. */ HttpResponse(HttpRequest* request) : _pHttpRequest(request) , _succeed(false) + , _responseDataString("") { if (_pHttpRequest) { _pHttpRequest->retain(); } } - - /** + + /** * Destructor, it will be called in HttpClient internal. * Users don't need to destruct HttpResponse object manually. */ @@ -71,8 +72,8 @@ class CC_DLL HttpResponse : public cocos2d::Ref _pHttpRequest->release(); } } - - /** + + /** * Override autorelease method to prevent developers from calling it. * If this method is called , it would trigger CCASSERT. * @return cocos2d::Ref* always return nullptr. @@ -83,20 +84,20 @@ class CC_DLL HttpResponse : public cocos2d::Ref therefore, autorelease is forbidden here"); return nullptr; } - + // getters, will be called by users - - /** + + /** * Get the corresponding HttpRequest object which leads to this response. * There's no paired setter for it, because it's already setted in class constructor * @return HttpRequest* the corresponding HttpRequest object which leads to this response. */ - inline HttpRequest* getHttpRequest() + inline HttpRequest* getHttpRequest() const { return _pHttpRequest; } - - /** + + /** * To see if the http request is returned successfully. * Although users can judge if (http response code = 200), we want an easier way. * If this getter returns false, you can call getResponseCode and getErrorBuffer to find more details. @@ -106,8 +107,8 @@ class CC_DLL HttpResponse : public cocos2d::Ref { return _succeed; } - - /** + + /** * Get the http response data. * @return std::vector* the pointer that point to the _responseData. */ @@ -115,7 +116,7 @@ class CC_DLL HttpResponse : public cocos2d::Ref { return &_responseData; } - + /** * Get the response headers. * @return std::vector* the pointer that point to the _responseHeader. @@ -125,7 +126,7 @@ class CC_DLL HttpResponse : public cocos2d::Ref return &_responseHeader; } - /** + /** * Get the http response code to judge whether response is successful or not. * I know that you want to see the _responseCode is 200. * If _responseCode is not 200, you should check the meaning for _responseCode by the net. @@ -136,7 +137,7 @@ class CC_DLL HttpResponse : public cocos2d::Ref return _responseCode; } - /** + /** * Get the error buffer which will tell you more about the reason why http request failed. * @return const char* the pointer that point to _errorBuffer. */ @@ -144,12 +145,12 @@ class CC_DLL HttpResponse : public cocos2d::Ref { return _errorBuffer.c_str(); } - + // setters, will be called by HttpClient // users should avoid invoking these methods - - - /** + + + /** * Set whether the http request is returned successfully or not, * This setter is mainly used in HttpClient, users mustn't set it directly * @param value the flag represent whether the http request is successful or not. @@ -158,9 +159,8 @@ class CC_DLL HttpResponse : public cocos2d::Ref { _succeed = value; } - - - /** + + /** * Set the http response data buffer, it is used by HttpClient. * @param data the pointer point to the response data buffer. */ @@ -168,8 +168,8 @@ class CC_DLL HttpResponse : public cocos2d::Ref { _responseData = *data; } - - /** + + /** * Set the http response headers buffer, it is used by HttpClient. * @param data the pointer point to the response headers buffer. */ @@ -177,9 +177,9 @@ class CC_DLL HttpResponse : public cocos2d::Ref { _responseHeader = *data; } - - - /** + + + /** * Set the http response code. * @param value the http response code that represent whether the request is successful or not. */ @@ -187,9 +187,9 @@ class CC_DLL HttpResponse : public cocos2d::Ref { _responseCode = value; } - - - /** + + + /** * Set the error buffer which will tell you more the reason why http request failed. * @param value a string pointer that point to the reason. */ @@ -198,7 +198,7 @@ class CC_DLL HttpResponse : public cocos2d::Ref _errorBuffer.clear(); _errorBuffer.assign(value); } - + /** * Set the response data by the string pointer and the defined size. * @param value a string pointer that point to response data buffer. @@ -209,7 +209,7 @@ class CC_DLL HttpResponse : public cocos2d::Ref _responseDataString.clear(); _responseDataString.assign(value, n); } - + /** * Get the string pointer that point to the response data. * @return const char* the string pointer that point to the response data. @@ -218,19 +218,19 @@ class CC_DLL HttpResponse : public cocos2d::Ref { return _responseDataString.c_str(); } - + protected: bool initWithRequest(HttpRequest* request); - + // properties - HttpRequest* _pHttpRequest; /// the corresponding HttpRequest pointer who leads to this response + HttpRequest* _pHttpRequest; /// the corresponding HttpRequest pointer who leads to this response bool _succeed; /// to indicate if the http request is successful simply std::vector _responseData; /// the returned raw data. You can also dump it as a string std::vector _responseHeader; /// the returned raw header data. You can also dump it as a string long _responseCode; /// the status code returned from libcurl, e.g. 200, 404 std::string _errorBuffer; /// if _responseCode != 200, please read _errorBuffer to find the reason std::string _responseDataString; // the returned raw data. You can also dump it as a string - + }; } @@ -241,3 +241,4 @@ NS_CC_END /// @} #endif //__HTTP_RESPONSE_H__ + diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index 60f37a207c13..04c655d9fae3 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2015 Chris Hannon http://www.channon.us - Copyright (c) 2013-2015 Chukong Technologies Inc. + Copyright (c) 2013-2016 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -76,7 +76,7 @@ class SocketIOPacket std::vector getData()const{ return _args; }; virtual std::string stringify()const; - static SocketIOPacket * createPacketWithType(std::string type, SocketIOVersion version); + static SocketIOPacket * createPacketWithType(const std::string& type, SocketIOVersion version); static SocketIOPacket * createPacketWithTypeIndex(int type, SocketIOVersion version); protected: std::string _pId;//id message @@ -154,7 +154,7 @@ std::string SocketIOPacket::toString()const encoded << this->_separator; - if (_args.size() != 0) + if (!_args.empty()) { std::string ackpId = ""; // This is an acknowledgement packet, so, prepend the ack pid to the data @@ -171,7 +171,7 @@ std::string SocketIOPacket::toString()const int SocketIOPacket::typeAsNumber()const { std::string::size_type num = 0; - std::vector::const_iterator item = std::find(_types.begin(), _types.end(), _type); + auto item = std::find(_types.begin(), _types.end(), _type); if (item != _types.end()) { num = item - _types.begin(); @@ -251,7 +251,7 @@ SocketIOPacketV10x::SocketIOPacketV10x() int SocketIOPacketV10x::typeAsNumber()const { std::vector::size_type num = 0; - std::vector::const_iterator item = std::find(_typesMessage.begin(), _typesMessage.end(), _type); + auto item = std::find(_typesMessage.begin(), _typesMessage.end(), _type); if (item != _typesMessage.end()) {//it's a message num = item - _typesMessage.begin(); @@ -302,7 +302,7 @@ SocketIOPacketV10x::~SocketIOPacketV10x() _endpoint = ""; } -SocketIOPacket * SocketIOPacket::createPacketWithType(std::string type, SocketIOPacket::SocketIOVersion version) +SocketIOPacket * SocketIOPacket::createPacketWithType(const std::string& type, SocketIOPacket::SocketIOVersion version) { SocketIOPacket *ret; switch (version) @@ -355,7 +355,7 @@ class SIOClientImpl : public: SIOClientImpl(const std::string& host, int port); - virtual ~SIOClientImpl(void); + virtual ~SIOClientImpl(); static SIOClientImpl* create(const std::string& host, int port); @@ -681,19 +681,19 @@ void SIOClientImpl::send(const std::string& endpoint, const std::string& s) { switch (_version) { case SocketIOPacket::SocketIOVersion::V09x: - { - SocketIOPacket *packet = SocketIOPacket::createPacketWithType("message", _version); - packet->setEndpoint(endpoint); - packet->addData(s); - this->send(packet); - break; - } + { + SocketIOPacket *packet = SocketIOPacket::createPacketWithType("message", _version); + packet->setEndpoint(endpoint); + packet->addData(s); + this->send(packet); + break; + } case SocketIOPacket::SocketIOVersion::V10x: - { - this->emit(endpoint, "message", s); - break; - } - } + { + this->emit(endpoint, "message", s); + break; + } + } } void SIOClientImpl::send(SocketIOPacket *packet) @@ -935,7 +935,7 @@ void SIOClientImpl::onMessage(WebSocket* ws, const WebSocket::Data& data) std::string eventname = payload.substr(payloadFirstSlashPos + 1, payloadSecondSlashPos - payloadFirstSlashPos + 1); - + CCLOGINFO("event name %s between %i and %i", eventname.c_str(), payloadFirstSlashPos, payloadSecondSlashPos); @@ -988,7 +988,9 @@ void SIOClientImpl::onClose(WebSocket* ws) } // discard this client _connected = false; - Director::getInstance()->getScheduler()->unscheduleAllForTarget(this); + if (Director::getInstance()) + Director::getInstance()->getScheduler()->unscheduleAllForTarget(this); + SocketIO::getInstance()->removeSocket(_uri); } @@ -1013,7 +1015,7 @@ SIOClient::SIOClient(const std::string& host, int port, const std::string& path, } -SIOClient::~SIOClient(void) +SIOClient::~SIOClient() { if (_connected) { @@ -1100,7 +1102,7 @@ void SIOClient::fireEvent(const std::string& eventName, const std::string& data) CCLOGINFO("SIOClient::fireEvent no native event with name %s found", eventName.c_str()); } - + void SIOClient::setTag(const char* tag) { _tag = tag; @@ -1113,7 +1115,7 @@ SocketIO::SocketIO() { } -SocketIO::~SocketIO(void) +SocketIO::~SocketIO() { } @@ -1203,24 +1205,24 @@ SIOClient* SocketIO::connect(const std::string& uri, SocketIO::SIODelegate& dele socket->addClient(path, c); socket->connectToEndpoint(path); - }else{ - CCLOG("SocketIO: disconnect previous client"); - c->disconnect(); - - CCLOG("SocketIO: recreate a new socket, new client, connect"); - SIOClientImpl* newSocket = nullptr; - SIOClient *newC = nullptr; - - newSocket = SIOClientImpl::create(host, port); - - newC = new (std::nothrow) SIOClient(host, port, path, newSocket, delegate); - - newSocket->addClient(path, newC); - - newSocket->connect(); - - return newC; - } + } + else + { + CCLOG("SocketIO: disconnect previous client"); + c->disconnect(); + + CCLOG("SocketIO: recreate a new socket, new client, connect"); + SIOClientImpl* newSocket = nullptr; + SIOClient *newC = nullptr; + + newSocket = SIOClientImpl::create(host, port); + newC = new (std::nothrow) SIOClient(host, port, path, newSocket, delegate); + + newSocket->addClient(path, newC); + newSocket->connect(); + + return newC; + } } return c; @@ -1244,3 +1246,4 @@ void SocketIO::removeSocket(const std::string& uri) } NS_CC_END + diff --git a/cocos/network/SocketIO.h b/cocos/network/SocketIO.h index 98df9318d020..dc928d58d2c0 100644 --- a/cocos/network/SocketIO.h +++ b/cocos/network/SocketIO.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2015 Chris Hannon http://www.channon.us - Copyright (c) 2013-2015 Chukong Technologies Inc. + Copyright (c) 2013-2016 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 @@ -104,7 +104,7 @@ class CC_DLL SocketIO virtual ~SIODelegate() {} /** * This is kept for backwards compatibility, connect is now fired as a socket.io event "connect" - * + * * This function would be called when the related SIOClient object receive messages that mean it have connected to endpoint successfully. * * @param client the connected SIOClient object. @@ -165,7 +165,7 @@ class CC_DLL SocketIO private: SocketIO(); - virtual ~SocketIO(void); + virtual ~SocketIO(); static SocketIO *_inst; @@ -225,7 +225,7 @@ class CC_DLL SIOClient /** * Destructor of SIOClient class. */ - virtual ~SIOClient(void); + virtual ~SIOClient(); /** * Get the delegate for the client @@ -256,14 +256,14 @@ class CC_DLL SIOClient * @param e the callback function. */ void on(const std::string& eventName, SIOEvent e); - + /** * Set tag of SIOClient. * The tag is used to distinguish the various SIOClient objects. * @param tag string object. */ void setTag(const char* tag); - + /** * Get tag of SIOClient. * @return const char* the pointer point to the _tag. @@ -283,3 +283,4 @@ NS_CC_END /// @} #endif /* defined(__CC_JSB_SOCKETIO_H__) */ + diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index ca04db0530f1..257b00e0d7ff 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2016 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -570,13 +570,10 @@ void WebSocket::onSubThreadStarted() { "permessage-deflate", lws_extension_callback_pm_deflate, - // iOS doesn't support client_no_context_takeover extension in the current version, it will cause iOS connection fail - // It may be a bug of lib websocket iOS build -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + // client_no_context_takeover extension is not supported in the current version, it will cause connection fail + // It may be a bug of lib websocket build +// "permessage-deflate; client_no_context_takeover; client_max_window_bits" "permessage-deflate; client_max_window_bits" -#else - "permessage-deflate; client_no_context_takeover; client_max_window_bits" -#endif }, { "deflate-frame", @@ -814,7 +811,7 @@ void WebSocket::onClientReceivedData(void* in, ssize_t len) ssize_t frameSize = frameData->size(); - bool isBinary = lws_frame_is_binary(_wsInstance); + bool isBinary = (lws_frame_is_binary(_wsInstance) != 0); if (!isBinary) { diff --git a/cocos/network/WebSocket.h b/cocos/network/WebSocket.h index 4086c5451f3f..1bf0afaa4a40 100644 --- a/cocos/network/WebSocket.h +++ b/cocos/network/WebSocket.h @@ -200,7 +200,7 @@ class CC_DLL WebSocket * @brief Closes the connection to server asynchronously. * @note It's an asynchronous method, it just notifies websocket thread to exit and returns directly, * If using 'closeAsync' to close websocket connection, - * be carefull of not using destructed variables in the callback of 'onClose'. + * be careful of not using destructed variables in the callback of 'onClose'. */ void closeAsync(); diff --git a/cocos/physics/CCPhysicsBody.cpp b/cocos/physics/CCPhysicsBody.cpp index 3a41905e959e..6ffe1fc02e98 100644 --- a/cocos/physics/CCPhysicsBody.cpp +++ b/cocos/physics/CCPhysicsBody.cpp @@ -755,7 +755,7 @@ void PhysicsBody::setEnabled(bool enable) bool PhysicsBody::isResting() const { - return cpBodyIsSleeping(_cpBody); + return cpBodyIsSleeping(_cpBody) != cpFalse; } void PhysicsBody::setResting(bool rest) const @@ -773,12 +773,12 @@ void PhysicsBody::setResting(bool rest) const void PhysicsBody::update(float delta) { // damping compute - /*if (_isDamping && _dynamic && !isResting()) + if (_isDamping && _dynamic && !isResting()) { _cpBody->v.x *= cpfclamp(1.0f - delta * _linearDamping, 0.0f, 1.0f); _cpBody->v.y *= cpfclamp(1.0f - delta * _linearDamping, 0.0f, 1.0f); _cpBody->w *= cpfclamp(1.0f - delta * _angularDamping, 0.0f, 1.0f); - }*/ + } } void PhysicsBody::setCategoryBitmask(int bitmask) diff --git a/cocos/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp index f4c29242f7e0..6293a3e8701f 100644 --- a/cocos/physics/CCPhysicsWorld.cpp +++ b/cocos/physics/CCPhysicsWorld.cpp @@ -32,7 +32,6 @@ #include "physics/CCPhysicsShape.h" #include "physics/CCPhysicsContact.h" #include "physics/CCPhysicsJoint.h" -#include "physics/CCPhysicsContact.h" #include "physics/CCPhysicsHelper.h" #include "2d/CCDrawNode.h" diff --git a/cocos/physics3d/CCPhysics3DDebugDrawer.h b/cocos/physics3d/CCPhysics3DDebugDrawer.h index fcae14b648ab..a97b8c85d369 100644 --- a/cocos/physics3d/CCPhysics3DDebugDrawer.h +++ b/cocos/physics3d/CCPhysics3DDebugDrawer.h @@ -34,7 +34,6 @@ #if CC_USE_3D_PHYSICS #if (CC_ENABLE_BULLET_INTEGRATION) -#include "renderer/CCCustomCommand.h" #include "bullet/LinearMath/btIDebugDraw.h" NS_CC_BEGIN diff --git a/cocos/physics3d/CCPhysics3DObject.cpp b/cocos/physics3d/CCPhysics3DObject.cpp index 0134d41075c1..45ba53d61204 100644 --- a/cocos/physics3d/CCPhysics3DObject.cpp +++ b/cocos/physics3d/CCPhysics3DObject.cpp @@ -379,7 +379,7 @@ class btCollider : public btGhostObject ~btCollider(){}; ///this method is mainly for expert/internal use only. - virtual void addOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btBroadphaseProxy* thisProxy = 0) override + virtual void addOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btBroadphaseProxy* thisProxy = nullptr) override { btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btAssert(otherObject); @@ -395,7 +395,7 @@ class btCollider : public btGhostObject } ///this method is mainly for expert/internal use only. - virtual void removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btDispatcher* dispatcher, btBroadphaseProxy* thisProxy = 0) override + virtual void removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btDispatcher* dispatcher, btBroadphaseProxy* thisProxy = nullptr) override { btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject; btAssert(otherObject); diff --git a/cocos/platform/CCApplication.h b/cocos/platform/CCApplication.h index 27e3d499c0bb..21aa673d99f4 100644 --- a/cocos/platform/CCApplication.h +++ b/cocos/platform/CCApplication.h @@ -41,6 +41,8 @@ THE SOFTWARE. #include "platform/winrt/CCApplication.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "platform/linux/CCApplication-linux.h" +#elif CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN +#include "platform/tizen/CCApplication-tizen.h" #endif /// @endcond diff --git a/cocos/platform/CCApplicationProtocol.h b/cocos/platform/CCApplicationProtocol.h index 9ac60baa2b98..8c3532c0d394 100644 --- a/cocos/platform/CCApplicationProtocol.h +++ b/cocos/platform/CCApplicationProtocol.h @@ -46,18 +46,18 @@ class CC_DLL ApplicationProtocol */ enum class Platform { - OS_WINDOWS,/** Windows */ - OS_LINUX,/** Linux */ - OS_MAC,/** Mac*/ - OS_ANDROID,/** Android */ - OS_IPHONE,/** Iphone */ - OS_IPAD,/** Ipad */ - OS_BLACKBERRY,/** BLACKBERRY */ - OS_NACL,/** Nacl */ - OS_EMSCRIPTEN,/** Emscripten */ - OS_TIZEN,/** Tizen */ - OS_WINRT,/** Windows Store Applications */ - OS_WP8/** Windows Phone Applications */ + OS_WINDOWS, /**< Windows */ + OS_LINUX, /**< Linux */ + OS_MAC, /**< Mac OS X*/ + OS_ANDROID, /**< Android */ + OS_IPHONE, /**< iPhone */ + OS_IPAD, /**< iPad */ + OS_BLACKBERRY, /**< BlackBerry */ + OS_NACL, /**< Native Client in Chrome */ + OS_EMSCRIPTEN, /**< Emscripten */ + OS_TIZEN, /**< Tizen */ + OS_WINRT, /**< Windows Runtime Applications */ + OS_WP8 /**< Windows Phone 8 Applications */ }; /** diff --git a/cocos/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp index e02a9be27f82..01f008915d62 100644 --- a/cocos/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -31,7 +31,7 @@ THE SOFTWARE. #include "base/ccMacros.h" #include "base/CCDirector.h" #include "platform/CCSAXParser.h" -#include "base/ccUtils.h" +//#include "base/ccUtils.h" #include "tinyxml2.h" #ifdef MINIZIP_FROM_SYSTEM @@ -274,7 +274,7 @@ class DictMaker : public SAXDelegator else if (sName == "integer") _curArray->push_back(Value(atoi(_curValue.c_str()))); else - _curArray->push_back(Value(utils::atof(_curValue.c_str()))); + _curArray->push_back(Value(std::atof(_curValue.c_str()))); } else if (SAX_DICT == curState) { @@ -283,7 +283,7 @@ class DictMaker : public SAXDelegator else if (sName == "integer") (*_curDict)[_curKey] = Value(atoi(_curValue.c_str())); else - (*_curDict)[_curKey] = Value(utils::atof(_curValue.c_str())); + (*_curDict)[_curKey] = Value(std::atof(_curValue.c_str())); } _curValue.clear(); @@ -665,19 +665,13 @@ unsigned char* FileUtils::getFileData(const std::string& filename, const char* m CCASSERT(!filename.empty() && size != nullptr && mode != nullptr, "Invalid parameters."); (void)(mode); // mode is unused, as we do not support text mode any more... - *size = 0; - std::string s; - if (getContents(filename, &s) != Status::OK) - return nullptr; - - unsigned char * buffer = (unsigned char*)malloc(s.size()); - if (!buffer) + Data d; + if (getContents(filename, &d) != Status::OK) { + *size = 0; return nullptr; + } - memcpy(buffer, s.data(), s.size()); - *size = s.size(); - - return buffer; + return d.takeBuffer(size); } unsigned char* FileUtils::getFileDataFromZip(const std::string& zipFilePath, const std::string& filename, ssize_t *size) diff --git a/cocos/platform/CCGL.h b/cocos/platform/CCGL.h index 9c754d265902..a5ba7cfb2688 100644 --- a/cocos/platform/CCGL.h +++ b/cocos/platform/CCGL.h @@ -41,6 +41,8 @@ THE SOFTWARE. #include "platform/winrt/CCGL.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "platform/linux/CCGL-linux.h" +#elif CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN +#include "platform/tizen/CCGL-tizen.h" #endif /// @endcond diff --git a/cocos/platform/CCGLView.cpp b/cocos/platform/CCGLView.cpp index 99a3d66a3893..7148d3e9dee7 100644 --- a/cocos/platform/CCGLView.cpp +++ b/cocos/platform/CCGLView.cpp @@ -164,7 +164,7 @@ void GLView::updateDesignResolutionSize() auto director = Director::getInstance(); director->_winSizeInPoints = getDesignResolutionSize(); director->_isStatusLabelUpdated = true; - director->setGLDefaultValues(); + director->setProjection(director->getProjection()); } } diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 106c0e1f163d..ee977724c668 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -455,6 +455,7 @@ Texture2D::PixelFormat getDevicePixelFormat(Texture2D::PixelFormat format) ////////////////////////////////////////////////////////////////////////// // Implement Image ////////////////////////////////////////////////////////////////////////// +bool Image::PNG_PREMULTIPLIED_ALPHA_ENABLED = true; Image::Image() : _data(nullptr) @@ -843,7 +844,7 @@ bool Image::decodeWithWIC(const unsigned char *data, ssize_t dataLen) _dataLen = img.getImageDataSize(); - CCAssert(_dataLen > 0, "Image: Decompressed data length is invalid"); + CCASSERT(_dataLen > 0, "Image: Decompressed data length is invalid"); _data = new (std::nothrow) unsigned char[_dataLen]; bRet = (img.getImageData(_data, _dataLen) > 0); @@ -1024,7 +1025,7 @@ bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen) info_ptr = png_create_info_struct(png_ptr); CC_BREAK_IF(!info_ptr); -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA && CC_TARGET_PLATFORM != CC_PLATFORM_NACL) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA && CC_TARGET_PLATFORM != CC_PLATFORM_NACL && CC_TARGET_PLATFORM != CC_PLATFORM_TIZEN) CC_BREAK_IF(setjmp(png_jmpbuf(png_ptr))); #endif @@ -1124,7 +1125,7 @@ bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen) png_read_end(png_ptr, nullptr); // premultiplied alpha for RGBA8888 - if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) + if (PNG_PREMULTIPLIED_ALPHA_ENABLED && color_type == PNG_COLOR_TYPE_RGB_ALPHA) { premultipliedAlpha(); } @@ -1598,7 +1599,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) memcpy(_data, static_cast(data) + sizeof(PVRv3TexHeader) + header->metadataLength, _dataLen); _numberOfMipmaps = header->numberOfMipmaps; - CCAssert(_numberOfMipmaps < MIPMAP_MAX, "Image: Maximum number of mimpaps reached. Increase the CC_MIPMAP_MAX value"); + CCASSERT(_numberOfMipmaps < MIPMAP_MAX, "Image: Maximum number of mimpaps reached. Increase the CC_MIPMAP_MAX value"); for (int i = 0; i < _numberOfMipmaps; i++) { @@ -1686,7 +1687,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) } dataOffset += packetLength; - CCAssert(dataOffset <= _dataLen, "CCTexurePVR: Invalid length"); + CCASSERT(dataOffset <= _dataLen, "Image: Invalid length"); width = MAX(width >> 1, 1); @@ -2126,7 +2127,7 @@ bool Image::initWithWebpData(const unsigned char * data, ssize_t dataLen) _height = config.input.height; //we ask webp to give data with premultiplied alpha - _hasPremultipliedAlpha = config.input.has_alpha; + _hasPremultipliedAlpha = (config.input.has_alpha != 0); _dataLen = _width * _height * (config.input.has_alpha?4:3); _data = static_cast(malloc(_dataLen * sizeof(unsigned char))); @@ -2240,7 +2241,7 @@ bool Image::saveImageToPNG(const std::string& filePath, bool isToRGB) png_destroy_write_struct(&png_ptr, nullptr); break; } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA && CC_TARGET_PLATFORM != CC_PLATFORM_NACL) +#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA && CC_TARGET_PLATFORM != CC_PLATFORM_NACL && CC_TARGET_PLATFORM != CC_PLATFORM_TIZEN) if (setjmp(png_jmpbuf(png_ptr))) { fclose(fp); diff --git a/cocos/platform/CCImage.h b/cocos/platform/CCImage.h index 78056dc6b7c4..847c7d914100 100644 --- a/cocos/platform/CCImage.h +++ b/cocos/platform/CCImage.h @@ -100,6 +100,21 @@ class CC_DLL Image : public Ref UNKNOWN }; + /** + * Enables or disables premultiplied alpha for PNG files. + * + * @param enabled (default: true) + */ + static void setPNGPremultipliedAlphaEnabled(bool enabled) { PNG_PREMULTIPLIED_ALPHA_ENABLED = enabled; } + + /** treats (or not) PVR files as if they have alpha premultiplied. + Since it is impossible to know at runtime if the PVR images have the alpha channel premultiplied, it is + possible load them as if they have (or not) the alpha channel premultiplied. + + By default it is disabled. + */ + static void setPVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); + /** @brief Load the image from the specified path. @param path the absolute file path. @@ -144,15 +159,6 @@ class CC_DLL Image : public Ref @param isToRGB whether the image is saved as RGB format. */ bool saveToFile(const std::string &filename, bool isToRGB = true); - - - /** treats (or not) PVR files as if they have alpha premultiplied. - Since it is impossible to know at runtime if the PVR images have the alpha channel premultiplied, it is - possible load them as if they have (or not) the alpha channel premultiplied. - - By default it is disabled. - */ - static void setPVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); protected: #if CC_USE_WIC @@ -183,6 +189,10 @@ class CC_DLL Image : public Ref It's same as define but it respects namespaces */ static const int MIPMAP_MAX = 16; + /** + @brief Determine whether we premultiply alpha for png files. + */ + static bool PNG_PREMULTIPLIED_ALPHA_ENABLED; unsigned char *_data; ssize_t _dataLen; int _width; @@ -199,8 +209,8 @@ class CC_DLL Image : public Ref protected: // noncopyable - Image(const Image& rImg); - Image & operator=(const Image&); + Image(const Image& rImg); + Image& operator=(const Image&); /* @brief The same result as with initWithImageFile, but thread safe. It is caused by diff --git a/cocos/platform/CCPlatformConfig.h b/cocos/platform/CCPlatformConfig.h index ec38f27e1270..77cb78fc7d45 100644 --- a/cocos/platform/CCPlatformConfig.h +++ b/cocos/platform/CCPlatformConfig.h @@ -57,9 +57,9 @@ THE SOFTWARE. #define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN // Apple: Mac and iOS -#if defined(__APPLE__) && !defined(ANDROID) // execlude android for binding generator. +#if defined(__APPLE__) && !defined(ANDROID) // exclude android for binding generator. #include - #if TARGET_OS_IPHONE // TARGET_OS_IPHONE inlcudes TARGET_OS_IOS TARGET_OS_TV and TARGET_OS_WATCH. see TargetConditionals.h + #if TARGET_OS_IPHONE // TARGET_OS_IPHONE includes TARGET_OS_IOS TARGET_OS_TV and TARGET_OS_WATCH. see TargetConditionals.h #undef CC_TARGET_PLATFORM #define CC_TARGET_PLATFORM CC_PLATFORM_IOS #elif TARGET_OS_MAC diff --git a/cocos/platform/CCPlatformDefine.h b/cocos/platform/CCPlatformDefine.h index 786714eb0c8d..1f6fbec0f690 100644 --- a/cocos/platform/CCPlatformDefine.h +++ b/cocos/platform/CCPlatformDefine.h @@ -41,6 +41,8 @@ THE SOFTWARE. #include "platform/winrt/CCPlatformDefine-winrt.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "platform/linux/CCPlatformDefine-linux.h" +#elif CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN +#include "platform/tizen/CCPlatformDefine-tizen.h" #endif /// @endcond diff --git a/cocos/platform/CCStdC.h b/cocos/platform/CCStdC.h index f22fddff4b80..69ce64ad61ac 100644 --- a/cocos/platform/CCStdC.h +++ b/cocos/platform/CCStdC.h @@ -40,6 +40,8 @@ THE SOFTWARE. #include "platform/winrt/CCStdC.h" #elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "platform/linux/CCStdC-linux.h" +#elif CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN +#include "platform/tizen/CCStdC-tizen.h" #endif #endif /* __PLATFORM_CCSTDC_H__*/ diff --git a/cocos/platform/android/CCApplication-android.h b/cocos/platform/android/CCApplication-android.h index 3555255d0e47..b148ede256ef 100644 --- a/cocos/platform/android/CCApplication-android.h +++ b/cocos/platform/android/CCApplication-android.h @@ -51,7 +51,7 @@ class CC_DLL Application : public ApplicationProtocol @brief Callback by Director to limit FPS. @param interval The time, expressed in seconds, between current frame and next. */ - void setAnimationInterval(float interval); + void setAnimationInterval(float interval) override; /** @brief Run the message loop. @@ -71,18 +71,18 @@ class CC_DLL Application : public ApplicationProtocol @brief Get current language config @return Current language config */ - virtual LanguageType getCurrentLanguage(); + virtual LanguageType getCurrentLanguage() override; /** @brief Get current language iso 639-1 code @return Current language iso 639-1 code */ - virtual const char * getCurrentLanguageCode(); + virtual const char * getCurrentLanguageCode() override; /** @brief Get target platform */ - virtual Platform getTargetPlatform(); + virtual Platform getTargetPlatform() override; /** @brief Get application version. @@ -94,7 +94,7 @@ class CC_DLL Application : public ApplicationProtocol @param String with url to open. @return true if the resource located by the URL was successfully opened; otherwise false. */ - virtual bool openURL(const std::string &url); + virtual bool openURL(const std::string &url) override; /** @brief This function will be called when the application screen size is changed. diff --git a/cocos/platform/android/CCFileUtils-android.cpp b/cocos/platform/android/CCFileUtils-android.cpp index 5f4f3bdedd70..8023aa69133e 100644 --- a/cocos/platform/android/CCFileUtils-android.cpp +++ b/cocos/platform/android/CCFileUtils-android.cpp @@ -29,8 +29,10 @@ THE SOFTWARE. #include "platform/android/CCFileUtils-android.h" #include "platform/CCCommon.h" #include "platform/android/jni/JniHelper.h" +#include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" #include "android/asset_manager.h" #include "android/asset_manager_jni.h" +#include "base/ZipUtils.h" #include #include @@ -42,6 +44,7 @@ using namespace std; NS_CC_BEGIN AAssetManager* FileUtilsAndroid::assetmanager = nullptr; +ZipFile* FileUtilsAndroid::obbfile = nullptr; void FileUtilsAndroid::setassetmanager(AAssetManager* a) { if (nullptr == a) { @@ -57,7 +60,7 @@ FileUtils* FileUtils::getInstance() if (s_sharedFileUtils == nullptr) { s_sharedFileUtils = new FileUtilsAndroid(); - if(!s_sharedFileUtils->init()) + if (!s_sharedFileUtils->init()) { delete s_sharedFileUtils; s_sharedFileUtils = nullptr; @@ -73,11 +76,22 @@ FileUtilsAndroid::FileUtilsAndroid() FileUtilsAndroid::~FileUtilsAndroid() { + if (obbfile) + { + delete obbfile; + obbfile = nullptr; + } } bool FileUtilsAndroid::init() { _defaultResRootPath = "assets/"; + + std::string assetsPath(getApkPath()); + if (assetsPath.find("/obb/") != std::string::npos) + { + obbfile = new ZipFile(assetsPath); + } return FileUtils::init(); } @@ -149,9 +163,14 @@ bool FileUtilsAndroid::isFileExistInternal(const std::string& strFilePath) const const char* s = strFilePath.c_str(); // Found "assets/" at the beginning of the path and we don't want it - if (strFilePath.find(_defaultResRootPath) == 0) s += strlen("assets/"); - - if (FileUtilsAndroid::assetmanager) { + if (strFilePath.find(_defaultResRootPath) == 0) s += _defaultResRootPath.length(); + + if (obbfile && obbfile->fileExists(s)) + { + bFound = true; + } + else if (FileUtilsAndroid::assetmanager) + { AAsset* aa = AAssetManager_open(FileUtilsAndroid::assetmanager, s, AASSET_MODE_UNKNOWN); if (aa) { @@ -165,7 +184,7 @@ bool FileUtilsAndroid::isFileExistInternal(const std::string& strFilePath) const else { FILE *fp = fopen(strFilePath.c_str(), "r"); - if(fp) + if (fp) { bFound = true; fclose(fp); @@ -249,6 +268,12 @@ FileUtils::Status FileUtilsAndroid::getContents(const std::string& filename, Res } else { relativePath = fullPath; } + + if (obbfile) + { + if (obbfile->getFileData(relativePath, buffer)) + return FileUtils::Status::OK; + } if (nullptr == assetmanager) { LOGD("... FileUtilsAndroid::assetmanager is nullptr"); diff --git a/cocos/platform/android/CCFileUtils-android.h b/cocos/platform/android/CCFileUtils-android.h index 6d77713ee75d..023efb5af9d8 100644 --- a/cocos/platform/android/CCFileUtils-android.h +++ b/cocos/platform/android/CCFileUtils-android.h @@ -38,6 +38,8 @@ Copyright (c) 2013-2014 Chukong Technologies Inc. NS_CC_BEGIN +class ZipFile; + /** * @addtogroup platform * @{ @@ -57,6 +59,7 @@ class CC_DLL FileUtilsAndroid : public FileUtils static void setassetmanager(AAssetManager* a); static AAssetManager* getAssetManager() { return assetmanager; } + static ZipFile* getObbFile() { return obbfile; } /* override functions */ bool init() override; @@ -73,6 +76,7 @@ class CC_DLL FileUtilsAndroid : public FileUtils virtual bool isDirectoryExistInternal(const std::string& dirPath) const override; static AAssetManager* assetmanager; + static ZipFile* obbfile; }; // end of platform group diff --git a/cocos/platform/android/java/libs/com.android.vending.expansion.zipfile.jar b/cocos/platform/android/java/libs/com.android.vending.expansion.zipfile.jar new file mode 100644 index 000000000000..bbdeb8a5ee32 Binary files /dev/null and b/cocos/platform/android/java/libs/com.android.vending.expansion.zipfile.jar differ diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxDownloader.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxDownloader.java index 54e82618e6e5..8e620e26329b 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxDownloader.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxDownloader.java @@ -99,10 +99,7 @@ public void onStart() { @Override public void onFinish() { // onFinish called after onSuccess/onFailure - Runnable taskRunnable = _downloader.dequeue(); - if (taskRunnable != null) { - Cocos2dxHelper.getActivity().runOnUiThread(taskRunnable); - } + _downloader.runNextTaskIfExists(); } @Override @@ -173,6 +170,7 @@ public class Cocos2dxDownloader { private int _countOfMaxProcessingTasks; private HashMap _taskMap = new HashMap(); private Queue _taskQueue = new LinkedList(); + private int _runningTaskCount = 0; void onProgress(final int id, final long downloadBytes, final long downloadNow, final long downloadTotal) { DownloadTask task = (DownloadTask)_taskMap.get(id); @@ -277,12 +275,7 @@ public void run() { } } }; - if (downloader._taskQueue.size() < downloader._countOfMaxProcessingTasks) { - Cocos2dxHelper.getActivity().runOnUiThread(taskRunnable); - downloader._taskQueue.add(null); - } else { - downloader._taskQueue.add(taskRunnable); - } + downloader.enqueueTask(taskRunnable); } public static void cancelAllRequests(final Cocos2dxDownloader downloader) { @@ -304,14 +297,27 @@ public void run() { }); } - public Runnable dequeue() { - if (!_taskQueue.isEmpty() && _taskQueue.element() == null) { - _taskQueue.remove(); + + public void enqueueTask(Runnable taskRunnable) { + synchronized (_taskQueue) { + if (_runningTaskCount < _countOfMaxProcessingTasks) { + Cocos2dxHelper.getActivity().runOnUiThread(taskRunnable); + _runningTaskCount++; + } else { + _taskQueue.add(taskRunnable); + } } - if (!_taskQueue.isEmpty()) { - return _taskQueue.remove(); + } + + public void runNextTaskIfExists() { + synchronized (_taskQueue) { + Runnable taskRunnable = Cocos2dxDownloader.this._taskQueue.poll(); + if (taskRunnable != null) { + Cocos2dxHelper.getActivity().runOnUiThread(taskRunnable); + } else { + _runningTaskCount--; + } } - return null; } native void nativeOnProgress(int id, int taskId, long dl, long dlnow, long dltotal); diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBox.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBox.java index dcc27aafef2a..750ac3980ec0 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBox.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBox.java @@ -99,6 +99,11 @@ public class Cocos2dxEditBox extends EditText { */ private final int kEditBoxInputFlagInitialCapsAllCharacters = 4; + /** + * Lowercase all characters automatically. + */ + private final int kEditBoxInputFlagLowercaseAllCharacters = 5; + private final int kKeyboardReturnTypeDefault = 0; private final int kKeyboardReturnTypeDone = 1; private final int kKeyboardReturnTypeSend = 2; @@ -243,6 +248,9 @@ public void setInputFlag(int inputFlag) { case kEditBoxInputFlagInitialCapsAllCharacters: this.mInputFlagConstraints = InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS; break; + case kEditBoxInputFlagLowercaseAllCharacters: + this.mInputFlagConstraints = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; + break; default: break; } diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxHelper.java index 1651aa27c58c..1e20100cbde2 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxHelper.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxHelper.java @@ -28,6 +28,7 @@ of this software and associated documentation files (the "Software"), to deal import android.content.res.Resources; import android.graphics.Color; import android.graphics.Typeface; +import android.os.Looper; import android.text.Editable; import android.text.InputType; import android.text.TextWatcher; @@ -93,7 +94,7 @@ public void run() { final Cocos2dxEditBox editBox = new Cocos2dxEditBox(mCocos2dxActivity); editBox.setFocusable(true); editBox.setFocusableInTouchMode(true); - editBox.setInputFlag(4); //kEditBoxInputFlagInitialCapsAllCharacters + editBox.setInputFlag(5); //kEditBoxInputFlagLowercaseAllCharacters editBox.setInputMode(6); //kEditBoxInputModeSingleLine editBox.setReturnType(0); //kKeyboardReturnTypeDefault editBox.setHintTextColor(Color.GRAY); @@ -132,14 +133,17 @@ public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override - public void onTextChanged(final CharSequence s, int start, int before, int count) { + public void onTextChanged(CharSequence s, int start, int before, int count) { //The optimization can't be turn on due to unknown keyboard hide in some custom keyboard // mFrameLayout.setEnableForceDoLayout(false); + // Note that we must to copy a string to prevent string content is modified + // on UI thread while 's.toString' is invoked at the same time. + final String text = new String(s.toString()); mCocos2dxActivity.runOnGLThread(new Runnable() { @Override public void run() { - Cocos2dxEditBoxHelper.__editBoxEditingChanged(index, s.toString()); + Cocos2dxEditBoxHelper.__editBoxEditingChanged(index, text); } }); } @@ -168,10 +172,13 @@ public void run() { Log.d(TAG, "edit box get focus"); } else { editBox.setVisibility(View.GONE); + // Note that we must to copy a string to prevent string content is modified + // on UI thread while 's.toString' is invoked at the same time. + final String text = new String(editBox.getText().toString()); mCocos2dxActivity.runOnGLThread(new Runnable() { @Override public void run() { - Cocos2dxEditBoxHelper.__editBoxEditingDidEnd(index, editBox.getText().toString()); + Cocos2dxEditBoxHelper.__editBoxEditingDidEnd(index, text); } }); mFrameLayout.setEnableForceDoLayout(false); @@ -187,7 +194,7 @@ public boolean onKey(View v, int keyCode, KeyEvent event) { (keyCode == KeyEvent.KEYCODE_ENTER)) { //if editbox doesn't support multiline, just hide the keyboard if ((editBox.getInputType() & InputType.TYPE_TEXT_FLAG_MULTI_LINE) != InputType.TYPE_TEXT_FLAG_MULTI_LINE) { - Cocos2dxEditBoxHelper.closeKeyboard(index); + Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index); mCocos2dxActivity.getGLSurfaceView().requestFocus(); return true; } @@ -201,7 +208,7 @@ public boolean onKey(View v, int keyCode, KeyEvent event) { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { - Cocos2dxEditBoxHelper.closeKeyboard(index); + Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index); mCocos2dxActivity.getGLSurfaceView().requestFocus(); } return false; @@ -313,7 +320,7 @@ public void run() { Cocos2dxEditBoxHelper.openKeyboard(index); }else{ mCocos2dxActivity.getGLSurfaceView().requestFocus(); - Cocos2dxEditBoxHelper.closeKeyboard(index); + Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index); } } } @@ -393,7 +400,12 @@ public static void openKeyboard(int index) { } } - public static void closeKeyboard(int index) { + private static void closeKeyboardOnUiThread(int index) { + if (Looper.myLooper() != Looper.getMainLooper()) { + Log.e(TAG, "closeKeyboardOnUiThread doesn't run on UI thread!"); + return; + } + final InputMethodManager imm = (InputMethodManager) mCocos2dxActivity.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); Cocos2dxEditBox editBox = mEditBoxArray.get(index); if (null != editBox) { @@ -401,4 +413,14 @@ public static void closeKeyboard(int index) { mCocos2dxActivity.getGLSurfaceView().setSoftKeyboardShown(false); } } + + // Note that closeKeyboard will be invoked on GL thread + public static void closeKeyboard(final int index) { + mCocos2dxActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + closeKeyboardOnUiThread(index); + } + }); + } } diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index c14f953e59fe..6e1c07d7bf39 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -31,10 +31,14 @@ of this software and associated documentation files (the "Software"), to deal import android.content.ServiceConnection; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager.NameNotFoundException; +import android.content.res.AssetFileDescriptor; import android.content.res.AssetManager; import android.net.Uri; import android.os.Build; +import android.os.Environment; import android.os.IBinder; +import android.os.ParcelFileDescriptor; import android.os.Vibrator; import android.preference.PreferenceManager.OnActivityResultListener; import android.util.DisplayMetrics; @@ -43,9 +47,16 @@ of this software and associated documentation files (the "Software"), to deal import android.view.WindowManager; import android.hardware.SensorManager; +import com.android.vending.expansion.zipfile.APKExpansionSupport; +import com.android.vending.expansion.zipfile.ZipResourceFile; + import com.enhance.gameservice.IGameTuningService; +import java.io.IOException; +import java.io.File; import java.io.UnsupportedEncodingException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.LinkedHashSet; import java.util.Locale; import java.util.Map; @@ -58,6 +69,7 @@ public class Cocos2dxHelper { // =========================================================== private static final String PREFS_NAME = "Cocos2dxPrefsFile"; private static final int RUNNABLES_PER_FRAME = 5; + private static final String TAG = Cocos2dxHelper.class.getSimpleName(); // =========================================================== // Fields @@ -81,6 +93,12 @@ public class Cocos2dxHelper { private static final int BOOST_TIME = 7; //Enhance API modification end + // The absolute path to the OBB if it exists, else the absolute path to the APK. + private static String sAssetsPath = ""; + + // The OBB file + private static ZipResourceFile sOBBFile = null; + // =========================================================== // Constructors // =========================================================== @@ -95,11 +113,11 @@ public static void init(final Activity activity) { Cocos2dxHelper.sCocos2dxHelperListener = (Cocos2dxHelperListener)activity; if (!sInited) { final ApplicationInfo applicationInfo = activity.getApplicationInfo(); - + Cocos2dxHelper.sPackageName = applicationInfo.packageName; Cocos2dxHelper.sFileDirectory = activity.getFilesDir().getAbsolutePath(); - Cocos2dxHelper.nativeSetApkPath(applicationInfo.sourceDir); + Cocos2dxHelper.nativeSetApkPath(Cocos2dxHelper.getAssetsPath()); Cocos2dxHelper.sCocos2dxAccelerometer = new Cocos2dxAccelerometer(activity); Cocos2dxHelper.sCocos2dMusic = new Cocos2dxMusic(activity); @@ -118,7 +136,46 @@ public static void init(final Activity activity) { serviceIntent.setPackage("com.enhance.gameservice"); boolean suc = activity.getApplicationContext().bindService(serviceIntent, connection, Context.BIND_AUTO_CREATE); //Enhance API modification end + + int versionCode = 1; + try { + versionCode = Cocos2dxActivity.getContext().getPackageManager().getPackageInfo(Cocos2dxHelper.getCocos2dxPackageName(), 0).versionCode; + } catch (NameNotFoundException e) { + e.printStackTrace(); + } + try { + Cocos2dxHelper.sOBBFile = APKExpansionSupport.getAPKExpansionZipFile(Cocos2dxActivity.getContext(), versionCode, 0); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + // This function returns the absolute path to the OBB if it exists, + // else it returns the absolute path to the APK. + public static String getAssetsPath() + { + if (Cocos2dxHelper.sAssetsPath == "") { + int versionCode = 1; + try { + versionCode = Cocos2dxHelper.sActivity.getPackageManager().getPackageInfo(Cocos2dxHelper.sPackageName, 0).versionCode; + } catch (NameNotFoundException e) { + e.printStackTrace(); + } + String pathToOBB = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/obb/" + Cocos2dxHelper.sPackageName + "/main." + versionCode + "." + Cocos2dxHelper.sPackageName + ".obb"; + File obbFile = new File(pathToOBB); + if (obbFile.exists()) + Cocos2dxHelper.sAssetsPath = pathToOBB; + else + Cocos2dxHelper.sAssetsPath = Cocos2dxHelper.sActivity.getApplicationInfo().sourceDir; } + + return Cocos2dxHelper.sAssetsPath; + } + + public static ZipResourceFile getObbFile() + { + return Cocos2dxHelper.sOBBFile; } //Enhance API modification begin @@ -234,6 +291,29 @@ public static boolean openURL(String url) { } return ret; } + + public static long[] getObbAssetFileDescriptor(final String path) { + long[] array = new long[3]; + if (Cocos2dxHelper.sOBBFile != null) { + AssetFileDescriptor descriptor = Cocos2dxHelper.sOBBFile.getAssetFileDescriptor(path); + if (descriptor != null) { + try { + ParcelFileDescriptor parcel = descriptor.getParcelFileDescriptor(); + Method method = parcel.getClass().getMethod("getFd", new Class[] {}); + array[0] = (Integer)method.invoke(parcel); + array[1] = descriptor.getStartOffset(); + array[2] = descriptor.getLength(); + } catch (NoSuchMethodException e) { + Log.e(Cocos2dxHelper.TAG, "Accessing file descriptor directly from the OBB is only supported from Android 3.1 (API level 12) and above."); + } catch (IllegalAccessException e) { + Log.e(Cocos2dxHelper.TAG, e.toString()); + } catch (InvocationTargetException e) { + Log.e(Cocos2dxHelper.TAG, e.toString()); + } + } + } + return array; + } public static void preloadBackgroundMusic(final String pPath) { Cocos2dxHelper.sCocos2dMusic.preloadBackgroundMusic(pPath); diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java index d2dc8e7c0489..c10d01ca954d 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java @@ -56,7 +56,7 @@ public static boolean init(String dbName, String tableName) { return false; } - public static void destory() { + public static void destroy() { if (mDatabase != null) { mDatabase.close(); } @@ -89,7 +89,7 @@ public static String getItem(String key) { } catch (Exception e) { e.printStackTrace(); } - return ret == null ? "" : ret; + return ret; } public static void removeItem(String key) { diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java index 0e9f2e499f26..c0df028bf8c6 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java @@ -83,7 +83,7 @@ public void preloadBackgroundMusic(final String path) { this.mBackgroundMediaPlayer.release(); } - this.mBackgroundMediaPlayer = this.createMediaplayer(path); + this.mBackgroundMediaPlayer = this.createMediaPlayer(path); // record the path this.mCurrentPath = path; @@ -93,7 +93,7 @@ public void preloadBackgroundMusic(final String path) { public void playBackgroundMusic(final String path, final boolean isLoop) { if (mCurrentPath == null) { // it is the first time to play background music or end() was called - mBackgroundMediaPlayer = createMediaplayer(path); + mBackgroundMediaPlayer = createMediaPlayer(path); mCurrentPath = path; } else { if (!mCurrentPath.equals(path)) { @@ -103,7 +103,7 @@ public void playBackgroundMusic(final String path, final boolean isLoop) { if (mBackgroundMediaPlayer != null) { mBackgroundMediaPlayer.release(); } - mBackgroundMediaPlayer = createMediaplayer(path); + mBackgroundMediaPlayer = createMediaPlayer(path); // record the path mCurrentPath = path; @@ -134,9 +134,9 @@ public void playBackgroundMusic(final String path, final boolean isLoop) { public void stopBackgroundMusic() { if (this.mBackgroundMediaPlayer != null) { - mBackgroundMediaPlayer.release(); - mBackgroundMediaPlayer = createMediaplayer(mCurrentPath); - + mBackgroundMediaPlayer.release(); + mBackgroundMediaPlayer = createMediaPlayer(mCurrentPath); + /** * should set the state, if not, the following sequence will be error * play -> pause -> stop -> resume @@ -146,34 +146,45 @@ public void stopBackgroundMusic() { } public void pauseBackgroundMusic() { - if (this.mBackgroundMediaPlayer != null && this.mBackgroundMediaPlayer.isPlaying()) { - this.mBackgroundMediaPlayer.pause(); - this.mPaused = true; - this.mManualPaused = true; + try { + if (this.mBackgroundMediaPlayer != null && this.mBackgroundMediaPlayer.isPlaying()) { + this.mBackgroundMediaPlayer.pause(); + this.mPaused = true; + this.mManualPaused = true; + } + } catch (IllegalStateException e) { + Log.e(TAG, "pauseBackgroundMusic, IllegalStateException was triggered!"); } } public void resumeBackgroundMusic() { - if (this.mBackgroundMediaPlayer != null && this.mPaused) { - this.mBackgroundMediaPlayer.start(); - this.mPaused = false; - this.mManualPaused = false; + try { + if (this.mBackgroundMediaPlayer != null && this.mPaused) { + this.mBackgroundMediaPlayer.start(); + this.mPaused = false; + this.mManualPaused = false; + } + } catch (IllegalStateException e) { + Log.e(TAG, "resumeBackgroundMusic, IllegalStateException was triggered!"); } } public void rewindBackgroundMusic() { if (this.mBackgroundMediaPlayer != null) { - playBackgroundMusic(mCurrentPath, mIsLoop); + playBackgroundMusic(mCurrentPath, mIsLoop); } } public boolean isBackgroundMusicPlaying() { boolean ret = false; - - if (this.mBackgroundMediaPlayer == null) { - ret = false; - } else { - ret = this.mBackgroundMediaPlayer.isPlaying(); + try { + if (this.mBackgroundMediaPlayer == null) { + ret = false; + } else { + ret = this.mBackgroundMediaPlayer.isPlaying(); + } + } catch (IllegalStateException e) { + Log.e(TAG, "isBackgroundMusicPlaying, IllegalStateException was triggered!"); } return ret; @@ -211,18 +222,26 @@ public void setBackgroundVolume(float volume) { } public void onEnterBackground(){ - if (this.mBackgroundMediaPlayer != null && this.mBackgroundMediaPlayer.isPlaying()) { - this.mBackgroundMediaPlayer.pause(); - this.mPaused = true; + try { + if (this.mBackgroundMediaPlayer != null && this.mBackgroundMediaPlayer.isPlaying()) { + this.mBackgroundMediaPlayer.pause(); + this.mPaused = true; + } + } catch (IllegalStateException e) { + Log.e(TAG, "onEnterBackground, IllegalStateException was triggered!"); } } public void onEnterForeground(){ - if(!this.mManualPaused){ - if (this.mBackgroundMediaPlayer != null && this.mPaused) { - this.mBackgroundMediaPlayer.start(); - this.mPaused = false; + try { + if (!this.mManualPaused) { + if (this.mBackgroundMediaPlayer != null && this.mPaused) { + this.mBackgroundMediaPlayer.start(); + this.mPaused = false; + } } + } catch (IllegalStateException e) { + Log.e(TAG, "onEnterForeground, IllegalStateException was triggered!"); } } @@ -235,13 +254,12 @@ private void initData() { } /** - * create mediaplayer for music + * create MediaPlayer for music * - * @param pPath - * the pPath relative to assets + * @param path The path relative to assets * @return */ - private MediaPlayer createMediaplayer(final String path) { + private MediaPlayer createMediaPlayer(final String path) { MediaPlayer mediaPlayer = new MediaPlayer(); try { @@ -250,8 +268,13 @@ private MediaPlayer createMediaplayer(final String path) { mediaPlayer.setDataSource(fis.getFD()); fis.close(); } else { - final AssetFileDescriptor assetFileDescritor = this.mContext.getAssets().openFd(path); - mediaPlayer.setDataSource(assetFileDescritor.getFileDescriptor(), assetFileDescritor.getStartOffset(), assetFileDescritor.getLength()); + if (Cocos2dxHelper.getObbFile() != null) { + final AssetFileDescriptor assetFileDescriptor = Cocos2dxHelper.getObbFile().getAssetFileDescriptor(path); + mediaPlayer.setDataSource(assetFileDescriptor.getFileDescriptor(), assetFileDescriptor.getStartOffset(), assetFileDescriptor.getLength()); + } else { + final AssetFileDescriptor assetFileDescriptor = this.mContext.getAssets().openFd(path); + mediaPlayer.setDataSource(assetFileDescriptor.getFileDescriptor(), assetFileDescriptor.getStartOffset(), assetFileDescriptor.getLength()); + } } mediaPlayer.prepare(); diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java index a54317020d42..29e0a5d9409d 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java @@ -28,6 +28,7 @@ of this software and associated documentation files (the "Software"), to deal import android.media.AudioManager; import android.media.SoundPool; import android.util.Log; +import android.content.res.AssetFileDescriptor; import java.util.ArrayList; import java.util.HashMap; @@ -273,7 +274,12 @@ public int createSoundIDFromAsset(final String path) { if (path.startsWith("/")) { soundID = this.mSoundPool.load(path, 0); } else { - soundID = this.mSoundPool.load(this.mContext.getAssets().openFd(path), 0); + if (Cocos2dxHelper.getObbFile() != null) { + final AssetFileDescriptor assetFileDescriptor = Cocos2dxHelper.getObbFile().getAssetFileDescriptor(path); + soundID = mSoundPool.load(assetFileDescriptor, 0); + } else { + soundID = this.mSoundPool.load(this.mContext.getAssets().openFd(path), 0); + } } } catch (final Exception e) { soundID = Cocos2dxSound.INVALID_SOUND_ID; diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java index 3a2229746a9d..a592dd50f98a 100755 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java @@ -54,6 +54,7 @@ public Cocos2dxWebView(Context context, int viewTag) { this.getSettings().setSupportZoom(false); + this.getSettings().setDomStorageEnabled(true); this.getSettings().setJavaScriptEnabled(true); // `searchBoxJavaBridge_` has big security risk. http://jvn.jp/en/jp/JVN53768697 diff --git a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp index 6394a470d12d..391c07063fb5 100644 --- a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp @@ -87,6 +87,31 @@ std::string getPackageNameJNI() { return JniHelper::callStaticStringMethod(className, "getCocos2dxPackageName"); } +int getObbAssetFileDescriptorJNI(const char* path, long* startOffset, long* size) { + JniMethodInfo methodInfo; + int fd = 0; + + if (JniHelper::getStaticMethodInfo(methodInfo, className.c_str(), "getObbAssetFileDescriptor", "(Ljava/lang/String;)[J")) { + jstring stringArg = methodInfo.env->NewStringUTF(path); + jlongArray newArray = (jlongArray)methodInfo.env->CallStaticObjectMethod(methodInfo.classID, methodInfo.methodID, stringArg); + jsize theArrayLen = methodInfo.env->GetArrayLength(newArray); + + if (theArrayLen == 3) { + jboolean copy = JNI_FALSE; + jlong *array = methodInfo.env->GetLongArrayElements(newArray, ©); + fd = static_cast(array[0]); + *startOffset = array[1]; + *size = array[2]; + methodInfo.env->ReleaseLongArrayElements(newArray, array, 0); + } + + methodInfo.env->DeleteLocalRef(methodInfo.classID); + methodInfo.env->DeleteLocalRef(stringArg); + } + + return fd; +} + void conversionEncodingJNI(const char* src, int byteSize, const char* fromCharset, char* dst, const char* newCharset) { JniMethodInfo methodInfo; diff --git a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h index e32a8e79c98a..e545eca0328a 100644 --- a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h @@ -31,6 +31,7 @@ typedef void (*EditTextCallback)(const char* text, void* ctx); extern const char * getApkPath(); extern std::string getPackageNameJNI(); +extern int getObbAssetFileDescriptorJNI(const char* path, long* startOffset, long* size); extern void conversionEncodingJNI(const char* src, int byteSize, const char* fromCharset, char* dst, const char* newCharset); #endif /* __Java_org_cocos2dx_lib_Cocos2dxHelper_H__ */ diff --git a/cocos/platform/android/libcocos2dx/AndroidManifest.xml b/cocos/platform/android/libcocos2dx/AndroidManifest.xml index 46f24443b43c..bd550c554777 100644 --- a/cocos/platform/android/libcocos2dx/AndroidManifest.xml +++ b/cocos/platform/android/libcocos2dx/AndroidManifest.xml @@ -1,6 +1,6 @@ - + diff --git a/cocos/platform/apple/CCFileUtils-apple.h b/cocos/platform/apple/CCFileUtils-apple.h index 2aa75c24d5d0..0843163ec77b 100644 --- a/cocos/platform/apple/CCFileUtils-apple.h +++ b/cocos/platform/apple/CCFileUtils-apple.h @@ -46,6 +46,7 @@ class CC_DLL FileUtilsApple : public FileUtils { public: FileUtilsApple(); + virtual ~FileUtilsApple(); /* override functions */ virtual std::string getWritablePath() const override; virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename) const override; diff --git a/cocos/platform/apple/CCFileUtils-apple.mm b/cocos/platform/apple/CCFileUtils-apple.mm index 32ac2457dcb9..d415e21bb3c7 100644 --- a/cocos/platform/apple/CCFileUtils-apple.mm +++ b/cocos/platform/apple/CCFileUtils-apple.mm @@ -52,18 +52,75 @@ void setBundle(NSBundle* bundle) { NSBundle* bundle_; }; -static void addValueToDict(id nsKey, id nsValue, ValueMap& dict); -static void addObjectToNSDict(const std::string& key, const Value& value, NSMutableDictionary *dict); +static id convertCCValueToNSObject(const cocos2d::Value &value); +static cocos2d::Value convertNSObjectToCCValue(id object); -static void addItemToArray(id item, ValueVector& array) +static void addNSObjectToCCMap(id nsKey, id nsValue, ValueMap& dict); +static void addCCValueToNSDictionary(const std::string& key, const Value& value, NSMutableDictionary *dict); +static void addNSObjectToCCVector(id item, ValueVector& array); +static void addCCValueToNSArray(const Value& value, NSMutableArray *array); + +static id convertCCValueToNSObject(const cocos2d::Value &value) +{ + switch (value.getType()) + { + case Value::Type::NONE: + return [NSNull null]; + + case Value::Type::STRING: + return [NSString stringWithCString:value.asString().c_str() encoding:NSUTF8StringEncoding]; + + case Value::Type::BYTE: + return [NSNumber numberWithInt:value.asByte()]; + + case Value::Type::INTEGER: + return [NSNumber numberWithInt:value.asInt()]; + + case Value::Type::UNSIGNED: + return [NSNumber numberWithUnsignedInt:value.asUnsignedInt()]; + + case Value::Type::FLOAT: + return [NSNumber numberWithFloat:value.asFloat()]; + + case Value::Type::DOUBLE: + return [NSNumber numberWithDouble:value.asDouble()]; + + case Value::Type::BOOLEAN: + return [NSNumber numberWithBool:value.asBool()]; + + case Value::Type::VECTOR: { + NSMutableArray *array = [NSMutableArray array]; + const ValueVector &vector = value.asValueVector(); + for (const auto &e : vector) { + addCCValueToNSArray(e, array); + } + return array; + } + + case Value::Type::MAP: { + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + const ValueMap &map = value.asValueMap(); + for (auto iter = map.begin(); iter != map.end(); ++iter) { + addCCValueToNSDictionary(iter->first, iter->second, dictionary); + } + return dictionary; + } + + case Value::Type::INT_KEY_MAP: + break; + } + + return [NSNull null]; +} + +static cocos2d::Value convertNSObjectToCCValue(id item) { // add string value into array if ([item isKindOfClass:[NSString class]]) { - array.push_back(Value([item UTF8String])); - return; + return Value([item UTF8String]); } - + // add number value into array(such as int, float, bool and so on) // the value is a number if ([item isKindOfClass:[NSNumber class]]) @@ -73,23 +130,23 @@ static void addItemToArray(id item, ValueVector& array) if(num == (void*)kCFBooleanFalse || num == (void*)kCFBooleanTrue) { bool v = [num boolValue]; - array.push_back(Value(v)); + return Value(v); } else if(strcmp(numType, @encode(float)) == 0) { - array.push_back(Value([num floatValue])); + return Value([num floatValue]); } else if(strcmp(numType, @encode(double)) == 0) { - array.push_back(Value([num doubleValue])); + return Value([num doubleValue]); } - else{ - array.push_back(Value([num intValue])); + else + { + return Value([num intValue]); } - return; } - - + + // add dictionary value into array if ([item isKindOfClass:[NSDictionary class]]) { @@ -97,229 +154,56 @@ static void addItemToArray(id item, ValueVector& array) for (id subKey in [item allKeys]) { id subValue = [item objectForKey:subKey]; - addValueToDict(subKey, subValue, dict); + addNSObjectToCCMap(subKey, subValue, dict); } - - array.push_back(Value(dict)); - return; + + return Value(dict); } - + // add array value into array if ([item isKindOfClass:[NSArray class]]) { ValueVector subArray; for (id subItem in item) { - addItemToArray(subItem, subArray); + addNSObjectToCCVector(subItem, subArray); } - array.push_back(Value(subArray)); - return; + return Value(subArray); } + + return Value::Null; } -static void addObjectToNSArray(const Value& value, NSMutableArray *array) +static void addNSObjectToCCVector(id item, ValueVector& array) { - // add string into array - if (value.getType() == Value::Type::STRING) - { - NSString *element = [NSString stringWithCString:value.asString().c_str() encoding:NSUTF8StringEncoding]; - [array addObject:element]; - return; - } - - //add float into array - if (value.getType() == Value::Type::FLOAT) { - NSNumber *number = [NSNumber numberWithFloat:value.asFloat()]; - [array addObject:number]; - } - - //add double into array - if (value.getType() == Value::Type::DOUBLE) { - NSNumber *number = [NSNumber numberWithDouble:value.asDouble()]; - [array addObject:number]; - } - - //add boolean into array - if (value.getType() == Value::Type::BOOLEAN) { - NSNumber *element = [NSNumber numberWithBool:value.asBool()]; - [array addObject:element]; - } - - if (value.getType() == Value::Type::INTEGER) { - NSNumber *element = [NSNumber numberWithInt:value.asInt()]; - [array addObject:element]; - } - - //todo: add date and data support - - // add array into array - if (value.getType() == Value::Type::VECTOR) - { - NSMutableArray *element = [NSMutableArray array]; - - ValueVector valueArray = value.asValueVector(); - - for (const auto &e : valueArray) - { - addObjectToNSArray(e, element); - } - - [array addObject:element]; - return; - } - - // add dictionary value into array - if (value.getType() == Value::Type::MAP) - { - NSMutableDictionary *element = [NSMutableDictionary dictionary]; - - auto valueDict = value.asValueMap(); - for (auto iter = valueDict.begin(); iter != valueDict.end(); ++iter) - { - addObjectToNSDict(iter->first, iter->second, element); - } + array.push_back(convertNSObjectToCCValue(item)); +} - [array addObject:element]; - } +static void addCCValueToNSArray(const Value& value, NSMutableArray *array) +{ + [array addObject:convertCCValueToNSObject(value)]; } -static void addValueToDict(id nsKey, id nsValue, ValueMap& dict) +static void addNSObjectToCCMap(id nsKey, id nsValue, ValueMap& dict) { // the key must be a string CCASSERT([nsKey isKindOfClass:[NSString class]], "The key should be a string!"); std::string key = [nsKey UTF8String]; - - // the value is a string - if ([nsValue isKindOfClass:[NSString class]]) - { - dict[key] = Value([nsValue UTF8String]); - return; - } - - // the value is a number - if ([nsValue isKindOfClass:[NSNumber class]]) - { - NSNumber* num = nsValue; - const char* numType = [num objCType]; - if(num == (void*)kCFBooleanFalse || num == (void*)kCFBooleanTrue) - { - bool v = [num boolValue]; - dict[key] = Value(v); - } - else if(strcmp(numType, @encode(float)) == 0) - { - dict[key] = Value([num floatValue]); - } - else if(strcmp(numType, @encode(double)) == 0) - { - dict[key] = Value([num doubleValue]); - } - else{ - dict[key] = Value([num intValue]); - } - return; - } - - - // the value is a new dictionary - if ([nsValue isKindOfClass:[NSDictionary class]]) - { - ValueMap subDict; - - for (id subKey in [nsValue allKeys]) - { - id subValue = [nsValue objectForKey:subKey]; - addValueToDict(subKey, subValue, subDict); - } - dict[key] = Value(subDict); - return; - } - - // the value is a array - if ([nsValue isKindOfClass:[NSArray class]]) - { - ValueVector valueArray; - - for (id item in nsValue) - { - addItemToArray(item, valueArray); - } - dict[key] = Value(valueArray); - return; - } - + dict[key] = convertNSObjectToCCValue(nsValue); } -static void addObjectToNSDict(const std::string& key, const Value& value, NSMutableDictionary *dict) +static void addCCValueToNSDictionary(const std::string& key, const Value& value, NSMutableDictionary *dict) { NSString *NSkey = [NSString stringWithCString:key.c_str() encoding:NSUTF8StringEncoding]; - - // the object is a Dictionary - if (value.getType() == Value::Type::MAP) - { - NSMutableDictionary *dictElement = [NSMutableDictionary dictionary]; - ValueMap subDict = value.asValueMap(); - for (auto iter = subDict.begin(); iter != subDict.end(); ++iter) - { - addObjectToNSDict(iter->first, iter->second, dictElement); - } - - [dict setObject:dictElement forKey:NSkey]; - return; - } - - //add float into dict - if (value.getType() == Value::Type::FLOAT) { - NSNumber *number = [NSNumber numberWithFloat:value.asFloat()]; - [dict setObject:number forKey:NSkey]; - } - - //add double into dict - if (value.getType() == Value::Type::DOUBLE) { - NSNumber *number = [NSNumber numberWithDouble:value.asDouble()]; - [dict setObject:number forKey:NSkey]; - } - - //add boolean into dict - if (value.getType() == Value::Type::BOOLEAN) { - NSNumber *element = [NSNumber numberWithBool:value.asBool()]; - [dict setObject:element forKey:NSkey]; - } - - //add integer into dict - if (value.getType() == Value::Type::INTEGER) { - NSNumber *element = [NSNumber numberWithInt:value.asInt()]; - [dict setObject:element forKey:NSkey]; - } - - // the object is a String - if (value.getType() == Value::Type::STRING) - { - NSString *strElement = [NSString stringWithCString:value.asString().c_str() encoding:NSUTF8StringEncoding]; - [dict setObject:strElement forKey:NSkey]; - return; - } - - // the object is a Array - if (value.getType() == Value::Type::VECTOR) - { - NSMutableArray *arrElement = [NSMutableArray array]; - - ValueVector array = value.asValueVector(); - - for(const auto& v : array) - { - addObjectToNSArray(v, arrElement); - } - - [dict setObject:arrElement forKey:NSkey]; - return; - } + [dict setObject:convertCCValueToNSObject(value) forKey:NSkey]; } + FileUtilsApple::FileUtilsApple() : pimpl_(new IMPL([NSBundle mainBundle])) { } +FileUtilsApple::~FileUtilsApple() = default; + #if CC_FILEUTILS_APPLE_ENABLE_OBJC void FileUtilsApple::setBundle(NSBundle* bundle) { pimpl_->setBundle(bundle); @@ -470,7 +354,7 @@ static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, str for (id key in [dict allKeys]) { id value = [dict objectForKey:key]; - addValueToDict(key, value, ret); + addNSObjectToCCMap(key, value, ret); } } return ret; @@ -489,7 +373,7 @@ static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, str for (auto iter = dict.begin(); iter != dict.end(); ++iter) { - addObjectToNSDict(iter->first, iter->second, nsDict); + addCCValueToNSDictionary(iter->first, iter->second, nsDict); } NSString *file = [NSString stringWithUTF8String:fullPath.c_str()]; @@ -506,7 +390,7 @@ static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, str for (const auto &e : vecData) { - addObjectToNSArray(e, array); + addCCValueToNSArray(e, array); } [array writeToFile:path atomically:YES]; @@ -528,7 +412,7 @@ static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, str for (id value in array) { - addItemToArray(value, ret); + addNSObjectToCCVector(value, ret); } return ret; diff --git a/cocos/platform/desktop/CCGLViewImpl-desktop.cpp b/cocos/platform/desktop/CCGLViewImpl-desktop.cpp index 40e1a563bd63..424a212ce142 100644 --- a/cocos/platform/desktop/CCGLViewImpl-desktop.cpp +++ b/cocos/platform/desktop/CCGLViewImpl-desktop.cpp @@ -299,9 +299,14 @@ GLViewImpl::~GLViewImpl() } GLViewImpl* GLViewImpl::create(const std::string& viewName) +{ + return GLViewImpl::create(viewName, false); +} + +GLViewImpl* GLViewImpl::create(const std::string& viewName, bool resizable) { auto ret = new (std::nothrow) GLViewImpl; - if(ret && ret->initWithRect(viewName, Rect(0, 0, 960, 640), 1.0f, false)) { + if(ret && ret->initWithRect(viewName, Rect(0, 0, 960, 640), 1.0f, resizable)) { ret->autorelease(); return ret; } diff --git a/cocos/platform/desktop/CCGLViewImpl-desktop.h b/cocos/platform/desktop/CCGLViewImpl-desktop.h index 24061f2767bd..e44ef40bca9b 100644 --- a/cocos/platform/desktop/CCGLViewImpl-desktop.h +++ b/cocos/platform/desktop/CCGLViewImpl-desktop.h @@ -57,6 +57,7 @@ class CC_DLL GLViewImpl : public GLView { public: static GLViewImpl* create(const std::string& viewName); + static GLViewImpl* create(const std::string& viewName, bool resizable); static GLViewImpl* createWithRect(const std::string& viewName, Rect size, float frameZoomFactor = 1.0f, bool resizable = false); static GLViewImpl* createWithFullScreen(const std::string& viewName); static GLViewImpl* createWithFullScreen(const std::string& viewName, const GLFWvidmode &videoMode, GLFWmonitor *monitor); diff --git a/cocos/platform/ios/CCGLViewImpl-ios.h b/cocos/platform/ios/CCGLViewImpl-ios.h index 83a7607df8ac..6f3eef52a7e5 100644 --- a/cocos/platform/ios/CCGLViewImpl-ios.h +++ b/cocos/platform/ios/CCGLViewImpl-ios.h @@ -48,7 +48,7 @@ class CC_DLL GLViewImpl : public GLView static GLViewImpl* create(const std::string& viewName); /** creates a GLViewImpl with a title name, a rect and the zoom factor */ - static GLViewImpl* createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor = 1.0f); + static GLViewImpl* createWithRect(const std::string& viewName, const Rect& rect, float frameZoomFactor = 1.0f); /** creates a GLViewImpl with a name in fullscreen mode */ static GLViewImpl* createWithFullScreen(const std::string& viewName); @@ -80,7 +80,7 @@ class CC_DLL GLViewImpl : public GLView virtual ~GLViewImpl(); bool initWithEAGLView(void* eaGLView); - bool initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor); + bool initWithRect(const std::string& viewName, const Rect& rect, float frameZoomFactor); bool initWithFullScreen(const std::string& viewName); // the objective-c CCEAGLView instance diff --git a/cocos/platform/ios/CCGLViewImpl-ios.mm b/cocos/platform/ios/CCGLViewImpl-ios.mm index 65a37a00aaf0..d68e213c738b 100644 --- a/cocos/platform/ios/CCGLViewImpl-ios.mm +++ b/cocos/platform/ios/CCGLViewImpl-ios.mm @@ -61,7 +61,7 @@ of this software and associated documentation files (the "Software"), to deal return nullptr; } -GLViewImpl* GLViewImpl::createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) +GLViewImpl* GLViewImpl::createWithRect(const std::string& viewName, const Rect& rect, float frameZoomFactor) { auto ret = new (std::nothrow) GLViewImpl; if(ret && ret->initWithRect(viewName, rect, frameZoomFactor)) { @@ -130,7 +130,7 @@ of this software and associated documentation files (the "Software"), to deal return true; } -bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) +bool GLViewImpl::initWithRect(const std::string& viewName, const Rect& rect, float frameZoomFactor) { CGRect r = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); convertAttrs(); diff --git a/cocos/platform/ios/CCImage-ios.mm b/cocos/platform/ios/CCImage-ios.mm index ec1923b01e45..5ab3dd1ea79f 100644 --- a/cocos/platform/ios/CCImage-ios.mm +++ b/cocos/platform/ios/CCImage-ios.mm @@ -99,22 +99,20 @@ of this software and associated documentation files (the "Software"), to deal CGImageRelease(iref); CGColorSpaceRelease(colorSpaceRef); CGDataProviderRelease(provider); - - NSData *data; - - if (saveToPNG) - { - data = UIImagePNGRepresentation(image); - } - else - { - data = UIImageJPEGRepresentation(image, 1.0f); + + // NOTE: Prevent memory leak. Requires ARC enabled. + @autoreleasepool { + NSData *data; + if (saveToPNG) { + data = UIImagePNGRepresentation(image); + } else { + data = UIImageJPEGRepresentation(image, 1.0f); + } + [data writeToFile:[NSString stringWithUTF8String:filename.c_str()] atomically:YES]; } - - [data writeToFile:[NSString stringWithUTF8String:filename.c_str()] atomically:YES]; - + [image release]; - + if (needToCopyPixels) { delete [] pixels; diff --git a/cocos/platform/linux/CCFileUtils-linux.cpp b/cocos/platform/linux/CCFileUtils-linux.cpp index c0f633695e2c..5d3753c7e23b 100644 --- a/cocos/platform/linux/CCFileUtils-linux.cpp +++ b/cocos/platform/linux/CCFileUtils-linux.cpp @@ -35,7 +35,6 @@ THE SOFTWARE. #include #include #include -#include #ifndef CC_RESOURCE_FOLDER_LINUX #define CC_RESOURCE_FOLDER_LINUX ("/Resources/") diff --git a/cocos/platform/linux/CCStdC-linux.h b/cocos/platform/linux/CCStdC-linux.h index c1669fd09b43..b92a9a0ec87f 100644 --- a/cocos/platform/linux/CCStdC-linux.h +++ b/cocos/platform/linux/CCStdC-linux.h @@ -50,12 +50,6 @@ THE SOFTWARE. #define MAX(x,y) (((x) < (y)) ? (y) : (x)) #endif // MAX -// some function linux do not have -#define tanf tan -#define sqrtf sqrt -#define cosf cos -#define sinf sin - #endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #endif // __CC_STD_C_H__ diff --git a/cocos/platform/tizen/CCApplication-tizen.cpp b/cocos/platform/tizen/CCApplication-tizen.cpp new file mode 100644 index 000000000000..bdda5bcb6b48 --- /dev/null +++ b/cocos/platform/tizen/CCApplication-tizen.cpp @@ -0,0 +1,663 @@ +/**************************************************************************** + 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" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#include "platform/tizen/CCApplication-tizen.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "platform/tizen/CCGLViewImpl-tizen.h" +#include "base/CCDirector.h" +#include "base/CCEventKeyboard.h" +#include "base/CCEventDispatcher.h" +#include "platform/CCFileUtils.h" + +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "cocos2d-x" + +ELEMENTARY_GLVIEW_GLOBAL_DEFINE(); + +NS_CC_BEGIN + +void stopAccelerometerSensor(); +void pauseAccelerometerSensor(); +void resumeAccelerometerSensor(); + +static void win_back_cb(void *data, Evas_Object *obj, void *event_info) { + //Application *ad = (Application *)data; + /* Let window go to hidden state. */ + //elm_win_lower(ad->_win); + // cocos2d::EventKeyboard event(cocos2d::EventKeyboard::KeyCode::KEY_ESCAPE, false); + // cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); + stopAccelerometerSensor(); + Director::getInstance()->end(); +} + +static void win_more_cb(void *data, Evas_Object *obj, void *event_info) { + cocos2d::EventKeyboard event(cocos2d::EventKeyboard::KeyCode::KEY_MENU, false); + cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); +} + +static void makeCurrent(void) +{ + Application* app = Application::getInstance(); + evas_gl_make_current(app->_evasGL, app->_sfc, app->_ctx); +} + +static void draw_gl(Evas_Object *obj) +{ + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); + + director->mainLoop(); + glview->pollEvents(); +} + +static void del_gl(Evas_Object *obj) { + +} + +// sharedApplication pointer +Application* Application::__instance = nullptr; + +Application::Application() +: _win(nullptr) +, _conform(nullptr) +, _animationInterval(1.0f/60.0f*1000.0f) +{ + _orientation = APP_DEVICE_ORIENTATION_0; + CC_ASSERT(! __instance); + __instance = this; +} + +Application::~Application() +{ + CC_ASSERT(this == __instance); + __instance = nullptr; +} + +static void del_anim(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + Ecore_Animator *ani = (Ecore_Animator *)evas_object_data_get(obj, "ani"); + ecore_animator_del(ani); +} + +static Eina_Bool anim(void *data) { + elm_glview_changed_set((Evas_Object*)data); + return EINA_TRUE; +} + +static void init_gl(Evas_Object *obj) { + Application *ad = Application::getInstance(); + + //save current ctx + ad->_evasGL = elm_glview_evas_gl_get(obj); + ad->_ctx = evas_gl_current_context_get(ad->_evasGL); + ad->_sfc = evas_gl_current_surface_get(ad->_evasGL); + + auto director = Director::getInstance(); + auto glview = director->getOpenGLView(); + if (glview == nullptr) { + glview = GLViewImpl::create("Cocos2dxTizen"); + + int w, h; + elm_glview_size_get(obj, &w, &h); + glview->setFrameSize(w, h); + director->setOpenGLView(glview); + } + + ad->initGLContextAttrs(); + // Initialize instance and cocos2d. + if (! ad->applicationDidFinishLaunching()) + { + return; + } +} + +static void create_indicator(Application *ad) { + elm_win_conformant_set(ad->_win, EINA_TRUE); + + elm_win_indicator_mode_set(ad->_win, ELM_WIN_INDICATOR_HIDE); + + ad->_conform = elm_conformant_add(ad->_win); + evas_object_size_hint_weight_set(ad->_conform, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + elm_win_resize_object_add(ad->_win, ad->_conform); + evas_object_show(ad->_conform); +} + +static Evas_Object* add_win(const char *name) { + Evas_Object *win; + + win = elm_win_util_standard_add(name, "tizen"); + + if (!win) + return nullptr; + //fix openURL tests not goes to another program issue + // elm_win_fullscreen_set(win, EINA_TRUE); + evas_object_show(win); + + return win; +} + +//touch call back +static void touches_down_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) +{ + auto ev = (Evas_Event_Multi_Down *)event_info; + int id = ev->device; + float x = ev->canvas.x; + float y = ev->canvas.y; + + makeCurrent(); + cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &id, &x, &y); +} + +static void touches_move_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) +{ + auto ev = (Evas_Event_Multi_Move *)event_info; + int id = ev->device; + float x = ev->cur.canvas.x; + float y = ev->cur.canvas.y; + + makeCurrent(); + cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(1, &id, &x, &y); +} + +static void touches_up_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) +{ + auto ev = (Evas_Event_Multi_Up *)event_info; + int id = ev->device; + float x = ev->canvas.x; + float y = ev->canvas.y; + + makeCurrent(); + cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &id, &x, &y); +} + +static void touch_down_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) +{ + auto ev = (Evas_Event_Mouse_Down *)event_info; + int id = ev->button; + float x = ev->canvas.x; + float y = ev->canvas.y; + + makeCurrent(); + cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &id, &x, &y); +} + +static void touch_move_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) +{ + auto ev = (Evas_Event_Mouse_Move *)event_info; + int id = ev->buttons; + float x = ev->cur.canvas.x; + float y = ev->cur.canvas.y; + + makeCurrent(); + cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(1, &id, &x, &y); +} + +static void touch_up_cb(void *data, Evas *e , Evas_Object *obj , void *event_info) +{ + auto ev = (Evas_Event_Mouse_Up *)event_info; + int id = ev->button; + float x = ev->canvas.x; + float y = ev->canvas.y; + + makeCurrent(); + cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &id, &x, &y); +} + +static void get_glview_mode(GLContextAttrs &attrs, char* gl_mode) +{ + strcat(gl_mode, "opengl"); + + if (attrs.alphaBits > 0) + { + strcat(gl_mode, ":alpha"); + } + + if (attrs.depthBits > 0) + { + strcat(gl_mode, ":depth"); + if (attrs.depthBits <= 8) + { + strcat(gl_mode, "8"); + } + else if (attrs.depthBits <= 16) + { + strcat(gl_mode, "16"); + } + else if (attrs.depthBits <= 24) + { + strcat(gl_mode, "24"); + } + else + { + strcat(gl_mode, "32"); + } + } + + if (attrs.stencilBits > 0) + { + strcat(gl_mode, ":stencil"); + if (attrs.stencilBits == 1) + { + strcat(gl_mode, "1"); + } + else if (attrs.stencilBits == 2) + { + strcat(gl_mode, "2"); + } + else if (attrs.stencilBits <= 4) + { + strcat(gl_mode, "4"); + } + else if (attrs.stencilBits <= 8) + { + strcat(gl_mode, "8"); + } + else + { + strcat(gl_mode, "16"); + } + } + + strcat(gl_mode, "\0"); +} + +static bool app_create(void *data) { + /* Hook to take necessary actions before main event loop starts + * Initialize UI resources and application's data + * If this function returns true, the main loop of application starts + * If this function returns false, the application is terminated. */ + + Evas_Object *bx, *gl; + Ecore_Animator *ani; + Application *ad = (Application *)data; + + if (!data) + return false; + + /* Create and initialize GLView */ + ad->initGLContextAttrs(); + GLContextAttrs attrs = GLView::getGLContextAttrs(); + char gl_mode[100] = ""; + get_glview_mode(attrs, gl_mode); + elm_config_accel_preference_set("opengl");//(gl_mode); + /* Create the window */ + ad->_win = add_win("cocos2d-x"); + + if (!ad->_win) + return false; + + int rots[2]; + rots[0] = ad->_orientation; + rots[1] = rots[0] + 180 % 360; + elm_win_wm_rotation_available_rotations_set(ad->_win, rots, 2); + + eext_object_event_callback_add(ad->_win, EEXT_CALLBACK_BACK, win_back_cb, ad); + eext_object_event_callback_add(ad->_win, EEXT_CALLBACK_MORE, win_more_cb, ad); + + /* Add a box to contain our GLView */ + bx = elm_box_add(ad->_win); + evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(ad->_win, bx); + evas_object_show(bx); + + gl = elm_glview_add(ad->_win); + ELEMENTARY_GLVIEW_GLOBAL_USE(gl); + evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + /* Request a surface with alpha and a depth buffer */ + Elm_GLView_Mode mode = (Elm_GLView_Mode)(ELM_GLVIEW_DIRECT | ELM_GLVIEW_DEPTH | ELM_GLVIEW_STENCIL); + elm_glview_mode_set(gl, mode); + + /* The resize policy tells GLView what to do with the surface when it + * resizes. ELM_GLVIEW_RESIZE_POLICY_RECREATE will tell it to + * destroy the current surface and recreate it to the new size. + */ + //elm_glview_resize_policy_set(gl, ELM_GLVIEW_RESIZE_POLICY_RECREATE); + + /* The render policy sets how GLView should render GL code. + * ELM_GLVIEW_RENDER_POLICY_ON_DEMAND will have the GL callback + * called only when the object is visible. + * ELM_GLVIEW_RENDER_POLICY_ALWAYS would cause the callback to be + * called even if the object were hidden. + */ + elm_glview_render_policy_set(gl, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND); + + /* The initialize callback function gets registered here */ + elm_glview_init_func_set(gl, init_gl); + + /* The delete callback function gets registered here */ + elm_glview_del_func_set(gl, del_gl); + + /* The resize callback function gets registered here */ + // Cocos2d-x doesn't support to change orientation from portrait to landscape. + // So comment next line. +// elm_glview_resize_func_set(gl, resize_gl); + + /* The render callback function gets registered here */ + elm_glview_render_func_set(gl, draw_gl); + + /* Add the GLView to the box and show it */ + elm_box_pack_end(bx, gl); + evas_object_show(gl); + + elm_object_focus_set(gl, EINA_TRUE); + + /* This adds an animator so that the app will regularly + * trigger updates of the GLView using elm_glview_changed_set(). + * + * NOTE: If you delete GL, this animator will keep running trying to access + * GL so this animator needs to be deleted with ecore_animator_del(). + */ + ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_TIMER); + ani = ecore_animator_add(anim, gl); + evas_object_data_set(gl, "ani", ani); + //evas_object_data_set(gl, "ad", ad); + evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, del_anim, gl); + + /* Add Mouse Event Callbacks */ + evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_DOWN, touch_down_cb, ad); + evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_MOVE, touch_move_cb, ad); + evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_UP, touch_up_cb, ad); + + evas_object_event_callback_add(gl, EVAS_CALLBACK_MULTI_DOWN, touches_down_cb, ad); + evas_object_event_callback_add(gl, EVAS_CALLBACK_MULTI_MOVE, touches_move_cb, ad); + evas_object_event_callback_add(gl, EVAS_CALLBACK_MULTI_UP, touches_up_cb, ad); + + evas_object_show(ad->_win); + + create_indicator(ad); + + return true; +} + +static void app_pause(void *data) +{ + /* Take necessary actions when application becomes invisible. */ + if(!data) + { + return; + } + pauseAccelerometerSensor(); + + Application* app = ((Application *)data); + app->applicationDidEnterBackground(); +} + +static void app_resume(void *data) +{ + /* Take necessary actions when application becomes visible. */ + if(!data) + { + return; + } + + Application* app = ((Application *)data); + app->applicationWillEnterForeground(); + resumeAccelerometerSensor(); +} + +static void app_terminate(void *data) +{ + /* Release all resources. */ + if(!data) + { + return; + } + stopAccelerometerSensor(); + Director::getInstance()->end(); + // Application* app = ((Application *)data); + // delete app; +} + +static void app_control(app_control_h app_control, void *data) +{ + /* Handle the launch request. */ +} + +int Application::run() +{ + ui_app_lifecycle_callback_s event_callback = {0,}; + //app_event_handler_h handlers[5] = {NULL, }; + + event_callback.create = app_create; + event_callback.terminate = app_terminate; + event_callback.pause = app_pause; + event_callback.resume = app_resume; + event_callback.app_control = app_control; + +/* ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad); + ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]); +*/ + int ret = ui_app_main(_argc, _argv, &event_callback, this); + if (ret != APP_ERROR_NONE) { + dlog_print(DLOG_ERROR, LOG_TAG, "The application failed to start, and returned %d", ret); + } + + return ret; +} + +void Application::setAnimationInterval(float interval) +{ + _animationInterval = interval*1000.0f; + ecore_animator_frametime_set(interval); +} + +void Application::setResourceRootPath(const std::string& rootResDir) +{ + _resourceRootPath = rootResDir; + if (_resourceRootPath[_resourceRootPath.length() - 1] != '/') + { + _resourceRootPath += '/'; + } + FileUtils* pFileUtils = FileUtils::getInstance(); + std::vector searchPaths = pFileUtils->getSearchPaths(); + searchPaths.insert(searchPaths.begin(), _resourceRootPath); + pFileUtils->setSearchPaths(searchPaths); +} + +const std::string& Application::getResourceRootPath(void) +{ + return _resourceRootPath; +} + +Application::Platform Application::getTargetPlatform() +{ + return Platform::OS_TIZEN; +} + +void Application::setDeviceOrientation(int orientation) +{ + _orientation = orientation; +} + +void Application::setMainArgs(int argc, char **argv) +{ + _argc = argc; + _argv = argv; +} +bool Application::openURL(const std::string &url) +{ + bool flag = false; + if(0==url.length()) + { + return flag; + } + app_control_h app_control; + + app_control_create(&app_control); + app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW); + app_control_set_uri(app_control, url.c_str()); + + int ctrlError; + if ((ctrlError=app_control_send_launch_request(app_control, NULL, NULL)) == APP_CONTROL_ERROR_NONE) + { + flag = true; + } + else + { + dlog_print(DLOG_ERROR, LOG_TAG, "open url failed, and returned %d", ctrlError); + } + + app_control_destroy(app_control); + return flag; +} + +////////////////////////////////////////////////////////////////////////// +// static member function +////////////////////////////////////////////////////////////////////////// +Application* Application::getInstance() +{ + CC_ASSERT(__instance); + return __instance; +} + +// @deprecated Use getInstance() instead +Application* Application::sharedApplication() +{ + return Application::getInstance(); +} + +const char * Application::getCurrentLanguageCode() +{ + static char code[3]={0}; + char *pLanguageName = getenv("LANG"); + if (!pLanguageName) + return "en"; + strtok(pLanguageName, "_"); + if (!pLanguageName) + return "en"; + strncpy(code,pLanguageName,2); + code[2]='\0'; + return code; +} + +std::string Application::getVersion() +{ + //TODO + return ""; +} + +LanguageType Application::getCurrentLanguage() +{ + char *pLanguageName = getenv("LANG"); + LanguageType ret = LanguageType::ENGLISH; + if (!pLanguageName) + { + return LanguageType::ENGLISH; + } + strtok(pLanguageName, "_"); + if (!pLanguageName) + { + return LanguageType::ENGLISH; + } + + if (0 == strcmp("zh", pLanguageName)) + { + ret = LanguageType::CHINESE; + } + else if (0 == strcmp("en", pLanguageName)) + { + ret = LanguageType::ENGLISH; + } + else if (0 == strcmp("fr", pLanguageName)) + { + ret = LanguageType::FRENCH; + } + else if (0 == strcmp("it", pLanguageName)) + { + ret = LanguageType::ITALIAN; + } + else if (0 == strcmp("de", pLanguageName)) + { + ret = LanguageType::GERMAN; + } + else if (0 == strcmp("es", pLanguageName)) + { + ret = LanguageType::SPANISH; + } + else if (0 == strcmp("nl", pLanguageName)) + { + ret = LanguageType::DUTCH; + } + else if (0 == strcmp("ru", pLanguageName)) + { + ret = LanguageType::RUSSIAN; + } + else if (0 == strcmp("ko", pLanguageName)) + { + ret = LanguageType::KOREAN; + } + else if (0 == strcmp("ja", pLanguageName)) + { + ret = LanguageType::JAPANESE; + } + else if (0 == strcmp("hu", pLanguageName)) + { + ret = LanguageType::HUNGARIAN; + } + else if (0 == strcmp("pt", pLanguageName)) + { + ret = LanguageType::PORTUGUESE; + } + else if (0 == strcmp("ar", pLanguageName)) + { + ret = LanguageType::ARABIC; + } + else if (0 == strcmp("nb", pLanguageName)) + { + ret = LanguageType::NORWEGIAN; + } + else if (0 == strcmp("pl", pLanguageName)) + { + ret = LanguageType::POLISH; + } + + return ret; +} + +NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + diff --git a/cocos/platform/tizen/CCApplication-tizen.h b/cocos/platform/tizen/CCApplication-tizen.h new file mode 100644 index 000000000000..1be09e7807de --- /dev/null +++ b/cocos/platform/tizen/CCApplication-tizen.h @@ -0,0 +1,142 @@ +/**************************************************************************** + 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" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#ifndef CCAPLICATION_TIZEN_H_ +#define CCAPLICATION_TIZEN_H_ + +#include "platform/CCCommon.h" +#include "platform/CCApplicationProtocol.h" +#include + +#include +#include +#include +#include + +#include + +struct _Evas_GL; +struct _Evas_GL_Context; +struct _Evas_GL_Surface; + +NS_CC_BEGIN +class Rect; + +class Application : public ApplicationProtocol +{ +public: + /** + * @js ctor + */ + Application(); + /** + * @js NA + * @lua NA + */ + virtual ~Application(); + + /** + @brief Callback by Director for limit FPS. + @param interval The time, which expressed in second in second, between current frame and next. + */ + void setAnimationInterval(float interval) override; + + /** + @brief Run the message loop. + */ + int run(); + + /** + @brief Get current application instance. + @return Current application instance pointer. + */ + static Application* getInstance(); + + /** @deprecated Use getInstance() instead */ + CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); + + /* override functions */ + virtual LanguageType getCurrentLanguage() override; + + std::string getVersion() override; + + /** + @brief Get current language iso 639-1 code + @return Current language iso 639-1 code + */ + virtual const char * getCurrentLanguageCode() override; + + /** + @brief Open url in default browser + @param String with url to open. + @return true if the resource located by the URL was successfully opened; otherwise false. + */ + virtual bool openURL(const std::string &url) override; + + /** + * Sets the Resource root path. + * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. + */ + CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir); + + /** + * Gets the Resource root path. + * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. + */ + CC_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(void); + + /** + @brief Get target platform + */ + virtual Platform getTargetPlatform() override; + + void setDeviceOrientation(int orientation); + void setMainArgs(int argc, char **argv); + +public: + Evas_Object * _win; + Evas_Object * _conform; + + _Evas_GL * _evasGL; + _Evas_GL_Context * _ctx; + _Evas_GL_Surface * _sfc; + + int _orientation; + int _argc; + char **_argv; +protected: + long _animationInterval; //micro second + std::string _resourceRootPath; + + static Application * __instance; +}; + +NS_CC_END + +#endif // CCAPLICATION_TIZEN_H_ + +#endif /* CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.h b/cocos/platform/tizen/CCCommon-tizen.cpp similarity index 73% rename from tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.h rename to cocos/platform/tizen/CCCommon-tizen.cpp index 0795672455e6..049af4c1b871 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.h +++ b/cocos/platform/tizen/CCCommon-tizen.cpp @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - + 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 @@ -22,21 +22,25 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __TestCpp__UIImageViewTest_Editor__ -#define __TestCpp__UIImageViewTest_Editor__ +#include "platform/CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -#include "../UIScene_Editor.h" +#include "platform/CCCommon.h" +#include "platform/tizen/CCStdC-tizen.h" +#include "base/CCConsole.h" -DEFINE_TEST_SUITE(UIImageViewEditorTests); +NS_CC_BEGIN -class UIImageViewTest_Editor : public UIScene_Editor +void MessageBox(const char * msg, const char * title) { -public: - CREATE_FUNC(UIImageViewTest_Editor); + log("%s: %s", title, msg); +} - virtual bool init() override; +void LuaLog(const char * format) +{ + puts(format); +} -protected: -}; +NS_CC_END -#endif /* defined(__TestCpp__UIImageViewTest_Editor__) */ +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/cocos/platform/tizen/CCDevice-tizen.cpp b/cocos/platform/tizen/CCDevice-tizen.cpp new file mode 100644 index 000000000000..7673ee2bd85b --- /dev/null +++ b/cocos/platform/tizen/CCDevice-tizen.cpp @@ -0,0 +1,358 @@ +/**************************************************************************** + 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" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#include "platform/CCDevice.h" + +#include +#include +#include +#include +#include +#include + +#include "base/CCEventDispatcher.h" +#include "base/CCEventAcceleration.h" +#include "base/CCDirector.h" +#include "platform/CCFileUtils.h" +#include "platform/tizen/CCApplication-tizen.h" + +using namespace std; +NS_CC_BEGIN + +static sensor_h s_sensorHandle = nullptr; +static sensor_listener_h s_sensorListener = nullptr; +static float s_sensorInterval = 30.0f; + +#define GRAVITY_EARTH 9.80665f + +static bool checkAccelerometerValues(sensor_event_s *sensor_data) +{ + for(int i = 0; i < sensor_data->value_count; ++i) + { + float value = sensor_data->values[i]; + + if(isnan(value))//or other limitations + { + return false; + } + } + return true; +} + +static void accelerometer_sensor_cb(sensor_h _sensor, sensor_event_s *sensor_data, void *user_data) +{ + if(!checkAccelerometerValues(sensor_data)) + { + CCLOG("sensor value is invalid!!"); + return; + } + if(3 != sensor_data->value_count) + { + return; + } + Acceleration *_acceleration = new Acceleration(); + _acceleration->x = sensor_data->values[0] / GRAVITY_EARTH; + _acceleration->y = sensor_data->values[1] / GRAVITY_EARTH; + _acceleration->z = sensor_data->values[2] / GRAVITY_EARTH; + _acceleration->timestamp = sensor_data->timestamp; + + double tmp = _acceleration->x; + Application *app = Application::getInstance(); + int oritentation = elm_win_rotation_get(app->_win); + + switch (oritentation) + { + case 0: + _acceleration->x = _acceleration->y; + _acceleration->y = tmp; + break; + + case 90: + _acceleration->x = -_acceleration->y; + _acceleration->y = tmp; + break; + + case 180: + _acceleration->x = -_acceleration->y; + _acceleration->y = -tmp; + break; + + case 270: + _acceleration->x = _acceleration->y; + _acceleration->y = -tmp; + break; + default: + CCLOG("unknow orientation"); + } + + cocos2d::EventAcceleration event(*_acceleration); + auto dispatcher = cocos2d::Director::getInstance()->getEventDispatcher(); + dispatcher->dispatchEvent(&event); +} + +void stopAccelerometerSensor() +{ + if (s_sensorListener) + { + sensor_listener_stop(s_sensorListener); + sensor_destroy_listener(s_sensorListener); + s_sensorListener = nullptr; + s_sensorHandle = nullptr; + } +} + +void startAccelerometerSensor() +{ + if (!s_sensorListener) + { + sensor_get_default_sensor(SENSOR_ACCELEROMETER, &s_sensorHandle); + auto err = sensor_create_listener(s_sensorHandle, &s_sensorListener); + if(SENSOR_ERROR_NONE != err) + { + CCLOG("create sensor failed!"); + } + sensor_listener_set_event_cb(s_sensorListener, s_sensorInterval, accelerometer_sensor_cb, NULL); + sensor_listener_start(s_sensorListener); + } +} + +static bool s_resumeAccelerometerSensor = false; + +void pauseAccelerometerSensor() +{ + if (s_sensorListener) + { + s_resumeAccelerometerSensor = true; + stopAccelerometerSensor(); + } + else + { + s_resumeAccelerometerSensor = false; + } +} + +void resumeAccelerometerSensor() +{ + if (s_resumeAccelerometerSensor) + { + startAccelerometerSensor(); + } +} + +void Device::setAccelerometerEnabled(bool isEnabled) +{ + if(isEnabled) + { + startAccelerometerSensor(); + } + else + { + stopAccelerometerSensor(); + } +} + +void Device::setAccelerometerInterval(float interval) +{ + s_sensorInterval = interval; + if(s_sensorListener) + { + sensor_listener_set_interval(s_sensorListener, s_sensorInterval); + } +} + +int Device::getDPI() +{ + static int dpi = -1; + if (dpi == -1) + { + auto ret = system_info_get_platform_int("tizen.org/feature/screen.dpi",&dpi); + if(ret != SYSTEM_INFO_ERROR_NONE) + { + //error handing + dpi = -1; + } + } + return dpi; +} + +static void getTextBitmapData(const char * text, const FontDefinition& textDefinition, Data& bitmapData, int &bitmapWidth, int &bitmapHeight) +{ + //create canvas object + auto method = evas_render_method_lookup("buffer"); + if (method <= 0) + { + log("ERROR: evas was not compiled with 'buffer' engine!"); + return ; + } + + //evas_init();//not necessary, removed when use Tizen 2.4. + auto canvas = evas_new(); + if(!canvas){ + log("ERROR: could not instantiate new evas canvas."); + return; + } + evas_output_method_set(canvas, method); + + std::string fontFullPath; + if(textDefinition._fontName.empty()) + { + fontFullPath = "Sans"; + } + else + { + fontFullPath= FileUtils::getInstance()->fullPathForFilename(textDefinition._fontName); + } + + const char* fontName = fontFullPath.c_str(); + const char* textAlign = "left"; + const char* textValign = "top"; + char richTextStyle[50]; + richTextStyle[0] = 0; + + if (textDefinition._stroke._strokeEnabled) + { + sprintf(richTextStyle,"style=outline outline_color=#%02X%02X%02X", + textDefinition._stroke._strokeColor.r, textDefinition._stroke._strokeColor.g, textDefinition._stroke._strokeColor.b); + } + + switch (textDefinition._alignment) + { + case TextHAlignment::CENTER: + textAlign = "center"; + break; + case TextHAlignment::RIGHT: + textAlign = "right"; + break; + default: + break; + } + double valignment = 0.0; + switch(textDefinition._vertAlignment) + { + case TextVAlignment::CENTER: + textValign = "center"; + valignment = 0.5; + break; + case TextVAlignment::BOTTOM: + textValign = "bottom"; + valignment = 1.0; + break; + default: + break; + } + + auto richText = (char*)malloc(strlen(text) + 150); + sprintf(richText,"DEFAULT='font=%s font_size=%d align=%s valign=%s %s color=#%02X%02X%02X wrap=word'", + fontName, textDefinition._fontSize, textAlign, textValign, richTextStyle, + textDefinition._fontFillColor.b, textDefinition._fontFillColor.g, textDefinition._fontFillColor.r); + + auto entry = evas_object_textblock_add(canvas); + auto st = evas_textblock_style_new(); + evas_textblock_style_set(st, richText); + evas_object_textblock_style_set(entry, st); + evas_textblock_style_free(st); + evas_object_textblock_valign_set(entry, valignment); + + evas_object_textblock_text_markup_set(entry, evas_textblock_text_utf8_to_markup(entry, text)); + free(richText); + + evas_object_resize(entry, 2048, 0);//allocate one default size first. + + Evas_Coord width = textDefinition._dimensions.width; + Evas_Coord height = textDefinition._dimensions.height; + if(0==width*height) + { + evas_object_textblock_size_formatted_get(entry, &width, &height); + } + + evas_object_resize(entry, width, height); + + //init canvas + evas_output_size_set(canvas, width, height); + evas_output_viewport_set(canvas, 0, 0, width, height); + + auto einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(canvas); + if (!einfo){ + log("ERROR: could not get evas engine info!"); + evas_free(canvas); + return ; + } + + // ARGB32 is sizeof(int), that is 4 bytes, per pixel + bitmapWidth = width; + bitmapHeight = height; + void* pixels = malloc(bitmapWidth * bitmapHeight * 4); + if (!pixels){ + log("ERROR: could not allocate canvas pixels!"); + evas_free(canvas); + return; + } + + einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32; + einfo->info.dest_buffer = pixels; + einfo->info.dest_buffer_row_bytes = bitmapWidth * sizeof(int); + einfo->info.use_color_key = 0; + einfo->info.alpha_threshold = 0; + einfo->info.func.new_update_region = NULL; + einfo->info.func.free_update_region = NULL; + evas_engine_info_set(canvas, (Evas_Engine_Info *)einfo); + + //render + evas_object_show(entry); + auto updates = evas_render_updates(canvas); + evas_render_updates_free(updates); + + bitmapData.fastSet((unsigned char*)pixels,bitmapWidth * bitmapHeight * 4); + + evas_free(canvas); + //evas_shutdown();//not necessary, removed when use Tizen 2.4. +} + +Data Device::getTextureDataForText(const char * text, const FontDefinition& textDefinition, TextAlign align, int &width, int &height, bool& hasPremultipliedAlpha) +{ + Data ret; + do + { + getTextBitmapData(text, textDefinition, ret, width, height); + hasPremultipliedAlpha = true; + } while (0); + + return ret; +} + +void Device::setKeepScreenOn(bool value) +{ +} + +void Device::vibrate(float duration) +{ + CC_UNUSED_PARAM(duration); +} + +NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/cocos/platform/tizen/CCFileUtils-tizen.cpp b/cocos/platform/tizen/CCFileUtils-tizen.cpp new file mode 100644 index 000000000000..8060866a997f --- /dev/null +++ b/cocos/platform/tizen/CCFileUtils-tizen.cpp @@ -0,0 +1,88 @@ +/**************************************************************************** + 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" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#include "platform/tizen/CCFileUtils-tizen.h" +#include +#include + +using namespace std; +NS_CC_BEGIN + +FileUtils* FileUtils::getInstance() +{ + if (s_sharedFileUtils == nullptr) + { + s_sharedFileUtils = new FileUtilsTizen(); + if(!s_sharedFileUtils->init()) + { + delete s_sharedFileUtils; + s_sharedFileUtils = nullptr; + CCLOG("ERROR: Could not init FileUtilsTizen"); + } + } + + return s_sharedFileUtils; +} + +FileUtilsTizen::FileUtilsTizen() +{ + +} + +bool FileUtilsTizen::init() +{ + _defaultResRootPath = app_get_resource_path(); + _writablePath = app_get_data_path(); + + return FileUtils::init(); +} + +string FileUtilsTizen::getWritablePath() const +{ + return _writablePath; +} + +bool FileUtilsTizen::isFileExistInternal(const std::string& strFilePath) const +{ + if (strFilePath.empty()) + { + return false; + } + + std::string strPath = strFilePath; + if (!isAbsolutePath(strPath)) + { // Not absolute path, add the default root path at the beginning. + strPath.insert(0, _defaultResRootPath); + } + + struct stat sts; + return (stat(strPath.c_str(), &sts) != -1) ? true : false; +} + +NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.h b/cocos/platform/tizen/CCFileUtils-tizen.h similarity index 59% rename from tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.h rename to cocos/platform/tizen/CCFileUtils-tizen.h index 9a71e2d5e54b..3376d6917e91 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.h +++ b/cocos/platform/tizen/CCFileUtils-tizen.h @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - + 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 @@ -22,19 +22,49 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __TestCpp__UITextTest_Editor__ -#define __TestCpp__UITextTest_Editor__ +#include "platform/CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -#include "../UIScene_Editor.h" +#ifndef __CC_FILEUTILS_TIZEN_H__ +#define __CC_FILEUTILS_TIZEN_H__ -DEFINE_TEST_SUITE(UITextEditorTests); -class UITextTest_Editor : public UIScene_Editor +#include "platform/CCFileUtils.h" +#include "platform/CCPlatformMacros.h" +#include "base/ccTypes.h" +#include + +NS_CC_BEGIN + +/** + * @addtogroup platform + * @{ + */ + +//! @brief Helper class to handle file operations +class CC_DLL FileUtilsTizen : public FileUtils { public: - CREATE_FUNC(UITextTest_Editor); + /* override functions */ + virtual bool init() override; + + virtual std::string getWritablePath() const override; - virtual bool init() override; -protected: +private: + FileUtilsTizen(); + + std::string _writablePath; + + virtual bool isFileExistInternal(const std::string& strFilePath) const override; + + friend class FileUtils; }; -#endif /* defined(__TestCpp__UILabelTest_Editor__) */ +// end of platform group +/// @} + +NS_CC_END + +#endif // __CC_FILEUTILS_TIZEN_H__ + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.h b/cocos/platform/tizen/CCGL-tizen.h similarity index 61% rename from tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.h rename to cocos/platform/tizen/CCGL-tizen.h index ed61a578cd04..1b61bf331fc1 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.h +++ b/cocos/platform/tizen/CCGL-tizen.h @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - + 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 @@ -22,29 +22,28 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __TestCpp__UIButtonTest_Editor__ -#define __TestCpp__UIButtonTest_Editor__ +#ifndef __CCGL_H__ +#define __CCGL_H__ -#include "../UIScene_Editor.h" -#include "BaseTest.h" +#include "platform/CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -DEFINE_TEST_SUITE(UIButtonEditorTests); +#define GL_WRITE_ONLY GL_WRITE_ONLY_OES +#define glMapBuffer glMapBufferOES +#define GL_BGRA GL_BGRA_EXT +#define glClearDepth glClearDepthf -class UIButtonTest_Editor : public UIScene_Editor -{ -public: - CREATE_FUNC(UIButtonTest_Editor); +//fixme, if Tizen 2.4, don't need these define, but Tizen 2.3 need them +//#define glGenVertexArrays glGenVertexArraysOES +//#define glDeleteVertexArrays glDeleteVertexArraysOES +//#define glUnmapBuffer glUnmapBufferOES +//#define glBindVertexArray glBindVertexArrayOES +//#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES - UIButtonTest_Editor(); - ~UIButtonTest_Editor(); - - virtual bool init() override; +#include - void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type); - virtual void configureGUIScene() override; +ELEMENTARY_GLVIEW_GLOBAL_DECLARE(); -protected: - cocos2d::ui::Text* _displayValueLabel; -}; +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -#endif /* defined(__TestCpp__UIButtonTest_Editor__) */ +#endif // __CCGL_H__ diff --git a/cocos/platform/tizen/CCGLViewImpl-tizen.cpp b/cocos/platform/tizen/CCGLViewImpl-tizen.cpp new file mode 100644 index 000000000000..ef8e51ca6c63 --- /dev/null +++ b/cocos/platform/tizen/CCGLViewImpl-tizen.cpp @@ -0,0 +1,217 @@ +/**************************************************************************** + 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" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#include "platform/tizen/CCGLViewImpl-tizen.h" +#include +#include +#include +#include +#include "platform/CCApplication.h" +#include "base/CCIMEDispatcher.h" +#include "base/CCDirector.h" + +NS_CC_BEGIN + +GLViewImpl* GLViewImpl::createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) +{ + auto ret = new GLViewImpl; + if(ret && ret->initWithRect(viewName, rect, frameZoomFactor)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLViewImpl* GLViewImpl::create(const std::string& viewName) +{ + auto ret = new GLViewImpl; + if(ret && ret->initWithFullScreen(viewName)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLViewImpl* GLViewImpl::createWithFullScreen(const std::string& viewName) +{ + auto ret = new GLViewImpl(); + if(ret && ret->initWithFullScreen(viewName)) { + ret->autorelease(); + return ret; + } + + return nullptr; +} + +GLViewImpl::GLViewImpl() +{ + +} + +GLViewImpl::~GLViewImpl() +{ + +} + +bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor) +{ + return true; +} + +bool GLViewImpl::initWithFullScreen(const std::string& viewName) +{ + return true; +} + + +bool GLViewImpl::isOpenGLReady() +{ + return (_screenSize.width != 0 && _screenSize.height != 0); +} + +void GLViewImpl::end() +{ + exit(0); +} + +void GLViewImpl::swapBuffers() +{ +} + +//============================================================================================ +static Evas_Object * s_keypadWin = nullptr; +static Evas_Object * s_keypadEntry = nullptr; +Ecore_IMF_Context *s_imf = nullptr; + +static void imfEventCommitCallback(void *data, Ecore_IMF_Context *ctx, void *event_info) +{ + auto commit_str = (char *)event_info; + if (commit_str) + { + cocos2d::IMEDispatcher::sharedDispatcher()->dispatchInsertText(commit_str, strlen(commit_str)); + } +} + +static void entryKeyCallback(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + auto keyInfo = (Evas_Event_Key_Up*)event_info; + if (keyInfo->key && !strcmp(keyInfo->key,"BackSpace")) + { + cocos2d::IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); + } +} + +static void stateChangedCallback(void *data, Ecore_IMF_Context *ctx, int value) +{ + if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) + { + evas_object_del(s_keypadWin); + s_keypadWin = nullptr; + s_imf = nullptr; + } +} + +static void closeKeypad() +{ + ecore_imf_context_input_panel_event_callback_add (s_imf, ECORE_IMF_INPUT_PANEL_STATE_EVENT, stateChangedCallback, NULL); + elm_entry_input_panel_hide(s_keypadEntry); +} + +static void entryActivatedCallback(void *data, Evas_Object *obj, void *event_info) +{ + closeKeypad(); +} + +static void keyPadBackCallback(void *data, Evas_Object *obj, void *event_info) +{ + closeKeypad(); +} + +static void blankAreaClickedCallback(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + closeKeypad(); +} + +void GLViewImpl::setIMEKeyboardState(bool open) +{ + if (open) + { + if (!s_keypadWin) + { + auto frameSize = Director::getInstance()->getOpenGLView()->getFrameSize(); + auto app = Application::getInstance(); + + s_keypadWin = elm_win_add(app->_win, "cocos2d-x textfield", ELM_WIN_BASIC); + elm_win_autodel_set(s_keypadWin, EINA_TRUE); + elm_win_conformant_set(s_keypadWin, EINA_TRUE); + elm_win_alpha_set(s_keypadWin, EINA_TRUE); + eext_object_event_callback_add(s_keypadWin, EEXT_CALLBACK_BACK, keyPadBackCallback, NULL); + evas_object_show(s_keypadWin); + + int rots[2]; + rots[0] = (int)elm_win_rotation_get(app->_win); + rots[1] = rots[0] + 180 % 360; + elm_win_wm_rotation_available_rotations_set(s_keypadWin, rots, 2); + + auto rectangle = elm_bg_add(s_keypadWin); + evas_object_resize(rectangle, frameSize.width, frameSize.height + 50); + evas_object_color_set(rectangle, 0xff, 0xff, 0xff, 0); + evas_object_move(rectangle, 0, -50); + evas_object_show(rectangle); + + evas_object_repeat_events_set(rectangle, EINA_TRUE); + evas_object_event_callback_add(rectangle, EVAS_CALLBACK_MOUSE_UP, blankAreaClickedCallback, NULL); + evas_object_event_callback_add(rectangle, EVAS_CALLBACK_MULTI_UP, blankAreaClickedCallback, NULL); + + s_keypadEntry = elm_entry_add(rectangle); + elm_entry_single_line_set(s_keypadEntry, EINA_TRUE); + evas_object_resize(s_keypadEntry, frameSize.width, 50); + evas_object_move(s_keypadEntry, 0, -50); + elm_entry_input_panel_return_key_type_set(s_keypadEntry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); + elm_entry_prediction_allow_set(s_keypadEntry, EINA_FALSE); + evas_object_event_callback_add(s_keypadEntry, EVAS_CALLBACK_KEY_UP, entryKeyCallback, NULL); + evas_object_show(s_keypadEntry); + + elm_object_focus_set(s_keypadEntry, EINA_TRUE); + evas_object_smart_callback_add(s_keypadEntry, "activated", entryActivatedCallback, NULL); + elm_entry_input_panel_show(s_keypadEntry); + + s_imf = (Ecore_IMF_Context*)elm_entry_imf_context_get(s_keypadEntry); + ecore_imf_context_event_callback_add(s_imf, ECORE_IMF_CALLBACK_COMMIT, imfEventCommitCallback, s_keypadEntry); + } + } + else if (s_keypadWin) + { + closeKeypad(); + } +} + +NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.h b/cocos/platform/tizen/CCGLViewImpl-tizen.h similarity index 55% rename from tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.h rename to cocos/platform/tizen/CCGLViewImpl-tizen.h index f95c377effae..b3f17031c0e6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.h +++ b/cocos/platform/tizen/CCGLViewImpl-tizen.h @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - + 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 @@ -22,27 +22,40 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __TestCpp__UICheckBoxTest_Editor__ -#define __TestCpp__UICheckBoxTest_Editor__ +#ifndef __CC_EGLVIEWIMPL_TIZEN_H__ +#define __CC_EGLVIEWIMPL_TIZEN_H__ -#include "../UIScene_Editor.h" +#include "platform/CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -DEFINE_TEST_SUITE(UICheckBoxEditorTests); +#include "platform/CCGLView.h" -class UICheckBoxTest_Editor : public UIScene_Editor +NS_CC_BEGIN + +class CC_DLL GLViewImpl : public GLView { public: - CREATE_FUNC(UICheckBoxTest_Editor); - UICheckBoxTest_Editor(); - ~UICheckBoxTest_Editor(); + // static function + static GLViewImpl* create(const std::string &viewname); + static GLViewImpl* createWithRect(const std::string& viewName, Rect rect, float frameZoomFactor = 1.0f); + static GLViewImpl* createWithFullScreen(const std::string& viewName); - virtual bool init() override; + bool isOpenGLReady() override; + void end() override; + void swapBuffers() override; + void setIMEKeyboardState(bool bOpen) override; - void selectedStateEvent(cocos2d::Ref* sender, cocos2d::ui::CheckBox::EventType type); - virtual void configureGUIScene() override; protected: - cocos2d::ui::Text* _displayValueLabel; + GLViewImpl(); + virtual ~GLViewImpl(); + + bool initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor); + bool initWithFullScreen(const std::string& viewName); }; -#endif /* defined(__TestCpp__UICheckBoxTest_Editor__) */ +NS_CC_END + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#endif // end of __CC_EGLVIEWIMPL_TIZEN_H__ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.h b/cocos/platform/tizen/CCPlatformDefine-tizen.h similarity index 68% rename from tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.h rename to cocos/platform/tizen/CCPlatformDefine-tizen.h index c3ae1887e6cb..5fcf0542763c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.h +++ b/cocos/platform/tizen/CCPlatformDefine-tizen.h @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - + 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 @@ -22,20 +22,30 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __TestCpp__UITextBMFontTest_Editor__ -#define __TestCpp__UITextBMFontTest_Editor__ +#ifndef __CCPLATFORMDEFINE_H__ +#define __CCPLATFORMDEFINE_H__ + +#include "platform/CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#include + +#define CC_DLL -#include "../UIScene_Editor.h" +#include +#define CC_ASSERT(cond) assert(cond) +#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam -DEFINE_TEST_SUITE(UITextBMFontEditorTest); -class UITextBMFontTest_Editor : public UIScene_Editor -{ -public: - CREATE_FUNC(UITextBMFontTest_Editor); +/* Define NULL pointer value */ +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif - virtual bool init() override; -protected: -}; +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -#endif /* defined(__TestCpp__UITextBMFontTest_Editor__) */ +#endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/platform/tizen/CCStdC-tizen.cpp b/cocos/platform/tizen/CCStdC-tizen.cpp new file mode 100644 index 000000000000..a0b94607d732 --- /dev/null +++ b/cocos/platform/tizen/CCStdC-tizen.cpp @@ -0,0 +1,72 @@ +/**************************************************************************** + 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" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN + +#include "platform/tizen/CCStdC-tizen.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) + +int CC_DLL gettimeofday(struct timeval * val, struct timezone *) +{ + if (val) + { + SYSTEMTIME wtm; + GetLocalTime(&wtm); + + struct tm tTm; + tTm.tm_year = wtm.wYear - 1900; + tTm.tm_mon = wtm.wMonth - 1; + tTm.tm_mday = wtm.wDay; + tTm.tm_hour = wtm.wHour; + tTm.tm_min = wtm.wMinute; + tTm.tm_sec = wtm.wSecond; + tTm.tm_isdst = -1; + + val->tv_sec = (long)mktime(&tTm); // time_t is 64-bit on win32 + val->tv_usec = wtm.wMilliseconds * 1000; + } + return 0; +} +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA) + +using namespace Osp::System; + +int CC_DLL gettimeofday(struct timeval * val, struct timezone *) +{ + if (val) + { + long long curTick = 0; + SystemTime::GetTicks(curTick); + unsigned int ms = curTick; + val->tv_sec = ms / 1000; + val->tv_usec = (ms % 1000) * 1000; + } + return 0; +} + +#endif // CC_PLATFORM_WIN32 + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.h b/cocos/platform/tizen/CCStdC-tizen.h similarity index 66% rename from tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.h rename to cocos/platform/tizen/CCStdC-tizen.h index dd296fd081e2..60419686a0b4 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.h +++ b/cocos/platform/tizen/CCStdC-tizen.h @@ -1,18 +1,18 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - + 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 @@ -22,26 +22,33 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __TestCpp__UIPageViewTest_Editor__ -#define __TestCpp__UIPageViewTest_Editor__ +#ifndef __CC_STD_C_H__ +#define __CC_STD_C_H__ + +#include "platform/CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -#include "../UIScene_Editor.h" +#include "platform/CCPlatformMacros.h" -DEFINE_TEST_SUITE(UIPageViewEditorTests); +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -class UIPageViewTest_Editor : public UIScene_Editor -{ -public: - CREATE_FUNC(UIPageViewTest_Editor); +#ifndef MIN +#define MIN(x,y) (((x) > (y)) ? (y) : (x)) +#endif // MIN - UIPageViewTest_Editor(); - ~UIPageViewTest_Editor(); +#ifndef MAX +#define MAX(x,y) (((x) < (y)) ? (y) : (x)) +#endif // MAX - virtual bool init() override; - - void pageViewEvent(cocos2d::Ref* sender, cocos2d::ui::PageView::EventType type); -protected: - cocos2d::ui::Text* _displayValueLabel; -}; +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN -#endif /* defined(__TestCpp__UIPageViewTest_Editor__) */ +#endif // __CC_STD_C_H__ diff --git a/cocos/platform/win32/CCDevice-win32.cpp b/cocos/platform/win32/CCDevice-win32.cpp index fe8bd50b16d3..20bb284cefeb 100644 --- a/cocos/platform/win32/CCDevice-win32.cpp +++ b/cocos/platform/win32/CCDevice-win32.cpp @@ -99,7 +99,7 @@ class BitmapDC } - bool setFont(const char * pFontName = nullptr, int nSize = 0) + bool setFont(const char * pFontName = "", int nSize = 0) { bool bRet = false; do @@ -110,7 +110,7 @@ class BitmapDC LOGFONTA tNewFont = {0}; LOGFONTA tOldFont = {0}; GetObjectA(hDefFont, sizeof(tNewFont), &tNewFont); - if (fontName.c_str()) + if (!fontName.empty()) { // create font from ttf file if (FileUtils::getInstance()->getFileExtension(fontName) == ".ttf") diff --git a/cocos/platform/winrt/CCFileUtilsWinRT.cpp b/cocos/platform/winrt/CCFileUtilsWinRT.cpp index cd2d2df3301c..5827a0cc3128 100644 --- a/cocos/platform/winrt/CCFileUtilsWinRT.cpp +++ b/cocos/platform/winrt/CCFileUtilsWinRT.cpp @@ -36,8 +36,8 @@ static std::string s_pszResourcePath; static inline std::string convertPathFormatToUnixStyle(const std::string& path) { std::string ret = path; - int len = ret.length(); - for (int i = 0; i < len; ++i) + size_t len = ret.length(); + for (size_t i = 0; i < len; ++i) { if (ret[i] == '\\') { diff --git a/cocos/platform/winrt/CCFreeTypeFont.cpp b/cocos/platform/winrt/CCFreeTypeFont.cpp index a443dd85fb83..0e7b373abcdd 100644 --- a/cocos/platform/winrt/CCFreeTypeFont.cpp +++ b/cocos/platform/winrt/CCFreeTypeFont.cpp @@ -8,10 +8,10 @@ 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 @@ -42,14 +42,14 @@ static FT_Library s_FreeTypeLibrary = nullptr; const std::string CCFreeTypeFont::DEFAULT_FONT = "arial"; -CCFreeTypeFont::CCFreeTypeFont() +CCFreeTypeFont::CCFreeTypeFont() :m_space(" ") , m_face(nullptr) { } -CCFreeTypeFont::~CCFreeTypeFont() +CCFreeTypeFont::~CCFreeTypeFont() { reset(); } @@ -92,14 +92,14 @@ unsigned char* CCFreeTypeFont::initWithString(const char * text, const FontDefin #if 0 // check the cache for the font file buffer auto ittFontNames = s_fontsNames.find(textDefinition._fontName); - if(ittFontNames != s_fontsNames.end()) + if(ittFontNames != s_fontsNames.end()) { pBuffer = ittFontNames->second.pBuffer; size = ittFontNames->second.size; - } + } #endif // 0 - + if(!pBuffer) { // attempt to load font from Resources fonts folder @@ -130,7 +130,7 @@ unsigned char* CCFreeTypeFont::initWithString(const char * text, const FontDefin FontBufferInfo info; info.pBuffer = pBuffer; info.size = size; - s_fontsNames[textDefinition._fontName]=info; + s_fontsNames[textDefinition._fontName]=info; #endif // 0 } @@ -183,7 +183,7 @@ unsigned char* CCFreeTypeFont::getBitmap(Device::TextAlign eAlignMask, int &widt m_width = m_inWidth ? m_inWidth : m_textWidth; m_height = m_inHeight ? m_inHeight : m_textHeight; - + unsigned int size = m_width * m_height * 4; unsigned char* pBuffer = new unsigned char[size]; dataLength = size; @@ -210,7 +210,7 @@ FT_Vector CCFreeTypeFont::getPenForAlignment(FTLineInfo* pInfo, Device::TextAlig { FT_Error error = 0; FT_Vector pen; - + int top; int stringWidth = pInfo->bbox.xMax - pInfo->bbox.xMin; int maxLineNumber = totalLines - 1; @@ -221,19 +221,19 @@ FT_Vector CCFreeTypeFont::getPenForAlignment(FTLineInfo* pInfo, Device::TextAlig { case Device::TextAlign::TOP: // Horizontal center and vertical top. pen.x = ((m_width - stringWidth) / 2) - pInfo->bbox.xMin; - pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight); + pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight); break; - + case Device::TextAlign::TOP_LEFT: // Horizontal left and vertical top. pen.x -=pInfo->bbox.xMin; - pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight); + pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight); break; case Device::TextAlign::TOP_RIGHT: // Horizontal right and vertical top. pen.x = m_width - stringWidth - pInfo->bbox.xMin; - pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight); + pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight); break; - + case Device::TextAlign::BOTTOM_RIGHT: // Horizontal right and vertical bottom. pen.x = m_width - stringWidth - pInfo->bbox.xMin; pen.y = m_height + pInfo->bbox.yMin - ((maxLineNumber - lineNumber) * m_lineHeight); @@ -253,20 +253,20 @@ FT_Vector CCFreeTypeFont::getPenForAlignment(FTLineInfo* pInfo, Device::TextAlig case Device::TextAlign::CENTER: // Horizontal center and vertical center pen.x = ((m_width - stringWidth) / 2) - pInfo->bbox.xMin; top = (m_height - m_textHeight) / 2; - pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax; + pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax; break; case Device::TextAlign::RIGHT: // Horizontal right and vertical center. pen.x = m_width - stringWidth - pInfo->bbox.xMin; top = (m_height - m_textHeight) / 2; - pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax; + pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax; break; case Device::TextAlign::LEFT: // Horizontal left and vertical center. default: pen.x -=pInfo->bbox.xMin; top = (m_height - m_textHeight) / 2; - pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax; + pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax; break; } @@ -316,10 +316,10 @@ void CCFreeTypeFont::draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap, FT_ pBuffer[index++] = value * fontAlpha; } } - } + } } -void CCFreeTypeFont::endLine() +void CCFreeTypeFont::endLine() { if(m_currentLine) { @@ -329,7 +329,7 @@ void CCFreeTypeFont::endLine() } } -void CCFreeTypeFont::newLine() +void CCFreeTypeFont::newLine() { m_currentLine = new FTLineInfo(); m_currentLine->width = 0; @@ -338,24 +338,24 @@ void CCFreeTypeFont::newLine() } -FT_Error CCFreeTypeFont::addWord(const std::string& word) +FT_Error CCFreeTypeFont::addWord(const std::string& word) { std::vector glyphs; // glyphs for the word FT_BBox bbox; // bounding box containing all of the glyphs in the word int maxWidth = m_inWidth ? m_inWidth : m_windowWidth; std::string newWord; - if(m_currentLine->width > 0) + if(m_currentLine->width > 0) { newWord = ' ' + word; - } + } else { newWord = word; } FT_Error error = initWordGlyphs(glyphs, newWord, m_currentLine->pen); - if(!error) + if(!error) { compute_bbox(glyphs, &bbox); if(m_currentLine->width == 0 || bbox.xMax <= maxWidth) @@ -371,7 +371,7 @@ FT_Error CCFreeTypeFont::addWord(const std::string& word) } m_currentLine->width = m_currentLine->bbox.xMax - m_currentLine->bbox.xMin; } - else + else { endLine(); newLine(); @@ -381,7 +381,7 @@ FT_Error CCFreeTypeFont::addWord(const std::string& word) return error; } -FT_Error CCFreeTypeFont::initGlyphs(const char* text) +FT_Error CCFreeTypeFont::initGlyphs(const char* text) { FT_Error error = 0; std::stringstream stringStream(text); @@ -396,7 +396,7 @@ FT_Error CCFreeTypeFont::initGlyphs(const char* text) m_lines.clear(); - while(std::getline(stringStream, line) && !error) + while(std::getline(stringStream, line) && !error) { newLine(); @@ -422,14 +422,14 @@ FT_Error CCFreeTypeFont::initGlyphs(const char* text) // if linewidth > m_inWidth // get words for line -void CCFreeTypeFont::initWords(const char* text) +void CCFreeTypeFont::initWords(const char* text) { std::stringstream stringStream(text); std::string line; vector lines; vector words; - while(std::getline(stringStream, line)) + while(std::getline(stringStream, line)) { lines.push_back(line); } @@ -453,9 +453,9 @@ void CCFreeTypeFont::initWords(const char* text) } } -FT_Error CCFreeTypeFont::initWordGlyphs(std::vector& glyphs, const std::string& text, FT_Vector& pen) +FT_Error CCFreeTypeFont::initWordGlyphs(std::vector& glyphs, const std::string& text, FT_Vector& pen) { - FT_GlyphSlot slot = m_face->glyph; + FT_GlyphSlot slot = m_face->glyph; FT_UInt glyph_index; FT_UInt previous = 0; FT_Error error = 0; @@ -464,15 +464,15 @@ FT_Error CCFreeTypeFont::initWordGlyphs(std::vector& glyphs, const std:: wchar_t * pwszBuffer = nullptr; int num_chars = text.size(); - int nBufLen = num_chars + 1; + int nBufLen = num_chars + 1; pwszBuffer = new wchar_t[nBufLen]; if(!pwszBuffer) { return -1; } - + memset(pwszBuffer,0,nBufLen); - num_chars = MultiByteToWideChar(CP_UTF8, 0, text.c_str(), num_chars, pwszBuffer, nBufLen); + num_chars = MultiByteToWideChar(CP_UTF8, 0, text.c_str(), num_chars, pwszBuffer, nBufLen); pwszBuffer[num_chars] = '\0'; glyphs.clear(); @@ -571,12 +571,12 @@ void CCFreeTypeFont::compute_bbox(std::vector& glyphs, FT_BBox *abbox) bbox.xMax = 0; bbox.yMax = 0; } - + /* return string bbox */ *abbox = bbox; } -unsigned char* CCFreeTypeFont::loadFont(const char *pFontName, ssize_t *size) +unsigned char* CCFreeTypeFont::loadFont(const char *pFontName, ssize_t *size) { @@ -611,10 +611,12 @@ unsigned char* CCFreeTypeFont::loadFont(const char *pFontName, ssize_t *size) return nullptr; } - return FileUtils::getInstance()->getFileData(fullpath.c_str(), "rb", size); + Data d; + FileUtils::getInstance()->getContents(fullpath, &d); + return d.takeBuffer(size); } -unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t *size) +unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t *size) { std::string aName(pFontName); unsigned char* pBuffer = nullptr; @@ -631,9 +633,9 @@ unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t *si BOOL exists; std::wstring fontNameW; const void *fontFileReferenceKey = nullptr; - UINT32 fontFileReferenceKeySize; + UINT32 fontFileReferenceKeySize; void *fragmentContext = nullptr; - + for (unsigned int i = 0; i < aName.length(); ++i) { aName[i] = tolower(aName[i]); @@ -649,7 +651,7 @@ unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t *si hr = writeFactory->GetSystemFontCollection(&fontCollection, TRUE); } - //get the font + //get the font if(SUCCEEDED(hr)) { hr = fontCollection->FindFamilyName(fontNameW.c_str(), &index, &exists); @@ -704,7 +706,7 @@ unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t *si if(SUCCEEDED(hr)) { pBuffer = (unsigned char*)malloc((size_t)fileSize); - memcpy(pBuffer, fragmentStart, (size_t)fileSize); + memcpy(pBuffer, fragmentStart, (size_t)fileSize); *size = (unsigned long)fileSize; } } @@ -750,4 +752,3 @@ unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t *si } NS_CC_END - diff --git a/cocos/platform/winrt/CCGLViewImpl-winrt.cpp b/cocos/platform/winrt/CCGLViewImpl-winrt.cpp index 25b35eebb65f..7276a8779b4e 100644 --- a/cocos/platform/winrt/CCGLViewImpl-winrt.cpp +++ b/cocos/platform/winrt/CCGLViewImpl-winrt.cpp @@ -32,9 +32,7 @@ THE SOFTWARE. #include "platform/winrt/CCApplication.h" #include "platform/winrt/CCWinRTUtils.h" #include "deprecated/CCNotificationCenter.h" -#include "base/CCDirector.h" #include "base/CCEventDispatcher.h" -#include "base/CCIMEDispatcher.h" #include "base/CCEventMouse.h" #include diff --git a/cocos/platform/winrt/CCGLViewImpl.h b/cocos/platform/winrt/CCGLViewImpl.h index 3ff351f8da69..e39cf91b1f31 100644 --- a/cocos/platform/winrt/CCGLViewImpl.h +++ b/cocos/platform/winrt/CCGLViewImpl.h @@ -34,7 +34,6 @@ THE SOFTWARE. #include "platform/CCCommon.h" #include "platform/winrt/InputEvent.h" #include "platform/CCGLView.h" -#include #include diff --git a/cocos/platform/winrt/CCStdC.h b/cocos/platform/winrt/CCStdC.h index 9c114b961240..4a058164dca9 100644 --- a/cocos/platform/winrt/CCStdC.h +++ b/cocos/platform/winrt/CCStdC.h @@ -33,6 +33,7 @@ THE SOFTWARE. #include "platform/CCPlatformMacros.h" #include #include +#include #ifndef __SSIZE_T #define __SSIZE_T @@ -45,10 +46,6 @@ typedef SSIZE_T ssize_t; #define _USE_MATH_DEFINES // make M_PI can be use #endif -#if !defined(isnan) - #define isnan _isnan -#endif - #if _MSC_VER < 1900 #ifndef snprintf #define snprintf _snprintf diff --git a/cocos/platform/winrt/CCWinRTUtils.cpp b/cocos/platform/winrt/CCWinRTUtils.cpp index c1e0352b04f4..64895b84d5e3 100644 --- a/cocos/platform/winrt/CCWinRTUtils.cpp +++ b/cocos/platform/winrt/CCWinRTUtils.cpp @@ -321,8 +321,7 @@ Concurrency::task^> ReadDataAsync(Platform::String^ path) std::string computeHashForFile(const std::string& filePath) { std::string ret = filePath; - int pos = std::string::npos; - pos = ret.find_last_of('/'); + size_t pos = ret.find_last_of('/'); if (pos != std::string::npos) { ret = ret.substr(pos); diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index c7ce12d3d8f0..dd9314e479c7 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -349,7 +349,7 @@ void GLProgram::parseVertexAttribs() else { GLchar ErrorLog[1024]; - glGetProgramInfoLog(_program, sizeof(ErrorLog), NULL, ErrorLog); + glGetProgramInfoLog(_program, sizeof(ErrorLog), nullptr, ErrorLog); CCLOG("Error linking shader program: '%s'\n", ErrorLog); } } @@ -407,7 +407,7 @@ void GLProgram::parseUniforms() else { GLchar ErrorLog[1024]; - glGetProgramInfoLog(_program, sizeof(ErrorLog), NULL, ErrorLog); + glGetProgramInfoLog(_program, sizeof(ErrorLog), nullptr, ErrorLog); CCLOG("Error linking shader program: '%s'\n", ErrorLog); } diff --git a/cocos/renderer/CCGLProgramCache.cpp b/cocos/renderer/CCGLProgramCache.cpp index 59cf71edaa2c..287e25180eb3 100644 --- a/cocos/renderer/CCGLProgramCache.cpp +++ b/cocos/renderer/CCGLProgramCache.cpp @@ -49,7 +49,7 @@ enum { kShaderType_PositionTexture_uColor, kShaderType_PositionTextureA8Color, kShaderType_Position_uColor, - kShaderType_PositionLengthTexureColor, + kShaderType_PositionLengthTextureColor, kShaderType_LabelDistanceFieldNormal, kShaderType_LabelDistanceFieldGlow, kShaderType_UIGrayScale, @@ -71,7 +71,7 @@ enum { kShaderType_MAX, }; -static GLProgramCache *_sharedGLProgramCache = 0; +static GLProgramCache *_sharedGLProgramCache = nullptr; GLProgramCache* GLProgramCache::getInstance() { @@ -202,7 +202,7 @@ void GLProgramCache::loadDefaultGLPrograms() // Position, Length(TexCoords, Color (used by Draw Node basically ) // p = new (std::nothrow) GLProgram(); - loadDefaultGLProgram(p, kShaderType_PositionLengthTexureColor); + loadDefaultGLProgram(p, kShaderType_PositionLengthTextureColor); _programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR, p) ); p = new (std::nothrow) GLProgram(); @@ -352,7 +352,7 @@ void GLProgramCache::reloadDefaultGLPrograms() // p = getGLProgram(GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR); p->reset(); - loadDefaultGLProgram(p, kShaderType_PositionLengthTexureColor); + loadDefaultGLProgram(p, kShaderType_PositionLengthTextureColor); p = getGLProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL); p->reset(); @@ -487,7 +487,7 @@ void GLProgramCache::loadDefaultGLProgram(GLProgram *p, int type) p->initWithByteArrays(ccPosition_uColor_vert, ccPosition_uColor_frag); p->bindAttribLocation("aVertex", GLProgram::VERTEX_ATTRIB_POSITION); break; - case kShaderType_PositionLengthTexureColor: + case kShaderType_PositionLengthTextureColor: p->initWithByteArrays(ccPositionColorLengthTexture_vert, ccPositionColorLengthTexture_frag); break; case kShaderType_LabelDistanceFieldNormal: diff --git a/cocos/renderer/CCMeshCommand.cpp b/cocos/renderer/CCMeshCommand.cpp index 70bf6dce06dd..a7454b21173e 100644 --- a/cocos/renderer/CCMeshCommand.cpp +++ b/cocos/renderer/CCMeshCommand.cpp @@ -30,14 +30,12 @@ #include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" #include "base/CCEventType.h" -#include "base/CCConfiguration.h" #include "2d/CCLight.h" #include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCRenderer.h" #include "renderer/CCTextureAtlas.h" #include "renderer/CCTexture2D.h" -#include "renderer/ccGLStateCache.h" #include "renderer/CCTechnique.h" #include "renderer/CCMaterial.h" #include "renderer/CCPass.h" diff --git a/cocos/renderer/CCQuadCommand.cpp b/cocos/renderer/CCQuadCommand.cpp index 9467eb2c28b1..b7762e34d64d 100644 --- a/cocos/renderer/CCQuadCommand.cpp +++ b/cocos/renderer/CCQuadCommand.cpp @@ -39,13 +39,18 @@ NS_CC_BEGIN int QuadCommand::__indexCapacity = -1; GLushort* QuadCommand::__indices = nullptr; -QuadCommand::QuadCommand() -: _indexSize(-1) +QuadCommand::QuadCommand(): +_indexSize(-1), +_ownedIndices() { } QuadCommand::~QuadCommand() { + for (auto& indices : _ownedIndices) + { + CC_SAFE_DELETE_ARRAY(indices); + } } void QuadCommand::init(float globalOrder, GLuint textureID, GLProgramState* glProgramState, const BlendFunc& blendType, V3F_C4B_T2F_Quad* quads, ssize_t quadCount, @@ -70,7 +75,8 @@ void QuadCommand::reIndex(int indicesCount) if (indicesCount > __indexCapacity) { CCLOG("cocos2d: QuadCommand: resizing index size from [%d] to [%d]", __indexCapacity, indicesCount); - __indices = (GLushort*) realloc(__indices, indicesCount * sizeof(__indices[0])); + _ownedIndices.push_back(__indices); + __indices = new (std::nothrow) GLushort[indicesCount]; __indexCapacity = indicesCount; } diff --git a/cocos/renderer/CCQuadCommand.h b/cocos/renderer/CCQuadCommand.h index e54674a238b2..7bec874e18b5 100644 --- a/cocos/renderer/CCQuadCommand.h +++ b/cocos/renderer/CCQuadCommand.h @@ -25,6 +25,8 @@ #ifndef _CC_QUADCOMMAND_H_ #define _CC_QUADCOMMAND_H_ +#include + #include "renderer/CCTrianglesCommand.h" #include "renderer/CCGLProgramState.h" @@ -69,6 +71,7 @@ class CC_DLL QuadCommand : public TrianglesCommand void reIndex(int indices); int _indexSize; + std::vector _ownedIndices; // shared across all instances static int __indexCapacity; diff --git a/cocos/renderer/CCRenderState.cpp b/cocos/renderer/CCRenderState.cpp index 6f148038da9e..009794a2f017 100644 --- a/cocos/renderer/CCRenderState.cpp +++ b/cocos/renderer/CCRenderState.cpp @@ -55,7 +55,7 @@ RenderState::~RenderState() void RenderState::initialize() { - if (StateBlock::_defaultState == NULL) + if (StateBlock::_defaultState == nullptr) { StateBlock::_defaultState = StateBlock::create(); CC_SAFE_RETAIN(StateBlock::_defaultState); @@ -121,7 +121,7 @@ void RenderState::bind(Pass* pass) StateBlock::restore(stateOverrideBits); // Apply renderer state for the entire hierarchy, top-down. - rs = NULL; + rs = nullptr; while ((rs = getTopmost(rs))) { if (rs->_state) @@ -137,12 +137,12 @@ RenderState* RenderState::getTopmost(RenderState* below) if (rs == below) { // Nothing below ourself. - return NULL; + return nullptr; } while (rs) { - if (rs->_parent == below || rs->_parent == NULL) + if (rs->_parent == below || rs->_parent == nullptr) { // Stop traversing up here. return rs; @@ -150,7 +150,7 @@ RenderState* RenderState::getTopmost(RenderState* below) rs = rs->_parent; } - return NULL; + return nullptr; } RenderState::StateBlock* RenderState::getStateBlock() const diff --git a/cocos/renderer/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp index 20e0bd353347..00995c7d8b39 100644 --- a/cocos/renderer/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -93,11 +93,12 @@ std::string TextureCache::getDescription() const struct TextureCache::AsyncStruct { public: - AsyncStruct(const std::string& fn, std::function f) : filename(fn), callback(f), loadSuccess(false) {} + AsyncStruct(const std::string& fn, std::function f) : filename(fn), callback(f), pixelFormat(Texture2D::getDefaultAlphaPixelFormat()), loadSuccess(false) {} std::string filename; std::function callback; Image image; + Texture2D::PixelFormat pixelFormat; bool loadSuccess; }; @@ -280,7 +281,7 @@ void TextureCache::addImageAsyncCallBack(float dt) // generate texture in render thread texture = new (std::nothrow) Texture2D(); - texture->initWithImage(image); + texture->initWithImage(image, asyncStruct->pixelFormat); //parse 9-patch info this->parseNinePatchImage(image, texture, asyncStruct->filename); #if CC_ENABLE_CACHE_TEXTURE_DATA @@ -600,7 +601,7 @@ std::string TextureCache::getCachedTextureInfo() const return buffer; } -void TextureCache::renameTextureWithKey(const std::string srcName, const std::string dstName) +void TextureCache::renameTextureWithKey(const std::string& srcName, const std::string& dstName) { std::string key = srcName; auto it = _textures.find(key); @@ -679,7 +680,7 @@ void VolatileTextureMgr::addImage(Texture2D *tt, Image *image) VolatileTexture* VolatileTextureMgr::findVolotileTexture(Texture2D *tt) { - VolatileTexture *vt = 0; + VolatileTexture *vt = nullptr; auto i = _textures.begin(); while (i != _textures.end()) { diff --git a/cocos/renderer/CCTextureCache.h b/cocos/renderer/CCTextureCache.h index 4225fb98a880..56ccc6694cec 100644 --- a/cocos/renderer/CCTextureCache.h +++ b/cocos/renderer/CCTextureCache.h @@ -28,7 +28,6 @@ THE SOFTWARE. #ifndef __CCTEXTURE_CACHE_H__ #define __CCTEXTURE_CACHE_H__ -#include #include #include #include @@ -42,7 +41,6 @@ THE SOFTWARE. #include "platform/CCImage.h" #if CC_ENABLE_CACHE_TEXTURE_DATA - #include "platform/CCImage.h" #include #endif @@ -212,7 +210,7 @@ class CC_DLL TextureCache : public Ref * * @since v3.10 */ - void renameTextureWithKey(const std::string srcName, const std::string dstName); + void renameTextureWithKey(const std::string& srcName, const std::string& dstName); private: diff --git a/cocos/renderer/ccGLStateCache.cpp b/cocos/renderer/ccGLStateCache.cpp index 477976db82bf..d801b7ac7922 100644 --- a/cocos/renderer/ccGLStateCache.cpp +++ b/cocos/renderer/ccGLStateCache.cpp @@ -119,7 +119,7 @@ static void SetBlending(GLenum sfactor, GLenum dfactor) RenderState::StateBlock::_defaultState->setBlend(true); RenderState::StateBlock::_defaultState->setBlendSrc((RenderState::Blend)sfactor); - RenderState::StateBlock::_defaultState->setBlendSrc((RenderState::Blend)dfactor); + RenderState::StateBlock::_defaultState->setBlendDst((RenderState::Blend)dfactor); } } 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 b07726515993..68c88635b0c4 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 @@ -3910,6 +3910,16 @@ bool { }, +/** + * @method setPNGPremultipliedAlphaEnabled + * @param {bool} arg0 + */ +setPNGPremultipliedAlphaEnabled : function ( +bool +) +{ +}, + /** * @method Image * @constructor diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_webView_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_webView_auto_api.js index b6d3825c063d..df796ebfae0e 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_webView_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_webView_auto_api.js @@ -86,6 +86,16 @@ str { }, +/** + * @method setBounces + * @param {bool} arg0 + */ +setBounces : function ( +bool +) +{ +}, + /** * @method evaluateJS * @param {String} arg0 diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_studio_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_studio_auto_api.js index ffc29633140f..6588133ca16d 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_studio_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_studio_auto_api.js @@ -232,6 +232,16 @@ char return ccs.ActionObject; }, +/** + * @method getStudioVersionNumber + * @return {int} + */ +getStudioVersionNumber : function ( +) +{ + return 0; +}, + /** * @method initWithBinary * @param {char} arg0 diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js index 30437f3c5fe8..279cce4d64a9 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js @@ -3599,6 +3599,16 @@ widget { }, +/** + * @method setCurSelectedIndex + * @param {int} arg0 + */ +setCurSelectedIndex : function ( +int +) +{ +}, + /** * @method insertDefaultItem * @param {long} arg0 @@ -5029,6 +5039,14 @@ int { }, +/** + * @method removeAllPages + */ +removeAllPages : function ( +) +{ +}, + /** * @method setAutoScrollStopEpsilon * @param {float} arg0 @@ -5039,6 +5057,16 @@ float { }, +/** + * @method setIndicatorIndexNodesScale + * @param {float} arg0 + */ +setIndicatorIndexNodesScale : function ( +float +) +{ +}, + /** * @method setIndicatorEnabled * @param {bool} arg0 @@ -5089,6 +5117,16 @@ long { }, +/** + * @method getIndicatorIndexNodesColor + * @return {color3b_object} + */ +getIndicatorIndexNodesColor : function ( +) +{ + return cc.Color3B; +}, + /** * @method getIndicatorSelectedIndexColor * @return {color3b_object} @@ -5099,6 +5137,16 @@ getIndicatorSelectedIndexColor : function ( return cc.Color3B; }, +/** + * @method getIndicatorIndexNodesScale + * @return {float} + */ +getIndicatorIndexNodesScale : function ( +) +{ + return 0; +}, + /** * @method setIndicatorPosition * @param {vec2_object} arg0 @@ -5140,9 +5188,11 @@ long }, /** - * @method removeAllPages + * @method setIndicatorIndexNodesColor + * @param {color3b_object} arg0 */ -removeAllPages : function ( +setIndicatorIndexNodesColor : function ( +color3b ) { }, @@ -5177,6 +5227,18 @@ widget { }, +/** + * @method setIndicatorIndexNodesTexture + * @param {String} arg0 + * @param {ccui.Widget::TextureResType} arg1 + */ +setIndicatorIndexNodesTexture : function ( +str, +texturerestype +) +{ +}, + /** * @method getIndicatorEnabled * @return {bool} 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 4df4644ebd21..32abd94278de 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp @@ -250,7 +250,7 @@ bool js_cocos2dx_3d_Animate3D_setWeight(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Animate3D_setWeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_setWeight : Error processing arguments"); cobj->setWeight(arg0); args.rval().setUndefined(); @@ -300,7 +300,7 @@ bool js_cocos2dx_3d_Animate3D_initWithFrames(JSContext *cx, uint32_t argc, jsval } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_initWithFrames : Error processing arguments"); bool ret = cobj->initWithFrames(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -340,7 +340,7 @@ bool js_cocos2dx_3d_Animate3D_setSpeed(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Animate3D_setSpeed : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_setSpeed : Error processing arguments"); cobj->setSpeed(arg0); args.rval().setUndefined(); @@ -375,10 +375,10 @@ bool js_cocos2dx_3d_Animate3D_init(JSContext *cx, uint32_t argc, jsval *vp) } while (0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } bool ret = cobj->init(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -422,7 +422,7 @@ bool js_cocos2dx_3d_Animate3D_setOriginInterval(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Animate3D_setOriginInterval : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_setOriginInterval : Error processing arguments"); cobj->setOriginInterval(arg0); args.rval().setUndefined(); @@ -487,10 +487,10 @@ bool js_cocos2dx_3d_Animate3D_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -589,7 +589,7 @@ bool js_cocos2dx_3d_Animate3D_createWithFrames(JSContext *cx, uint32_t argc, jsv } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_createWithFrames : Error processing arguments"); auto ret = cocos2d::Animate3D::createWithFrames(arg0, arg1, arg2, arg3); @@ -608,7 +608,7 @@ bool js_cocos2dx_3d_Animate3D_setTransitionTime(JSContext *cx, uint32_t argc, js bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_setTransitionTime : Error processing arguments"); cocos2d::Animate3D::setTransitionTime(arg0); args.rval().setUndefined(); @@ -3497,7 +3497,7 @@ bool js_cocos2dx_3d_Terrain_setSkirtHeightRatio(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Terrain_setSkirtHeightRatio : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Terrain_setSkirtHeightRatio : Error processing arguments"); cobj->setSkirtHeightRatio(arg0); args.rval().setUndefined(); @@ -3616,10 +3616,10 @@ bool js_cocos2dx_3d_Terrain_getHeight(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double ret = cobj->getHeight(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -3632,10 +3632,10 @@ bool js_cocos2dx_3d_Terrain_getHeight(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::Vec3* arg2 = nullptr; do { @@ -3695,9 +3695,9 @@ bool js_cocos2dx_3d_Terrain_setLODDistance(JSContext *cx, uint32_t argc, jsval * double arg0 = 0; double arg1 = 0; double arg2 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Terrain_setLODDistance : Error processing arguments"); cobj->setLODDistance(arg0, arg1, arg2); args.rval().setUndefined(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_extension_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_extension_auto.cpp index 1779298dac2f..74c49e8556e4 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_extension_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_extension_auto.cpp @@ -573,7 +573,7 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_forceUpdate(JSContext *cx, uint JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_forceUpdate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_forceUpdate : Error processing arguments"); cobj->forceUpdate(arg0); args.rval().setUndefined(); @@ -727,7 +727,7 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultWidth(JSContext *cx, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultWidth : Error processing arguments"); cobj->setDefaultWidth(arg0); args.rval().setUndefined(); @@ -817,7 +817,7 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_setMaxVelocity(JSContext *cx, u JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setMaxVelocity : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setMaxVelocity : Error processing arguments"); cobj->setMaxVelocity(arg0); args.rval().setUndefined(); @@ -927,7 +927,7 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_setParticleSystemScaleVelocity( JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setParticleSystemScaleVelocity : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setParticleSystemScaleVelocity : Error processing arguments"); cobj->setParticleSystemScaleVelocity(arg0); args.rval().setUndefined(); @@ -965,7 +965,7 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultHeight(JSContext *cx, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultHeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultHeight : Error processing arguments"); cobj->setDefaultHeight(arg0); args.rval().setUndefined(); @@ -1023,7 +1023,7 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultDepth(JSContext *cx, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultDepth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_extension_PUParticleSystem3D_setDefaultDepth : Error processing arguments"); cobj->setDefaultDepth(arg0); args.rval().setUndefined(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp index 2d511b549247..42d301e41569 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp @@ -99,7 +99,7 @@ bool js_cocos2dx_audioengine_AudioProfile_set_minDelay(JSContext *cx, uint32_t a bool ok = true; double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioProfile_set_minDelay : Error processing new value"); cobj->minDelay = arg0; return true; @@ -211,7 +211,7 @@ bool js_cocos2dx_audioengine_AudioEngine_setCurrentTime(JSContext *cx, uint32_t int arg0 = 0; double arg1 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_setCurrentTime : Error processing arguments"); bool ret = cocos2d::experimental::AudioEngine::setCurrentTime(arg0, arg1); @@ -415,7 +415,7 @@ bool js_cocos2dx_audioengine_AudioEngine_setVolume(JSContext *cx, uint32_t argc, int arg0 = 0; double arg1 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_setVolume : Error processing arguments"); cocos2d::experimental::AudioEngine::setVolume(arg0, arg1); args.rval().setUndefined(); @@ -511,7 +511,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js double arg2 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); arg1 = JS::ToBoolean(args.get(1)); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_play2d : Error processing arguments"); int ret = cocos2d::experimental::AudioEngine::play2d(arg0, arg1, arg2); @@ -527,7 +527,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js const cocos2d::experimental::AudioProfile* arg3 = nullptr; ok &= jsval_to_std_string(cx, args.get(0), &arg0); arg1 = JS::ToBoolean(args.get(1)); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); do { if (args.get(3).isNull()) { arg3 = nullptr; break; } if (!args.get(3).isObject()) { ok = false; break; } diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index cf5215cb48ed..8ea8b5dcdbaf 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -363,7 +363,7 @@ bool js_cocos2dx_Texture2D_initWithString(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } bool ret = cobj->initWithString(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -382,7 +382,7 @@ bool js_cocos2dx_Texture2D_initWithString(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Size arg3; ok &= jsval_to_ccsize(cx, args.get(3), &arg3); @@ -404,7 +404,7 @@ bool js_cocos2dx_Texture2D_initWithString(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Size arg3; ok &= jsval_to_ccsize(cx, args.get(3), &arg3); @@ -429,7 +429,7 @@ bool js_cocos2dx_Texture2D_initWithString(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Size arg3; ok &= jsval_to_ccsize(cx, args.get(3), &arg3); @@ -461,7 +461,7 @@ bool js_cocos2dx_Texture2D_setMaxT(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Texture2D_setMaxT : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Texture2D_setMaxT : Error processing arguments"); cobj->setMaxT(arg0); args.rval().setUndefined(); @@ -695,7 +695,7 @@ bool js_cocos2dx_Texture2D_setMaxS(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Texture2D_setMaxS : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Texture2D_setMaxS : Error processing arguments"); cobj->setMaxS(arg0); args.rval().setUndefined(); @@ -971,16 +971,16 @@ bool js_cocos2dx_Touch_setTouchInfo(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); if (!ok) { ok = true; break; } double arg4 = 0; - ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); if (!ok) { ok = true; break; } cobj->setTouchInfo(arg0, arg1, arg2, arg3, arg4); args.rval().setUndefined(); @@ -994,10 +994,10 @@ bool js_cocos2dx_Touch_setTouchInfo(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj->setTouchInfo(arg0, arg1, arg2); args.rval().setUndefined(); @@ -1390,7 +1390,7 @@ bool js_cocos2dx_ComponentContainer_visit(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ComponentContainer_visit : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ComponentContainer_visit : Error processing arguments"); cobj->visit(arg0); args.rval().setUndefined(); @@ -2280,7 +2280,7 @@ bool js_cocos2dx_Node_setRotation(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setRotation : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setRotation : Error processing arguments"); cobj->setRotation(arg0); args.rval().setUndefined(); @@ -2300,7 +2300,7 @@ bool js_cocos2dx_Node_setScaleZ(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setScaleZ : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setScaleZ : Error processing arguments"); cobj->setScaleZ(arg0); args.rval().setUndefined(); @@ -2320,7 +2320,7 @@ bool js_cocos2dx_Node_setScaleY(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setScaleY : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setScaleY : Error processing arguments"); cobj->setScaleY(arg0); args.rval().setUndefined(); @@ -2340,7 +2340,7 @@ bool js_cocos2dx_Node_setScaleX(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setScaleX : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setScaleX : Error processing arguments"); cobj->setScaleX(arg0); args.rval().setUndefined(); @@ -2644,7 +2644,7 @@ bool js_cocos2dx_Node_setSkewX(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setSkewX : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setSkewX : Error processing arguments"); cobj->setSkewX(arg0); args.rval().setUndefined(); @@ -3171,7 +3171,7 @@ bool js_cocos2dx_Node_setSkewY(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setSkewY : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setSkewY : Error processing arguments"); cobj->setSkewY(arg0); args.rval().setUndefined(); @@ -3211,7 +3211,7 @@ bool js_cocos2dx_Node_setPositionX(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setPositionX : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setPositionX : Error processing arguments"); cobj->setPositionX(arg0); args.rval().setUndefined(); @@ -3651,7 +3651,7 @@ bool js_cocos2dx_Node_setPositionZ(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setPositionZ : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setPositionZ : Error processing arguments"); cobj->setPositionZ(arg0); args.rval().setUndefined(); @@ -3839,7 +3839,7 @@ bool js_cocos2dx_Node_setRotationSkewX(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setRotationSkewX : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setRotationSkewX : Error processing arguments"); cobj->setRotationSkewX(arg0); args.rval().setUndefined(); @@ -3859,7 +3859,7 @@ bool js_cocos2dx_Node_setRotationSkewY(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setRotationSkewY : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setRotationSkewY : Error processing arguments"); cobj->setRotationSkewY(arg0); args.rval().setUndefined(); @@ -4207,7 +4207,7 @@ bool js_cocos2dx_Node_setPositionY(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setPositionY : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setPositionY : Error processing arguments"); cobj->setPositionY(arg0); args.rval().setUndefined(); @@ -4303,7 +4303,7 @@ bool js_cocos2dx_Node_setGlobalZOrder(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_setGlobalZOrder : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_setGlobalZOrder : Error processing arguments"); cobj->setGlobalZOrder(arg0); args.rval().setUndefined(); @@ -4327,10 +4327,10 @@ bool js_cocos2dx_Node_setScale(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cobj->setScale(arg0, arg1); args.rval().setUndefined(); @@ -4341,7 +4341,7 @@ bool js_cocos2dx_Node_setScale(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cobj->setScale(arg0); args.rval().setUndefined(); @@ -4884,7 +4884,7 @@ bool js_cocos2dx_Node_update(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_update : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Node_update : Error processing arguments"); cobj->update(arg0); args.rval().setUndefined(); @@ -5497,7 +5497,7 @@ bool js_cocos2dx_Scene_stepPhysicsAndNavigation(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Scene_stepPhysicsAndNavigation : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Scene_stepPhysicsAndNavigation : Error processing arguments"); cobj->stepPhysicsAndNavigation(arg0); args.rval().setUndefined(); @@ -5714,8 +5714,8 @@ bool js_cocos2dx_GLView_setFrameSize(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setFrameSize : Error processing arguments"); cobj->setFrameSize(arg0, arg1); args.rval().setUndefined(); @@ -5753,7 +5753,7 @@ bool js_cocos2dx_GLView_setContentScaleFactor(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_setContentScaleFactor : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setContentScaleFactor : Error processing arguments"); bool ret = cobj->setContentScaleFactor(arg0); jsval jsret = JSVAL_NULL; @@ -5816,10 +5816,10 @@ bool js_cocos2dx_GLView_setScissorInPoints(JSContext *cx, uint32_t argc, jsval * double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setScissorInPoints : Error processing arguments"); cobj->setScissorInPoints(arg0, arg1, arg2, arg3); args.rval().setUndefined(); @@ -5967,7 +5967,7 @@ bool js_cocos2dx_GLView_setFrameZoomFactor(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_setFrameZoomFactor : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setFrameZoomFactor : Error processing arguments"); cobj->setFrameZoomFactor(arg0); args.rval().setUndefined(); @@ -6043,8 +6043,8 @@ bool js_cocos2dx_GLView_setDesignResolutionSize(JSContext *cx, uint32_t argc, js double arg0 = 0; double arg1 = 0; ResolutionPolicy 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setDesignResolutionSize : Error processing arguments"); cobj->setDesignResolutionSize(arg0, arg1, arg2); @@ -6104,10 +6104,10 @@ bool js_cocos2dx_GLView_setViewPortInPoints(JSContext *cx, uint32_t argc, jsval double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLView_setViewPortInPoints : Error processing arguments"); cobj->setViewPortInPoints(arg0, arg1, arg2, arg3); args.rval().setUndefined(); @@ -6406,7 +6406,7 @@ bool js_cocos2dx_Director_setContentScaleFactor(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_setContentScaleFactor : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Director_setContentScaleFactor : Error processing arguments"); cobj->setContentScaleFactor(arg0); args.rval().setUndefined(); @@ -7576,7 +7576,7 @@ bool js_cocos2dx_Director_setAnimationInterval(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_setAnimationInterval : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Director_setAnimationInterval : Error processing arguments"); cobj->setAnimationInterval(arg0); args.rval().setUndefined(); @@ -7744,7 +7744,7 @@ bool js_cocos2dx_Scheduler_setTimeScale(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Scheduler_setTimeScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Scheduler_setTimeScale : Error processing arguments"); cobj->setTimeScale(arg0); args.rval().setUndefined(); @@ -7784,7 +7784,7 @@ bool js_cocos2dx_Scheduler_update(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Scheduler_update : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Scheduler_update : Error processing arguments"); cobj->update(arg0); args.rval().setUndefined(); @@ -8183,7 +8183,7 @@ bool js_cocos2dx_Action_update(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Action_update : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Action_update : Error processing arguments"); cobj->update(arg0); args.rval().setUndefined(); @@ -8243,7 +8243,7 @@ bool js_cocos2dx_Action_step(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Action_step : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Action_step : Error processing arguments"); cobj->step(arg0); args.rval().setUndefined(); @@ -8481,7 +8481,7 @@ bool js_cocos2dx_FiniteTimeAction_setDuration(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_FiniteTimeAction_setDuration : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FiniteTimeAction_setDuration : Error processing arguments"); cobj->setDuration(arg0); args.rval().setUndefined(); @@ -8615,7 +8615,7 @@ bool js_cocos2dx_Speed_setSpeed(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Speed_setSpeed : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Speed_setSpeed : Error processing arguments"); cobj->setSpeed(arg0); args.rval().setUndefined(); @@ -8645,7 +8645,7 @@ bool js_cocos2dx_Speed_initWithAction(JSContext *cx, uint32_t argc, jsval *vp) arg0 = (cocos2d::ActionInterval*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Speed_initWithAction : Error processing arguments"); bool ret = cobj->initWithAction(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -8695,7 +8695,7 @@ bool js_cocos2dx_Speed_create(JSContext *cx, uint32_t argc, jsval *vp) arg0 = (cocos2d::ActionInterval*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Speed_create : Error processing arguments"); auto ret = cocos2d::Speed::create(arg0, arg1); @@ -8871,8 +8871,8 @@ bool js_cocos2dx_Follow_initWithTargetAndOffset(JSContext *cx, uint32_t argc, js arg0 = (cocos2d::Node*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - 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(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Follow_initWithTargetAndOffset : Error processing arguments"); bool ret = cobj->initWithTargetAndOffset(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -8894,8 +8894,8 @@ bool js_cocos2dx_Follow_initWithTargetAndOffset(JSContext *cx, uint32_t argc, js arg0 = (cocos2d::Node*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - 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(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_ccrect(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Follow_initWithTargetAndOffset : Error processing arguments"); bool ret = cobj->initWithTargetAndOffset(arg0, arg1, arg2, arg3); @@ -8991,8 +8991,8 @@ bool js_cocos2dx_Follow_createWithOffset(JSContext *cx, uint32_t argc, jsval *vp arg0 = (cocos2d::Node*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - 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(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Follow_createWithOffset : Error processing arguments"); auto ret = cocos2d::Follow::createWithOffset(arg0, arg1, arg2); @@ -9015,8 +9015,8 @@ bool js_cocos2dx_Follow_createWithOffset(JSContext *cx, uint32_t argc, jsval *vp arg0 = (cocos2d::Node*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - 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(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_ccrect(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Follow_createWithOffset : Error processing arguments"); @@ -9476,6 +9476,22 @@ bool js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(JSContext *cx, uint32_ return false; } +bool js_cocos2dx_Image_setPNGPremultipliedAlphaEnabled(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_setPNGPremultipliedAlphaEnabled : Error processing arguments"); + cocos2d::Image::setPNGPremultipliedAlphaEnabled(arg0); + args.rval().setUndefined(); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Image_setPNGPremultipliedAlphaEnabled : wrong number of arguments"); + return false; +} + bool js_cocos2dx_Image_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9531,6 +9547,7 @@ void js_register_cocos2dx_Image(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("setPVRImagesHavePremultipliedAlpha", js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setPNGPremultipliedAlphaEnabled", js_cocos2dx_Image_setPNGPremultipliedAlphaEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -10310,7 +10327,7 @@ bool js_cocos2dx_GLProgramState_setUniformFloat(JSContext *cx, uint32_t argc, js ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cobj->setUniformFloat(arg0, arg1); args.rval().setUndefined(); @@ -10324,7 +10341,7 @@ bool js_cocos2dx_GLProgramState_setUniformFloat(JSContext *cx, uint32_t argc, js ok &= jsval_to_std_string(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cobj->setUniformFloat(arg0, arg1); args.rval().setUndefined(); @@ -11464,7 +11481,7 @@ bool js_cocos2dx_AnimationFrame_setDelayUnits(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_AnimationFrame_setDelayUnits : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AnimationFrame_setDelayUnits : Error processing arguments"); cobj->setDelayUnits(arg0); args.rval().setUndefined(); @@ -11577,7 +11594,7 @@ bool js_cocos2dx_AnimationFrame_initWithSpriteFrame(JSContext *cx, uint32_t argc arg0 = (cocos2d::SpriteFrame*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); ok &= jsval_to_ccvaluemap(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AnimationFrame_initWithSpriteFrame : Error processing arguments"); bool ret = cobj->initWithSpriteFrame(arg0, arg1, arg2); @@ -11607,7 +11624,7 @@ bool js_cocos2dx_AnimationFrame_create(JSContext *cx, uint32_t argc, jsval *vp) arg0 = (cocos2d::SpriteFrame*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); ok &= jsval_to_ccvaluemap(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AnimationFrame_create : Error processing arguments"); @@ -11828,7 +11845,7 @@ bool js_cocos2dx_Animation_initWithAnimationFrames(JSContext *cx, uint32_t argc, double arg1 = 0; unsigned int arg2 = 0; ok &= jsval_to_ccvector(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_initWithAnimationFrames : Error processing arguments"); bool ret = cobj->initWithAnimationFrames(arg0, arg1, arg2); @@ -11927,7 +11944,7 @@ bool js_cocos2dx_Animation_setDelayPerUnit(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Animation_setDelayPerUnit : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_setDelayPerUnit : Error processing arguments"); cobj->setDelayPerUnit(arg0); args.rval().setUndefined(); @@ -12015,7 +12032,7 @@ bool js_cocos2dx_Animation_initWithSpriteFrames(JSContext *cx, uint32_t argc, js cocos2d::Vector arg0; double arg1 = 0; ok &= jsval_to_ccvector(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_initWithSpriteFrames : Error processing arguments"); bool ret = cobj->initWithSpriteFrames(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -12028,7 +12045,7 @@ bool js_cocos2dx_Animation_initWithSpriteFrames(JSContext *cx, uint32_t argc, js double arg1 = 0; unsigned int arg2 = 0; ok &= jsval_to_ccvector(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_initWithSpriteFrames : Error processing arguments"); bool ret = cobj->initWithSpriteFrames(arg0, arg1, arg2); @@ -12100,7 +12117,7 @@ bool js_cocos2dx_Animation_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_ccvector(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::Animation* ret = cocos2d::Animation::create(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -12119,7 +12136,7 @@ bool js_cocos2dx_Animation_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_ccvector(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } unsigned int arg2 = 0; ok &= jsval_to_uint32(cx, args.get(2), &arg2); @@ -12171,7 +12188,7 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, cocos2d::Vector arg0; double arg1 = 0; ok &= jsval_to_ccvector(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_createWithSpriteFrames : Error processing arguments"); auto ret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1); @@ -12185,7 +12202,7 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, double arg1 = 0; unsigned int arg2 = 0; ok &= jsval_to_ccvector(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_createWithSpriteFrames : Error processing arguments"); @@ -12325,7 +12342,7 @@ bool js_cocos2dx_ActionInterval_initWithDuration(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ActionInterval_initWithDuration : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionInterval_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0); jsval jsret = JSVAL_NULL; @@ -12347,7 +12364,7 @@ bool js_cocos2dx_ActionInterval_setAmplitudeRate(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ActionInterval_setAmplitudeRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionInterval_setAmplitudeRate : Error processing arguments"); cobj->setAmplitudeRate(arg0); args.rval().setUndefined(); @@ -13119,7 +13136,7 @@ bool js_cocos2dx_RotateTo_initWithDuration(JSContext *cx, uint32_t argc, jsval * do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec3 arg1; ok &= jsval_to_vector3(cx, args.get(1), &arg1); @@ -13135,13 +13152,13 @@ bool js_cocos2dx_RotateTo_initWithDuration(JSContext *cx, uint32_t argc, jsval * do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } bool ret = cobj->initWithDuration(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -13162,10 +13179,10 @@ bool js_cocos2dx_RotateTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::RotateTo* ret = cocos2d::RotateTo::create(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -13182,13 +13199,13 @@ bool js_cocos2dx_RotateTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::RotateTo* ret = cocos2d::RotateTo::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -13205,7 +13222,7 @@ bool js_cocos2dx_RotateTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec3 arg1; ok &= jsval_to_vector3(cx, args.get(1), &arg1); @@ -13322,13 +13339,13 @@ bool js_cocos2dx_RotateBy_initWithDuration(JSContext *cx, uint32_t argc, jsval * do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } bool ret = cobj->initWithDuration(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -13341,10 +13358,10 @@ bool js_cocos2dx_RotateBy_initWithDuration(JSContext *cx, uint32_t argc, jsval * do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } bool ret = cobj->initWithDuration(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -13357,7 +13374,7 @@ bool js_cocos2dx_RotateBy_initWithDuration(JSContext *cx, uint32_t argc, jsval * do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec3 arg1; ok &= jsval_to_vector3(cx, args.get(1), &arg1); @@ -13381,13 +13398,13 @@ bool js_cocos2dx_RotateBy_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -13404,10 +13421,10 @@ bool js_cocos2dx_RotateBy_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -13424,7 +13441,7 @@ bool js_cocos2dx_RotateBy_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec3 arg1; ok &= jsval_to_vector3(cx, args.get(1), &arg1); @@ -13541,7 +13558,7 @@ bool js_cocos2dx_MoveBy_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec3 arg1; ok &= jsval_to_vector3(cx, args.get(1), &arg1); @@ -13557,7 +13574,7 @@ bool js_cocos2dx_MoveBy_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec2 arg1; ok &= jsval_to_vector2(cx, args.get(1), &arg1); @@ -13581,7 +13598,7 @@ bool js_cocos2dx_MoveBy_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec3 arg1; ok &= jsval_to_vector3(cx, args.get(1), &arg1); @@ -13601,7 +13618,7 @@ bool js_cocos2dx_MoveBy_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec2 arg1; ok &= jsval_to_vector2(cx, args.get(1), &arg1); @@ -13718,7 +13735,7 @@ bool js_cocos2dx_MoveTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec3 arg1; ok &= jsval_to_vector3(cx, args.get(1), &arg1); @@ -13734,7 +13751,7 @@ bool js_cocos2dx_MoveTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec2 arg1; ok &= jsval_to_vector2(cx, args.get(1), &arg1); @@ -13758,7 +13775,7 @@ bool js_cocos2dx_MoveTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec3 arg1; ok &= jsval_to_vector3(cx, args.get(1), &arg1); @@ -13778,7 +13795,7 @@ bool js_cocos2dx_MoveTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Vec2 arg1; ok &= jsval_to_vector2(cx, args.get(1), &arg1); @@ -13893,9 +13910,9 @@ bool js_cocos2dx_SkewTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp double arg0 = 0; double arg1 = 0; double arg2 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SkewTo_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -13915,9 +13932,9 @@ bool js_cocos2dx_SkewTo_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; double arg1 = 0; double arg2 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SkewTo_create : Error processing arguments"); auto ret = cocos2d::SkewTo::create(arg0, arg1, arg2); @@ -14026,9 +14043,9 @@ bool js_cocos2dx_SkewBy_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp double arg0 = 0; double arg1 = 0; double arg2 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SkewBy_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -14048,9 +14065,9 @@ bool js_cocos2dx_SkewBy_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; double arg1 = 0; double arg2 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SkewBy_create : Error processing arguments"); auto ret = cocos2d::SkewBy::create(arg0, arg1, arg2); @@ -14160,9 +14177,9 @@ bool js_cocos2dx_JumpBy_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp cocos2d::Vec2 arg1; double arg2 = 0; int arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpBy_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3); @@ -14184,9 +14201,9 @@ bool js_cocos2dx_JumpBy_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Vec2 arg1; double arg2 = 0; int arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpBy_create : Error processing arguments"); @@ -14297,9 +14314,9 @@ bool js_cocos2dx_JumpTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp cocos2d::Vec2 arg1; double arg2 = 0; int arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTo_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3); @@ -14321,9 +14338,9 @@ bool js_cocos2dx_JumpTo_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Vec2 arg1; double arg2 = 0; int arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTo_create : Error processing arguments"); @@ -14595,13 +14612,13 @@ bool js_cocos2dx_ScaleTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *v do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } bool ret = cobj->initWithDuration(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -14614,10 +14631,10 @@ bool js_cocos2dx_ScaleTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *v do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } bool ret = cobj->initWithDuration(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -14630,16 +14647,16 @@ bool js_cocos2dx_ScaleTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *v do { if (argc == 4) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); if (!ok) { ok = true; break; } bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -14660,13 +14677,13 @@ bool js_cocos2dx_ScaleTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -14683,10 +14700,10 @@ bool js_cocos2dx_ScaleTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -14703,16 +14720,16 @@ bool js_cocos2dx_ScaleTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 4) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); if (!ok) { ok = true; break; } cocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -14820,13 +14837,13 @@ bool js_cocos2dx_ScaleBy_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -14843,10 +14860,10 @@ bool js_cocos2dx_ScaleBy_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -14863,16 +14880,16 @@ bool js_cocos2dx_ScaleBy_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 4) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); if (!ok) { ok = true; break; } cocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -14982,7 +14999,7 @@ bool js_cocos2dx_Blink_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; int arg1 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Blink_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1); @@ -15002,7 +15019,7 @@ bool js_cocos2dx_Blink_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; int arg1 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Blink_create : Error processing arguments"); @@ -15111,7 +15128,7 @@ bool js_cocos2dx_FadeTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp if (argc == 2) { double arg0 = 0; uint16_t arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_uint16(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeTo_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1); @@ -15131,7 +15148,7 @@ bool js_cocos2dx_FadeTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; uint16_t arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_uint16(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeTo_create : Error processing arguments"); @@ -15263,7 +15280,7 @@ bool js_cocos2dx_FadeIn_create(JSContext *cx, uint32_t argc, jsval *vp) bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeIn_create : Error processing arguments"); auto ret = cocos2d::FadeIn::create(arg0); @@ -15394,7 +15411,7 @@ bool js_cocos2dx_FadeOut_create(JSContext *cx, uint32_t argc, jsval *vp) bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOut_create : Error processing arguments"); auto ret = cocos2d::FadeOut::create(arg0); @@ -15504,7 +15521,7 @@ bool js_cocos2dx_TintTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp uint16_t arg1; uint16_t arg2; uint16_t arg3; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_uint16(cx, args.get(1), &arg1); ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_uint16(cx, args.get(3), &arg3); @@ -15527,7 +15544,7 @@ bool js_cocos2dx_TintTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Color3B arg1; ok &= jsval_to_cccolor3b(cx, args.get(1), &arg1); @@ -15547,7 +15564,7 @@ bool js_cocos2dx_TintTo_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 4) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } uint16_t arg1; ok &= jsval_to_uint16(cx, args.get(1), &arg1); @@ -15669,7 +15686,7 @@ bool js_cocos2dx_TintBy_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp int32_t arg1 = 0; int32_t arg2 = 0; int32_t arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_int32(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), &arg2); ok &= jsval_to_int32(cx, args.get(3), &arg3); @@ -15693,7 +15710,7 @@ bool js_cocos2dx_TintBy_create(JSContext *cx, uint32_t argc, jsval *vp) int32_t arg1 = 0; int32_t arg2 = 0; int32_t arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_int32(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), &arg2); ok &= jsval_to_int32(cx, args.get(3), &arg3); @@ -15799,7 +15816,7 @@ bool js_cocos2dx_DelayTime_create(JSContext *cx, uint32_t argc, jsval *vp) bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DelayTime_create : Error processing arguments"); auto ret = cocos2d::DelayTime::create(arg0); @@ -16514,9 +16531,9 @@ bool js_cocos2dx_ActionFloat_initWithDuration(JSContext *cx, uint32_t argc, jsva double arg1 = 0; double arg2 = 0; std::function 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); do { if(JS_TypeOfValue(cx, args.get(3)) == JSTYPE_FUNCTION) { @@ -16560,9 +16577,9 @@ bool js_cocos2dx_ActionFloat_create(JSContext *cx, uint32_t argc, jsval *vp) double arg1 = 0; double arg2 = 0; std::function 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); do { if(JS_TypeOfValue(cx, args.get(3)) == JSTYPE_FUNCTION) { @@ -20453,8 +20470,8 @@ bool js_cocos2dx_EventMouse_setScrollData(JSContext *cx, uint32_t argc, jsval *v if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventMouse_setScrollData : Error processing arguments"); cobj->setScrollData(arg0, arg1); args.rval().setUndefined(); @@ -20601,8 +20618,8 @@ bool js_cocos2dx_EventMouse_setCursorPosition(JSContext *cx, uint32_t argc, jsva if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventMouse_setCursorPosition : Error processing arguments"); cobj->setCursorPosition(arg0, arg1); args.rval().setUndefined(); @@ -21051,13 +21068,13 @@ bool js_cocos2dx_ActionCamera_setEye(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj->setEye(arg0, arg1, arg2); args.rval().setUndefined(); @@ -21302,13 +21319,13 @@ bool js_cocos2dx_OrbitCamera_initWithDuration(JSContext *cx, uint32_t argc, jsva double arg4 = 0; double arg5 = 0; double arg6 = 0; - 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); - ok &= JS::ToNumber( cx, args.get(6), &arg6) && !isnan(arg6); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); + ok &= JS::ToNumber( cx, args.get(6), &arg6) && !std::isnan(arg6); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_OrbitCamera_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3, arg4, arg5, arg6); jsval jsret = JSVAL_NULL; @@ -21332,13 +21349,13 @@ bool js_cocos2dx_OrbitCamera_create(JSContext *cx, uint32_t argc, jsval *vp) double arg4 = 0; double arg5 = 0; double arg6 = 0; - 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); - ok &= JS::ToNumber( cx, args.get(6), &arg6) && !isnan(arg6); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); + ok &= JS::ToNumber( cx, args.get(6), &arg6) && !std::isnan(arg6); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_OrbitCamera_create : Error processing arguments"); auto ret = cocos2d::OrbitCamera::create(arg0, arg1, arg2, arg3, arg4, arg5, arg6); @@ -21816,7 +21833,7 @@ bool js_cocos2dx_EaseRateAction_setRate(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EaseRateAction_setRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseRateAction_setRate : Error processing arguments"); cobj->setRate(arg0); args.rval().setUndefined(); @@ -21846,7 +21863,7 @@ bool js_cocos2dx_EaseRateAction_initWithAction(JSContext *cx, uint32_t argc, jsv arg0 = (cocos2d::ActionInterval*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseRateAction_initWithAction : Error processing arguments"); bool ret = cobj->initWithAction(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -21892,7 +21909,7 @@ bool js_cocos2dx_EaseRateAction_create(JSContext *cx, uint32_t argc, jsval *vp) arg0 = (cocos2d::ActionInterval*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseRateAction_create : Error processing arguments"); auto ret = cocos2d::EaseRateAction::create(arg0, arg1); @@ -21975,7 +21992,7 @@ bool js_cocos2dx_EaseIn_create(JSContext *cx, uint32_t argc, jsval *vp) arg0 = (cocos2d::ActionInterval*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseIn_create : Error processing arguments"); auto ret = cocos2d::EaseIn::create(arg0, arg1); @@ -22087,7 +22104,7 @@ bool js_cocos2dx_EaseOut_create(JSContext *cx, uint32_t argc, jsval *vp) arg0 = (cocos2d::ActionInterval*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseOut_create : Error processing arguments"); auto ret = cocos2d::EaseOut::create(arg0, arg1); @@ -22199,7 +22216,7 @@ bool js_cocos2dx_EaseInOut_create(JSContext *cx, uint32_t argc, jsval *vp) arg0 = (cocos2d::ActionInterval*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseInOut_create : Error processing arguments"); auto ret = cocos2d::EaseInOut::create(arg0, arg1); @@ -22965,7 +22982,7 @@ bool js_cocos2dx_EaseElastic_setPeriod(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_EaseElastic_setPeriod : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseElastic_setPeriod : Error processing arguments"); cobj->setPeriod(arg0); args.rval().setUndefined(); @@ -23013,7 +23030,7 @@ bool js_cocos2dx_EaseElastic_initWithAction(JSContext *cx, uint32_t argc, jsval arg0 = (cocos2d::ActionInterval*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseElastic_initWithAction : Error processing arguments"); bool ret = cobj->initWithAction(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -23138,7 +23155,7 @@ bool js_cocos2dx_EaseElasticIn_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::EaseElasticIn* ret = cocos2d::EaseElasticIn::create(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -23281,7 +23298,7 @@ bool js_cocos2dx_EaseElasticOut_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::EaseElasticOut* ret = cocos2d::EaseElasticOut::create(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -23424,7 +23441,7 @@ bool js_cocos2dx_EaseElasticInOut_create(JSContext *cx, uint32_t argc, jsval *vp } while (0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::EaseElasticInOut* ret = cocos2d::EaseElasticInOut::create(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -24244,10 +24261,10 @@ bool js_cocos2dx_EaseBezierAction_setBezierParamer(JSContext *cx, uint32_t argc, double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBezierAction_setBezierParamer : Error processing arguments"); cobj->setBezierParamer(arg0, arg1, arg2, arg3); args.rval().setUndefined(); @@ -27046,7 +27063,7 @@ bool js_cocos2dx_GridAction_initWithDuration(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; cocos2d::Size arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GridAction_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1); @@ -27425,7 +27442,7 @@ bool js_cocos2dx_Waves3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Waves3D_setAmplitudeRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves3D_setAmplitudeRate : Error processing arguments"); cobj->setAmplitudeRate(arg0); args.rval().setUndefined(); @@ -27448,10 +27465,10 @@ bool js_cocos2dx_Waves3D_initWithDuration(JSContext *cx, uint32_t argc, jsval *v cocos2d::Size arg1; unsigned int arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves3D_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -27509,7 +27526,7 @@ bool js_cocos2dx_Waves3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Waves3D_setAmplitude : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves3D_setAmplitude : Error processing arguments"); cobj->setAmplitude(arg0); args.rval().setUndefined(); @@ -27528,10 +27545,10 @@ bool js_cocos2dx_Waves3D_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg1; unsigned int arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves3D_create : Error processing arguments"); auto ret = cocos2d::Waves3D::create(arg0, arg1, arg2, arg3); @@ -27628,7 +27645,7 @@ bool js_cocos2dx_FlipX3D_initWithSize(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg0; double arg1 = 0; ok &= jsval_to_ccsize(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipX3D_initWithSize : Error processing arguments"); bool ret = cobj->initWithSize(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -27650,7 +27667,7 @@ bool js_cocos2dx_FlipX3D_initWithDuration(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_FlipX3D_initWithDuration : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipX3D_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0); jsval jsret = JSVAL_NULL; @@ -27668,7 +27685,7 @@ bool js_cocos2dx_FlipX3D_create(JSContext *cx, uint32_t argc, jsval *vp) bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipX3D_create : Error processing arguments"); auto ret = cocos2d::FlipX3D::create(arg0); @@ -27772,7 +27789,7 @@ bool js_cocos2dx_FlipY3D_create(JSContext *cx, uint32_t argc, jsval *vp) bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipY3D_create : Error processing arguments"); auto ret = cocos2d::FlipY3D::create(arg0); @@ -27901,10 +27918,10 @@ bool js_cocos2dx_Lens3D_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp cocos2d::Size arg1; cocos2d::Vec2 arg2; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_vector2(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Lens3D_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -27926,7 +27943,7 @@ bool js_cocos2dx_Lens3D_setLensEffect(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Lens3D_setLensEffect : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Lens3D_setLensEffect : Error processing arguments"); cobj->setLensEffect(arg0); args.rval().setUndefined(); @@ -28001,10 +28018,10 @@ bool js_cocos2dx_Lens3D_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg1; cocos2d::Vec2 arg2; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_vector2(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Lens3D_create : Error processing arguments"); auto ret = cocos2d::Lens3D::create(arg0, arg1, arg2, arg3); @@ -28100,7 +28117,7 @@ bool js_cocos2dx_Ripple3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Ripple3D_setAmplitudeRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Ripple3D_setAmplitudeRate : Error processing arguments"); cobj->setAmplitudeRate(arg0); args.rval().setUndefined(); @@ -28125,12 +28142,12 @@ bool js_cocos2dx_Ripple3D_initWithDuration(JSContext *cx, uint32_t argc, jsval * double arg3 = 0; unsigned int arg4 = 0; double arg5 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_vector2(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); ok &= jsval_to_uint32(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Ripple3D_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3, arg4, arg5); jsval jsret = JSVAL_NULL; @@ -28170,7 +28187,7 @@ bool js_cocos2dx_Ripple3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Ripple3D_setAmplitude : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Ripple3D_setAmplitude : Error processing arguments"); cobj->setAmplitude(arg0); args.rval().setUndefined(); @@ -28247,12 +28264,12 @@ bool js_cocos2dx_Ripple3D_create(JSContext *cx, uint32_t argc, jsval *vp) double arg3 = 0; unsigned int arg4 = 0; double arg5 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_vector2(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); ok &= jsval_to_uint32(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Ripple3D_create : Error processing arguments"); auto ret = cocos2d::Ripple3D::create(arg0, arg1, arg2, arg3, arg4, arg5); @@ -28352,7 +28369,7 @@ bool js_cocos2dx_Shaky3D_initWithDuration(JSContext *cx, uint32_t argc, jsval *v cocos2d::Size arg1; int arg2 = 0; bool arg3; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); @@ -28376,7 +28393,7 @@ bool js_cocos2dx_Shaky3D_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg1; int arg2 = 0; bool arg3; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); @@ -28470,7 +28487,7 @@ bool js_cocos2dx_Liquid_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Liquid_setAmplitudeRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Liquid_setAmplitudeRate : Error processing arguments"); cobj->setAmplitudeRate(arg0); args.rval().setUndefined(); @@ -28493,10 +28510,10 @@ bool js_cocos2dx_Liquid_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp cocos2d::Size arg1; unsigned int arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Liquid_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -28554,7 +28571,7 @@ bool js_cocos2dx_Liquid_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Liquid_setAmplitude : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Liquid_setAmplitude : Error processing arguments"); cobj->setAmplitude(arg0); args.rval().setUndefined(); @@ -28573,10 +28590,10 @@ bool js_cocos2dx_Liquid_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg1; unsigned int arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Liquid_create : Error processing arguments"); auto ret = cocos2d::Liquid::create(arg0, arg1, arg2, arg3); @@ -28671,7 +28688,7 @@ bool js_cocos2dx_Waves_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Waves_setAmplitudeRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves_setAmplitudeRate : Error processing arguments"); cobj->setAmplitudeRate(arg0); args.rval().setUndefined(); @@ -28696,10 +28713,10 @@ bool js_cocos2dx_Waves_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp) double arg3 = 0; bool arg4; bool arg5; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); arg4 = JS::ToBoolean(args.get(4)); arg5 = JS::ToBoolean(args.get(5)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves_initWithDuration : Error processing arguments"); @@ -28759,7 +28776,7 @@ bool js_cocos2dx_Waves_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Waves_setAmplitude : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves_setAmplitude : Error processing arguments"); cobj->setAmplitude(arg0); args.rval().setUndefined(); @@ -28780,10 +28797,10 @@ bool js_cocos2dx_Waves_create(JSContext *cx, uint32_t argc, jsval *vp) double arg3 = 0; bool arg4; bool arg5; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); arg4 = JS::ToBoolean(args.get(4)); arg5 = JS::ToBoolean(args.get(5)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves_create : Error processing arguments"); @@ -28880,7 +28897,7 @@ bool js_cocos2dx_Twirl_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Twirl_setAmplitudeRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Twirl_setAmplitudeRate : Error processing arguments"); cobj->setAmplitudeRate(arg0); args.rval().setUndefined(); @@ -28904,11 +28921,11 @@ bool js_cocos2dx_Twirl_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Vec2 arg2; unsigned int arg3 = 0; double arg4 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_vector2(cx, args.get(2), &arg2); ok &= jsval_to_uint32(cx, args.get(3), &arg3); - ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Twirl_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; @@ -28948,7 +28965,7 @@ bool js_cocos2dx_Twirl_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Twirl_setAmplitude : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Twirl_setAmplitude : Error processing arguments"); cobj->setAmplitude(arg0); args.rval().setUndefined(); @@ -29024,11 +29041,11 @@ bool js_cocos2dx_Twirl_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Vec2 arg2; unsigned int arg3 = 0; double arg4 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_vector2(cx, args.get(2), &arg2); ok &= jsval_to_uint32(cx, args.get(3), &arg3); - ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Twirl_create : Error processing arguments"); auto ret = cocos2d::Twirl::create(arg0, arg1, arg2, arg3, arg4); @@ -29305,7 +29322,7 @@ bool js_cocos2dx_ActionManager_update(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ActionManager_update : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionManager_update : Error processing arguments"); cobj->update(arg0); args.rval().setUndefined(); @@ -29595,7 +29612,7 @@ bool js_cocos2dx_PageTurn3D_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; cocos2d::Size arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_PageTurn3D_create : Error processing arguments"); @@ -29671,8 +29688,8 @@ bool js_cocos2dx_ProgressTo_initWithDuration(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressTo_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -29691,8 +29708,8 @@ bool js_cocos2dx_ProgressTo_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressTo_create : Error processing arguments"); auto ret = cocos2d::ProgressTo::create(arg0, arg1); @@ -29801,9 +29818,9 @@ bool js_cocos2dx_ProgressFromTo_initWithDuration(JSContext *cx, uint32_t argc, j double arg0 = 0; double arg1 = 0; double arg2 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressFromTo_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -29823,9 +29840,9 @@ bool js_cocos2dx_ProgressFromTo_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; double arg1 = 0; double arg2 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressFromTo_create : Error processing arguments"); auto ret = cocos2d::ProgressFromTo::create(arg0, arg1, arg2); @@ -29935,7 +29952,7 @@ bool js_cocos2dx_ShakyTiles3D_initWithDuration(JSContext *cx, uint32_t argc, jsv cocos2d::Size arg1; int arg2 = 0; bool arg3; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); @@ -29959,7 +29976,7 @@ bool js_cocos2dx_ShakyTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg1; int arg2 = 0; bool arg3; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); @@ -30056,7 +30073,7 @@ bool js_cocos2dx_ShatteredTiles3D_initWithDuration(JSContext *cx, uint32_t argc, cocos2d::Size arg1; int arg2 = 0; bool arg3; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); @@ -30080,7 +30097,7 @@ bool js_cocos2dx_ShatteredTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp cocos2d::Size arg1; int arg2 = 0; bool arg3; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); @@ -30222,7 +30239,7 @@ bool js_cocos2dx_ShuffleTiles_initWithDuration(JSContext *cx, uint32_t argc, jsv double arg0 = 0; cocos2d::Size arg1; unsigned int arg2 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ShuffleTiles_initWithDuration : Error processing arguments"); @@ -30266,7 +30283,7 @@ bool js_cocos2dx_ShuffleTiles_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; cocos2d::Size arg1; unsigned int arg2 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ShuffleTiles_create : Error processing arguments"); @@ -30404,7 +30421,7 @@ bool js_cocos2dx_FadeOutTRTiles_transformTile(JSContext *cx, uint32_t argc, jsva cocos2d::Vec2 arg0; double arg1 = 0; ok &= jsval_to_vector2(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutTRTiles_transformTile : Error processing arguments"); cobj->transformTile(arg0, arg1); args.rval().setUndefined(); @@ -30426,7 +30443,7 @@ bool js_cocos2dx_FadeOutTRTiles_testFunc(JSContext *cx, uint32_t argc, jsval *vp cocos2d::Size arg0; double arg1 = 0; ok &= jsval_to_ccsize(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutTRTiles_testFunc : Error processing arguments"); double ret = cobj->testFunc(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -30445,7 +30462,7 @@ bool js_cocos2dx_FadeOutTRTiles_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; cocos2d::Size arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutTRTiles_create : Error processing arguments"); @@ -30553,7 +30570,7 @@ bool js_cocos2dx_FadeOutBLTiles_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; cocos2d::Size arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutBLTiles_create : Error processing arguments"); @@ -30657,7 +30674,7 @@ bool js_cocos2dx_FadeOutUpTiles_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; cocos2d::Size arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutUpTiles_create : Error processing arguments"); @@ -30761,7 +30778,7 @@ bool js_cocos2dx_FadeOutDownTiles_create(JSContext *cx, uint32_t argc, jsval *vp if (argc == 2) { double arg0 = 0; cocos2d::Size arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutDownTiles_create : Error processing arguments"); @@ -30933,7 +30950,7 @@ bool js_cocos2dx_TurnOffTiles_initWithDuration(JSContext *cx, uint32_t argc, jsv double arg0 = 0; cocos2d::Size arg1; unsigned int arg2 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TurnOffTiles_initWithDuration : Error processing arguments"); @@ -30955,7 +30972,7 @@ bool js_cocos2dx_TurnOffTiles_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Size arg1; ok &= jsval_to_ccsize(cx, args.get(1), &arg1); @@ -30978,7 +30995,7 @@ bool js_cocos2dx_TurnOffTiles_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Size arg1; ok &= jsval_to_ccsize(cx, args.get(1), &arg1); @@ -31078,7 +31095,7 @@ bool js_cocos2dx_WavesTiles3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_WavesTiles3D_setAmplitudeRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_WavesTiles3D_setAmplitudeRate : Error processing arguments"); cobj->setAmplitudeRate(arg0); args.rval().setUndefined(); @@ -31101,10 +31118,10 @@ bool js_cocos2dx_WavesTiles3D_initWithDuration(JSContext *cx, uint32_t argc, jsv cocos2d::Size arg1; unsigned int arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_WavesTiles3D_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -31162,7 +31179,7 @@ bool js_cocos2dx_WavesTiles3D_setAmplitude(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_WavesTiles3D_setAmplitude : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_WavesTiles3D_setAmplitude : Error processing arguments"); cobj->setAmplitude(arg0); args.rval().setUndefined(); @@ -31181,10 +31198,10 @@ bool js_cocos2dx_WavesTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg1; unsigned int arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_WavesTiles3D_create : Error processing arguments"); auto ret = cocos2d::WavesTiles3D::create(arg0, arg1, arg2, arg3); @@ -31279,7 +31296,7 @@ bool js_cocos2dx_JumpTiles3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_JumpTiles3D_setAmplitudeRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTiles3D_setAmplitudeRate : Error processing arguments"); cobj->setAmplitudeRate(arg0); args.rval().setUndefined(); @@ -31302,10 +31319,10 @@ bool js_cocos2dx_JumpTiles3D_initWithDuration(JSContext *cx, uint32_t argc, jsva cocos2d::Size arg1; unsigned int arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTiles3D_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -31363,7 +31380,7 @@ bool js_cocos2dx_JumpTiles3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_JumpTiles3D_setAmplitude : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTiles3D_setAmplitude : Error processing arguments"); cobj->setAmplitude(arg0); args.rval().setUndefined(); @@ -31382,10 +31399,10 @@ bool js_cocos2dx_JumpTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg1; unsigned int arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTiles3D_create : Error processing arguments"); auto ret = cocos2d::JumpTiles3D::create(arg0, arg1, arg2, arg3); @@ -31497,7 +31514,7 @@ bool js_cocos2dx_SplitRows_initWithDuration(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; unsigned int arg1 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SplitRows_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1); @@ -31517,7 +31534,7 @@ bool js_cocos2dx_SplitRows_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; unsigned int arg1 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SplitRows_create : Error processing arguments"); @@ -31610,7 +31627,7 @@ bool js_cocos2dx_SplitCols_initWithDuration(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; unsigned int arg1 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SplitCols_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1); @@ -31630,7 +31647,7 @@ bool js_cocos2dx_SplitCols_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; unsigned int arg1 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SplitCols_create : Error processing arguments"); @@ -31725,10 +31742,10 @@ bool js_cocos2dx_ActionTween_initWithDuration(JSContext *cx, uint32_t argc, jsva std::string arg1; double arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_std_string(cx, args.get(1), &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(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionTween_initWithDuration : Error processing arguments"); bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -31749,10 +31766,10 @@ bool js_cocos2dx_ActionTween_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg1; double arg2 = 0; double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_std_string(cx, args.get(1), &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(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionTween_create : Error processing arguments"); auto ret = cocos2d::ActionTween::create(arg0, arg1, arg2, arg3); @@ -32293,7 +32310,7 @@ bool js_cocos2dx_ClippingNode_setAlphaThreshold(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ClippingNode_setAlphaThreshold : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ClippingNode_setAlphaThreshold : Error processing arguments"); cobj->setAlphaThreshold(arg0); args.rval().setUndefined(); @@ -32485,7 +32502,7 @@ bool js_cocos2dx_DrawNode_drawPoints(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Color4F arg3; ok &= jsval_to_cccolor4f(cx, args.get(3), &arg3); @@ -32587,10 +32604,10 @@ bool js_cocos2dx_DrawNode_drawSolidCircle(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_vector2(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } unsigned int arg3 = 0; ok &= jsval_to_uint32(cx, args.get(3), &arg3); @@ -32610,19 +32627,19 @@ bool js_cocos2dx_DrawNode_drawSolidCircle(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_vector2(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } unsigned int arg3 = 0; ok &= jsval_to_uint32(cx, args.get(3), &arg3); if (!ok) { ok = true; break; } double arg4 = 0; - ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); if (!ok) { ok = true; break; } double arg5 = 0; - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); if (!ok) { ok = true; break; } cocos2d::Color4F arg6; ok &= jsval_to_cccolor4f(cx, args.get(6), &arg6); @@ -32695,7 +32712,7 @@ bool js_cocos2dx_DrawNode_drawPolygon(JSContext *cx, uint32_t argc, jsval *vp) std::vector tempData;ok &= jsval_to_vector_vec2(cx, args.get(0), &tempData);arg0=tempData.data(); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); ok &= jsval_to_cccolor4f(cx, args.get(2), &arg2); - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); ok &= jsval_to_cccolor4f(cx, args.get(4), &arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DrawNode_drawPolygon : Error processing arguments"); cobj->drawPolygon(arg0, arg1, arg2, arg3, arg4); @@ -32719,7 +32736,7 @@ bool js_cocos2dx_DrawNode_drawDot(JSContext *cx, uint32_t argc, jsval *vp) double arg1 = 0; cocos2d::Color4F arg2; ok &= jsval_to_vector2(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); ok &= jsval_to_cccolor4f(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DrawNode_drawDot : Error processing arguments"); cobj->drawDot(arg0, arg1, arg2); @@ -32777,7 +32794,7 @@ bool js_cocos2dx_DrawNode_drawSegment(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Color4F arg3; ok &= jsval_to_vector2(cx, args.get(0), &arg0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_cccolor4f(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DrawNode_drawSegment : Error processing arguments"); cobj->drawSegment(arg0, arg1, arg2, arg3); @@ -32845,10 +32862,10 @@ bool js_cocos2dx_DrawNode_drawCircle(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_vector2(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } unsigned int arg3 = 0; ok &= jsval_to_uint32(cx, args.get(3), &arg3); @@ -32870,10 +32887,10 @@ bool js_cocos2dx_DrawNode_drawCircle(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_vector2(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } unsigned int arg3 = 0; ok &= jsval_to_uint32(cx, args.get(3), &arg3); @@ -32881,10 +32898,10 @@ bool js_cocos2dx_DrawNode_drawCircle(JSContext *cx, uint32_t argc, jsval *vp) bool arg4; arg4 = JS::ToBoolean(args.get(4)); double arg5 = 0; - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); if (!ok) { ok = true; break; } double arg6 = 0; - ok &= JS::ToNumber( cx, args.get(6), &arg6) && !isnan(arg6); + ok &= JS::ToNumber( cx, args.get(6), &arg6) && !std::isnan(arg6); if (!ok) { ok = true; break; } cocos2d::Color4F arg7; ok &= jsval_to_cccolor4f(cx, args.get(7), &arg7); @@ -33056,7 +33073,7 @@ bool js_cocos2dx_DrawNode_drawCardinalSpline(JSContext *cx, uint32_t argc, jsval arg0 = (cocos2d::PointArray*)(jsProxy ? jsProxy->ptr : NULL); JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); ok &= jsval_to_cccolor4f(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DrawNode_drawCardinalSpline : Error processing arguments"); @@ -33123,7 +33140,7 @@ bool js_cocos2dx_DrawNode_drawPoint(JSContext *cx, uint32_t argc, jsval *vp) double arg1 = 0; cocos2d::Color4F arg2; ok &= jsval_to_vector2(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); ok &= jsval_to_cccolor4f(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DrawNode_drawPoint : Error processing arguments"); cobj->drawPoint(arg0, arg1, arg2); @@ -33374,8 +33391,8 @@ bool js_cocos2dx_Label_setDimensions(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setDimensions : Error processing arguments"); cobj->setDimensions(arg0, arg1); args.rval().setUndefined(); @@ -33538,7 +33555,7 @@ bool js_cocos2dx_Label_setWidth(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Label_setWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setWidth : Error processing arguments"); cobj->setWidth(arg0); args.rval().setUndefined(); @@ -33788,7 +33805,7 @@ bool js_cocos2dx_Label_setBMFontFilePath(JSContext *cx, uint32_t argc, jsval *vp double arg2 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setBMFontFilePath : Error processing arguments"); bool ret = cobj->setBMFontFilePath(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -33880,7 +33897,7 @@ bool js_cocos2dx_Label_initWithTTF(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } bool ret = cobj->initWithTTF(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -33899,7 +33916,7 @@ bool js_cocos2dx_Label_initWithTTF(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Size arg3; ok &= jsval_to_ccsize(cx, args.get(3), &arg3); @@ -33921,7 +33938,7 @@ bool js_cocos2dx_Label_initWithTTF(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Size arg3; ok &= jsval_to_ccsize(cx, args.get(3), &arg3); @@ -33946,7 +33963,7 @@ bool js_cocos2dx_Label_initWithTTF(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Size arg3; ok &= jsval_to_ccsize(cx, args.get(3), &arg3); @@ -33978,7 +33995,7 @@ bool js_cocos2dx_Label_setLineHeight(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Label_setLineHeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setLineHeight : Error processing arguments"); cobj->setLineHeight(arg0); args.rval().setUndefined(); @@ -33998,7 +34015,7 @@ bool js_cocos2dx_Label_setSystemFontSize(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Label_setSystemFontSize : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setSystemFontSize : Error processing arguments"); cobj->setSystemFontSize(arg0); args.rval().setUndefined(); @@ -34309,7 +34326,7 @@ bool js_cocos2dx_Label_setMaxLineWidth(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Label_setMaxLineWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setMaxLineWidth : Error processing arguments"); cobj->setMaxLineWidth(arg0); args.rval().setUndefined(); @@ -34367,7 +34384,7 @@ bool js_cocos2dx_Label_setLineSpacing(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Label_setLineSpacing : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setLineSpacing : Error processing arguments"); cobj->setLineSpacing(arg0); args.rval().setUndefined(); @@ -34503,7 +34520,7 @@ bool js_cocos2dx_Label_setHeight(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Label_setHeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setHeight : Error processing arguments"); cobj->setHeight(arg0); args.rval().setUndefined(); @@ -34597,7 +34614,7 @@ bool js_cocos2dx_Label_setAdditionalKerning(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Label_setAdditionalKerning : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setAdditionalKerning : Error processing arguments"); cobj->setAdditionalKerning(arg0); args.rval().setUndefined(); @@ -34816,7 +34833,7 @@ bool js_cocos2dx_Label_setBMFontSize(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Label_setBMFontSize : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_setBMFontSize : Error processing arguments"); cobj->setBMFontSize(arg0); args.rval().setUndefined(); @@ -35007,7 +35024,7 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval double arg2 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); auto ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2); @@ -35023,7 +35040,7 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval cocos2d::Size arg3; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_ccsize(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); @@ -35041,7 +35058,7 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval cocos2d::TextHAlignment arg4; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_ccsize(cx, args.get(3), &arg3); ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); @@ -35061,7 +35078,7 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval cocos2d::TextVAlignment arg5; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_ccsize(cx, args.get(3), &arg3); ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); ok &= jsval_to_int32(cx, args.get(5), (int32_t *)&arg5); @@ -35658,7 +35675,7 @@ bool js_cocos2dx_LabelBMFont_initWithString(JSContext *cx, uint32_t argc, jsval double arg2 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelBMFont_initWithString : Error processing arguments"); bool ret = cobj->initWithString(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -35673,7 +35690,7 @@ bool js_cocos2dx_LabelBMFont_initWithString(JSContext *cx, uint32_t argc, jsval cocos2d::TextHAlignment arg3; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelBMFont_initWithString : Error processing arguments"); bool ret = cobj->initWithString(arg0, arg1, arg2, arg3); @@ -35690,7 +35707,7 @@ bool js_cocos2dx_LabelBMFont_initWithString(JSContext *cx, uint32_t argc, jsval cocos2d::Vec2 arg4; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); ok &= jsval_to_vector2(cx, args.get(4), &arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelBMFont_initWithString : Error processing arguments"); @@ -35782,7 +35799,7 @@ bool js_cocos2dx_LabelBMFont_setWidth(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_LabelBMFont_setWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelBMFont_setWidth : Error processing arguments"); cobj->setWidth(arg0); args.rval().setUndefined(); @@ -35839,7 +35856,7 @@ bool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -35861,7 +35878,7 @@ bool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::TextHAlignment arg3; ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); @@ -35886,7 +35903,7 @@ bool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::TextHAlignment arg3; ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); @@ -36015,8 +36032,8 @@ bool js_cocos2dx_LabelTTF_enableShadow(JSContext *cx, uint32_t argc, jsval *vp) double arg1 = 0; double arg2 = 0; ok &= jsval_to_ccsize(cx, args.get(0), &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(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_enableShadow : Error processing arguments"); cobj->enableShadow(arg0, arg1, arg2); args.rval().setUndefined(); @@ -36028,8 +36045,8 @@ bool js_cocos2dx_LabelTTF_enableShadow(JSContext *cx, uint32_t argc, jsval *vp) double arg2 = 0; bool arg3; ok &= jsval_to_ccsize(cx, args.get(0), &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(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); arg3 = JS::ToBoolean(args.get(3)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_enableShadow : Error processing arguments"); cobj->enableShadow(arg0, arg1, arg2, arg3); @@ -36252,7 +36269,7 @@ bool js_cocos2dx_LabelTTF_initWithString(JSContext *cx, uint32_t argc, jsval *vp double arg2 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_initWithString : Error processing arguments"); bool ret = cobj->initWithString(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -36267,7 +36284,7 @@ bool js_cocos2dx_LabelTTF_initWithString(JSContext *cx, uint32_t argc, jsval *vp cocos2d::Size arg3; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_ccsize(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_initWithString : Error processing arguments"); bool ret = cobj->initWithString(arg0, arg1, arg2, arg3); @@ -36284,7 +36301,7 @@ bool js_cocos2dx_LabelTTF_initWithString(JSContext *cx, uint32_t argc, jsval *vp cocos2d::TextHAlignment arg4; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_ccsize(cx, args.get(3), &arg3); ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_initWithString : Error processing arguments"); @@ -36303,7 +36320,7 @@ bool js_cocos2dx_LabelTTF_initWithString(JSContext *cx, uint32_t argc, jsval *vp cocos2d::TextVAlignment arg5; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); ok &= jsval_to_ccsize(cx, args.get(3), &arg3); ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); ok &= jsval_to_int32(cx, args.get(5), (int32_t *)&arg5); @@ -36378,7 +36395,7 @@ bool js_cocos2dx_LabelTTF_enableStroke(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Color3B arg0; double arg1 = 0; ok &= jsval_to_cccolor3b(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_enableStroke : Error processing arguments"); cobj->enableStroke(arg0, arg1); args.rval().setUndefined(); @@ -36389,7 +36406,7 @@ bool js_cocos2dx_LabelTTF_enableStroke(JSContext *cx, uint32_t argc, jsval *vp) double arg1 = 0; bool arg2; ok &= jsval_to_cccolor3b(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); arg2 = JS::ToBoolean(args.get(2)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_enableStroke : Error processing arguments"); cobj->enableStroke(arg0, arg1, arg2); @@ -36448,7 +36465,7 @@ bool js_cocos2dx_LabelTTF_setFontSize(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_LabelTTF_setFontSize : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_setFontSize : Error processing arguments"); cobj->setFontSize(arg0); args.rval().setUndefined(); @@ -36630,7 +36647,7 @@ bool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -36652,7 +36669,7 @@ bool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Size arg3; ok &= jsval_to_ccsize(cx, args.get(3), &arg3); @@ -36677,7 +36694,7 @@ bool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Size arg3; ok &= jsval_to_ccsize(cx, args.get(3), &arg3); @@ -36705,7 +36722,7 @@ bool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Size arg3; ok &= jsval_to_ccsize(cx, args.get(3), &arg3); @@ -37051,8 +37068,8 @@ bool js_cocos2dx_LayerColor_changeWidthAndHeight(JSContext *cx, uint32_t argc, j if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LayerColor_changeWidthAndHeight : Error processing arguments"); cobj->changeWidthAndHeight(arg0, arg1); args.rval().setUndefined(); @@ -37110,7 +37127,7 @@ bool js_cocos2dx_LayerColor_changeWidth(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_LayerColor_changeWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LayerColor_changeWidth : Error processing arguments"); cobj->changeWidth(arg0); args.rval().setUndefined(); @@ -37150,10 +37167,10 @@ bool js_cocos2dx_LayerColor_initWithColor(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_cccolor4b(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } bool ret = cobj->initWithColor(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -37176,7 +37193,7 @@ bool js_cocos2dx_LayerColor_changeHeight(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_LayerColor_changeHeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LayerColor_changeHeight : Error processing arguments"); cobj->changeHeight(arg0); args.rval().setUndefined(); @@ -37197,10 +37214,10 @@ bool js_cocos2dx_LayerColor_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_cccolor4b(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::LayerColor* ret = cocos2d::LayerColor::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -39862,7 +39879,7 @@ bool js_cocos2dx_Menu_alignItemsHorizontallyWithPadding(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Menu_alignItemsHorizontallyWithPadding : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Menu_alignItemsHorizontallyWithPadding : Error processing arguments"); cobj->alignItemsHorizontallyWithPadding(arg0); args.rval().setUndefined(); @@ -39882,7 +39899,7 @@ bool js_cocos2dx_Menu_alignItemsVerticallyWithPadding(JSContext *cx, uint32_t ar JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Menu_alignItemsVerticallyWithPadding : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Menu_alignItemsVerticallyWithPadding : Error processing arguments"); cobj->alignItemsVerticallyWithPadding(arg0); args.rval().setUndefined(); @@ -40207,13 +40224,13 @@ bool js_cocos2dx_MotionStreak_initWithFade(JSContext *cx, uint32_t argc, jsval * do { if (argc == 5) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Color3B arg3; ok &= jsval_to_cccolor3b(cx, args.get(3), &arg3); @@ -40240,13 +40257,13 @@ bool js_cocos2dx_MotionStreak_initWithFade(JSContext *cx, uint32_t argc, jsval * do { if (argc == 5) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Color3B arg3; ok &= jsval_to_cccolor3b(cx, args.get(3), &arg3); @@ -40295,7 +40312,7 @@ bool js_cocos2dx_MotionStreak_setStroke(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_MotionStreak_setStroke : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_MotionStreak_setStroke : Error processing arguments"); cobj->setStroke(arg0); args.rval().setUndefined(); @@ -40313,13 +40330,13 @@ bool js_cocos2dx_MotionStreak_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 5) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Color3B arg3; ok &= jsval_to_cccolor3b(cx, args.get(3), &arg3); @@ -40350,13 +40367,13 @@ bool js_cocos2dx_MotionStreak_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 5) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::Color3B arg3; ok &= jsval_to_cccolor3b(cx, args.get(3), &arg3); @@ -41459,7 +41476,7 @@ bool js_cocos2dx_ParticleSystem_setRotatePerSecondVar(JSContext *cx, uint32_t ar JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setRotatePerSecondVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setRotatePerSecondVar : Error processing arguments"); cobj->setRotatePerSecondVar(arg0); args.rval().setUndefined(); @@ -41533,7 +41550,7 @@ bool js_cocos2dx_ParticleSystem_setTangentialAccel(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setTangentialAccel : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setTangentialAccel : Error processing arguments"); cobj->setTangentialAccel(arg0); args.rval().setUndefined(); @@ -41571,7 +41588,7 @@ bool js_cocos2dx_ParticleSystem_setStartRadius(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setStartRadius : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setStartRadius : Error processing arguments"); cobj->setStartRadius(arg0); args.rval().setUndefined(); @@ -41591,7 +41608,7 @@ bool js_cocos2dx_ParticleSystem_setRotatePerSecond(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setRotatePerSecond : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setRotatePerSecond : Error processing arguments"); cobj->setRotatePerSecond(arg0); args.rval().setUndefined(); @@ -41611,7 +41628,7 @@ bool js_cocos2dx_ParticleSystem_setEndSize(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setEndSize : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setEndSize : Error processing arguments"); cobj->setEndSize(arg0); args.rval().setUndefined(); @@ -41667,7 +41684,7 @@ bool js_cocos2dx_ParticleSystem_setEndRadius(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setEndRadius : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setEndRadius : Error processing arguments"); cobj->setEndRadius(arg0); args.rval().setUndefined(); @@ -41743,7 +41760,7 @@ bool js_cocos2dx_ParticleSystem_setStartSpin(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setStartSpin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setStartSpin : Error processing arguments"); cobj->setStartSpin(arg0); args.rval().setUndefined(); @@ -41763,7 +41780,7 @@ bool js_cocos2dx_ParticleSystem_setDuration(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setDuration : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setDuration : Error processing arguments"); cobj->setDuration(arg0); args.rval().setUndefined(); @@ -41977,7 +41994,7 @@ bool js_cocos2dx_ParticleSystem_setLifeVar(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setLifeVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setLifeVar : Error processing arguments"); cobj->setLifeVar(arg0); args.rval().setUndefined(); @@ -42073,7 +42090,7 @@ bool js_cocos2dx_ParticleSystem_setStartSpinVar(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setStartSpinVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setStartSpinVar : Error processing arguments"); cobj->setStartSpinVar(arg0); args.rval().setUndefined(); @@ -42129,7 +42146,7 @@ bool js_cocos2dx_ParticleSystem_setTangentialAccelVar(JSContext *cx, uint32_t ar JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setTangentialAccelVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setTangentialAccelVar : Error processing arguments"); cobj->setTangentialAccelVar(arg0); args.rval().setUndefined(); @@ -42149,7 +42166,7 @@ bool js_cocos2dx_ParticleSystem_setEndRadiusVar(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setEndRadiusVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setEndRadiusVar : Error processing arguments"); cobj->setEndRadiusVar(arg0); args.rval().setUndefined(); @@ -42205,7 +42222,7 @@ bool js_cocos2dx_ParticleSystem_setRadialAccelVar(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setRadialAccelVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setRadialAccelVar : Error processing arguments"); cobj->setRadialAccelVar(arg0); args.rval().setUndefined(); @@ -42225,7 +42242,7 @@ bool js_cocos2dx_ParticleSystem_setStartSize(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setStartSize : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setStartSize : Error processing arguments"); cobj->setStartSize(arg0); args.rval().setUndefined(); @@ -42245,7 +42262,7 @@ bool js_cocos2dx_ParticleSystem_setSpeed(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setSpeed : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setSpeed : Error processing arguments"); cobj->setSpeed(arg0); args.rval().setUndefined(); @@ -42447,7 +42464,7 @@ bool js_cocos2dx_ParticleSystem_setLife(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setLife : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setLife : Error processing arguments"); cobj->setLife(arg0); args.rval().setUndefined(); @@ -42467,7 +42484,7 @@ bool js_cocos2dx_ParticleSystem_setAngleVar(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setAngleVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setAngleVar : Error processing arguments"); cobj->setAngleVar(arg0); args.rval().setUndefined(); @@ -42523,7 +42540,7 @@ bool js_cocos2dx_ParticleSystem_setEndSizeVar(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setEndSizeVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setEndSizeVar : Error processing arguments"); cobj->setEndSizeVar(arg0); args.rval().setUndefined(); @@ -42543,7 +42560,7 @@ bool js_cocos2dx_ParticleSystem_setAngle(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setAngle : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setAngle : Error processing arguments"); cobj->setAngle(arg0); args.rval().setUndefined(); @@ -42627,7 +42644,7 @@ bool js_cocos2dx_ParticleSystem_setEndSpinVar(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setEndSpinVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setEndSpinVar : Error processing arguments"); cobj->setEndSpinVar(arg0); args.rval().setUndefined(); @@ -42761,7 +42778,7 @@ bool js_cocos2dx_ParticleSystem_setSpeedVar(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setSpeedVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setSpeedVar : Error processing arguments"); cobj->setSpeedVar(arg0); args.rval().setUndefined(); @@ -42837,7 +42854,7 @@ bool js_cocos2dx_ParticleSystem_setEmissionRate(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setEmissionRate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setEmissionRate : Error processing arguments"); cobj->setEmissionRate(arg0); args.rval().setUndefined(); @@ -42947,7 +42964,7 @@ bool js_cocos2dx_ParticleSystem_setStartSizeVar(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setStartSizeVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setStartSizeVar : Error processing arguments"); cobj->setStartSizeVar(arg0); args.rval().setUndefined(); @@ -43059,7 +43076,7 @@ bool js_cocos2dx_ParticleSystem_setEndSpin(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setEndSpin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setEndSpin : Error processing arguments"); cobj->setEndSpin(arg0); args.rval().setUndefined(); @@ -43079,7 +43096,7 @@ bool js_cocos2dx_ParticleSystem_setRadialAccel(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setRadialAccel : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setRadialAccel : Error processing arguments"); cobj->setRadialAccel(arg0); args.rval().setUndefined(); @@ -43178,7 +43195,7 @@ bool js_cocos2dx_ParticleSystem_setStartRadiusVar(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_setStartRadiusVar : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_setStartRadiusVar : Error processing arguments"); cobj->setStartRadiusVar(arg0); args.rval().setUndefined(); @@ -45494,7 +45511,7 @@ bool js_cocos2dx_ProgressTimer_setPercentage(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ProgressTimer_setPercentage : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressTimer_setPercentage : Error processing arguments"); cobj->setPercentage(arg0); args.rval().setUndefined(); @@ -46195,7 +46212,7 @@ bool js_cocos2dx_Sprite_setRotationSkewX(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Sprite_setRotationSkewX : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Sprite_setRotationSkewX : Error processing arguments"); cobj->setRotationSkewX(arg0); args.rval().setUndefined(); @@ -46215,7 +46232,7 @@ bool js_cocos2dx_Sprite_setRotationSkewY(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Sprite_setRotationSkewY : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Sprite_setRotationSkewY : Error processing arguments"); cobj->setRotationSkewY(arg0); args.rval().setUndefined(); @@ -47324,19 +47341,19 @@ bool js_cocos2dx_RenderTexture_beginWithClear(JSContext *cx, uint32_t argc, jsva do { if (argc == 5) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); if (!ok) { ok = true; break; } double arg4 = 0; - ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); if (!ok) { ok = true; break; } cobj->beginWithClear(arg0, arg1, arg2, arg3, arg4); args.rval().setUndefined(); @@ -47347,16 +47364,16 @@ bool js_cocos2dx_RenderTexture_beginWithClear(JSContext *cx, uint32_t argc, jsva do { if (argc == 4) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); if (!ok) { ok = true; break; } cobj->beginWithClear(arg0, arg1, arg2, arg3); args.rval().setUndefined(); @@ -47367,19 +47384,19 @@ bool js_cocos2dx_RenderTexture_beginWithClear(JSContext *cx, uint32_t argc, jsva do { if (argc == 6) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); if (!ok) { ok = true; break; } double arg4 = 0; - ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); if (!ok) { ok = true; break; } int arg5 = 0; ok &= jsval_to_int32(cx, args.get(5), (int32_t *)&arg5); @@ -47403,7 +47420,7 @@ bool js_cocos2dx_RenderTexture_clearDepth(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderTexture_clearDepth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RenderTexture_clearDepth : Error processing arguments"); cobj->clearDepth(arg0); args.rval().setUndefined(); @@ -47444,10 +47461,10 @@ bool js_cocos2dx_RenderTexture_clear(JSContext *cx, uint32_t argc, jsval *vp) double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RenderTexture_clear : Error processing arguments"); cobj->clear(arg0, arg1, arg2, arg3); args.rval().setUndefined(); @@ -47522,7 +47539,7 @@ bool js_cocos2dx_RenderTexture_setClearDepth(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_RenderTexture_setClearDepth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RenderTexture_setClearDepth : Error processing arguments"); cobj->setClearDepth(arg0); args.rval().setUndefined(); @@ -47898,7 +47915,7 @@ bool js_cocos2dx_TransitionScene_initWithDuration(JSContext *cx, uint32_t argc, if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -47960,7 +47977,7 @@ bool js_cocos2dx_TransitionScene_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -48082,7 +48099,7 @@ bool js_cocos2dx_TransitionSceneOriented_initWithDuration(JSContext *cx, uint32_ double arg0 = 0; cocos2d::Scene* arg1 = nullptr; cocos2d::TransitionScene::Orientation arg2; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -48112,7 +48129,7 @@ bool js_cocos2dx_TransitionSceneOriented_create(JSContext *cx, uint32_t argc, js double arg0 = 0; cocos2d::Scene* arg1 = nullptr; cocos2d::TransitionScene::Orientation arg2; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -48226,7 +48243,7 @@ bool js_cocos2dx_TransitionRotoZoom_create(JSContext *cx, uint32_t argc, jsval * if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -48338,7 +48355,7 @@ bool js_cocos2dx_TransitionJumpZoom_create(JSContext *cx, uint32_t argc, jsval * if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -48506,7 +48523,7 @@ bool js_cocos2dx_TransitionMoveInL_create(JSContext *cx, uint32_t argc, jsval *v if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -48620,7 +48637,7 @@ bool js_cocos2dx_TransitionMoveInR_create(JSContext *cx, uint32_t argc, jsval *v if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -48732,7 +48749,7 @@ bool js_cocos2dx_TransitionMoveInT_create(JSContext *cx, uint32_t argc, jsval *v if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -48844,7 +48861,7 @@ bool js_cocos2dx_TransitionMoveInB_create(JSContext *cx, uint32_t argc, jsval *v if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -49012,7 +49029,7 @@ bool js_cocos2dx_TransitionSlideInL_create(JSContext *cx, uint32_t argc, jsval * if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -49126,7 +49143,7 @@ bool js_cocos2dx_TransitionSlideInR_create(JSContext *cx, uint32_t argc, jsval * if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -49238,7 +49255,7 @@ bool js_cocos2dx_TransitionSlideInB_create(JSContext *cx, uint32_t argc, jsval * if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -49350,7 +49367,7 @@ bool js_cocos2dx_TransitionSlideInT_create(JSContext *cx, uint32_t argc, jsval * if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -49496,7 +49513,7 @@ bool js_cocos2dx_TransitionShrinkGrow_create(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -49610,7 +49627,7 @@ bool js_cocos2dx_TransitionFlipX_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -49638,7 +49655,7 @@ bool js_cocos2dx_TransitionFlipX_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -49759,7 +49776,7 @@ bool js_cocos2dx_TransitionFlipY_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -49787,7 +49804,7 @@ bool js_cocos2dx_TransitionFlipY_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -49908,7 +49925,7 @@ bool js_cocos2dx_TransitionFlipAngular_create(JSContext *cx, uint32_t argc, jsva do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -49936,7 +49953,7 @@ bool js_cocos2dx_TransitionFlipAngular_create(JSContext *cx, uint32_t argc, jsva do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50057,7 +50074,7 @@ bool js_cocos2dx_TransitionZoomFlipX_create(JSContext *cx, uint32_t argc, jsval do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50085,7 +50102,7 @@ bool js_cocos2dx_TransitionZoomFlipX_create(JSContext *cx, uint32_t argc, jsval do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50206,7 +50223,7 @@ bool js_cocos2dx_TransitionZoomFlipY_create(JSContext *cx, uint32_t argc, jsval do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50234,7 +50251,7 @@ bool js_cocos2dx_TransitionZoomFlipY_create(JSContext *cx, uint32_t argc, jsval do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50355,7 +50372,7 @@ bool js_cocos2dx_TransitionZoomFlipAngular_create(JSContext *cx, uint32_t argc, do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50383,7 +50400,7 @@ bool js_cocos2dx_TransitionZoomFlipAngular_create(JSContext *cx, uint32_t argc, do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50510,7 +50527,7 @@ bool js_cocos2dx_TransitionFade_initWithDuration(JSContext *cx, uint32_t argc, j do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50534,7 +50551,7 @@ bool js_cocos2dx_TransitionFade_initWithDuration(JSContext *cx, uint32_t argc, j do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50569,7 +50586,7 @@ bool js_cocos2dx_TransitionFade_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50597,7 +50614,7 @@ bool js_cocos2dx_TransitionFade_create(JSContext *cx, uint32_t argc, jsval *vp) do { if (argc == 3) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cocos2d::Scene* arg1 = nullptr; do { @@ -50718,7 +50735,7 @@ bool js_cocos2dx_TransitionCrossFade_create(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -50864,7 +50881,7 @@ bool js_cocos2dx_TransitionTurnOffTiles_create(JSContext *cx, uint32_t argc, jsv if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -51033,7 +51050,7 @@ bool js_cocos2dx_TransitionSplitCols_create(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -51147,7 +51164,7 @@ bool js_cocos2dx_TransitionSplitRows_create(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -51319,7 +51336,7 @@ bool js_cocos2dx_TransitionFadeTR_create(JSContext *cx, uint32_t argc, jsval *vp if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -51433,7 +51450,7 @@ bool js_cocos2dx_TransitionFadeBL_create(JSContext *cx, uint32_t argc, jsval *vp if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -51545,7 +51562,7 @@ bool js_cocos2dx_TransitionFadeUp_create(JSContext *cx, uint32_t argc, jsval *vp if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -51657,7 +51674,7 @@ bool js_cocos2dx_TransitionFadeDown_create(JSContext *cx, uint32_t argc, jsval * if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -51800,7 +51817,7 @@ bool js_cocos2dx_TransitionPageTurn_initWithDuration(JSContext *cx, uint32_t arg double arg0 = 0; cocos2d::Scene* arg1 = nullptr; bool arg2; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -51830,7 +51847,7 @@ bool js_cocos2dx_TransitionPageTurn_create(JSContext *cx, uint32_t argc, jsval * double arg0 = 0; cocos2d::Scene* arg1 = nullptr; bool arg2; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -51945,7 +51962,7 @@ bool js_cocos2dx_TransitionProgress_create(JSContext *cx, uint32_t argc, jsval * if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -52057,7 +52074,7 @@ bool js_cocos2dx_TransitionProgressRadialCCW_create(JSContext *cx, uint32_t argc if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -52169,7 +52186,7 @@ bool js_cocos2dx_TransitionProgressRadialCW_create(JSContext *cx, uint32_t argc, if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -52281,7 +52298,7 @@ bool js_cocos2dx_TransitionProgressHorizontal_create(JSContext *cx, uint32_t arg if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -52393,7 +52410,7 @@ bool js_cocos2dx_TransitionProgressVertical_create(JSContext *cx, uint32_t argc, if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -52505,7 +52522,7 @@ bool js_cocos2dx_TransitionProgressInOut_create(JSContext *cx, uint32_t argc, js if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -52617,7 +52634,7 @@ bool js_cocos2dx_TransitionProgressOutIn_create(JSContext *cx, uint32_t argc, js if (argc == 2) { double arg0 = 0; cocos2d::Scene* arg1 = nullptr; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); do { if (args.get(1).isNull()) { arg1 = nullptr; break; } if (!args.get(1).isObject()) { ok = false; break; } @@ -53052,10 +53069,10 @@ bool js_cocos2dx_Camera_initOrthographic(JSContext *cx, uint32_t argc, jsval *vp double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::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; @@ -53326,10 +53343,10 @@ bool js_cocos2dx_Camera_initPerspective(JSContext *cx, uint32_t argc, jsval *vp) double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_initPerspective : Error processing arguments"); bool ret = cobj->initPerspective(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -53350,10 +53367,10 @@ bool js_cocos2dx_Camera_createOrthographic(JSContext *cx, uint32_t argc, jsval * double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_createOrthographic : Error processing arguments"); auto ret = cocos2d::Camera::createOrthographic(arg0, arg1, arg2, arg3); @@ -53409,10 +53426,10 @@ bool js_cocos2dx_Camera_createPerspective(JSContext *cx, uint32_t argc, jsval *v double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_createPerspective : Error processing arguments"); auto ret = cocos2d::Camera::createPerspective(arg0, arg1, arg2, arg3); @@ -53698,7 +53715,7 @@ bool js_cocos2dx_CameraBackgroundBrush_createColorBrush(JSContext *cx, uint32_t cocos2d::Color4F arg0; double arg1 = 0; ok &= jsval_to_cccolor4f(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundBrush_createColorBrush : Error processing arguments"); auto ret = cocos2d::CameraBackgroundBrush::createColorBrush(arg0, arg1); @@ -53740,7 +53757,7 @@ bool js_cocos2dx_CameraBackgroundBrush_createDepthBrush(JSContext *cx, uint32_t } if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundBrush_createDepthBrush : Error processing arguments"); auto ret = cocos2d::CameraBackgroundBrush::createDepthBrush(arg0); @@ -53834,7 +53851,7 @@ bool js_cocos2dx_CameraBackgroundDepthBrush_setDepth(JSContext *cx, uint32_t arg JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_CameraBackgroundDepthBrush_setDepth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundDepthBrush_setDepth : Error processing arguments"); cobj->setDepth(arg0); args.rval().setUndefined(); @@ -53850,7 +53867,7 @@ bool js_cocos2dx_CameraBackgroundDepthBrush_create(JSContext *cx, uint32_t argc, bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundDepthBrush_create : Error processing arguments"); auto ret = cocos2d::CameraBackgroundDepthBrush::create(arg0); @@ -53959,7 +53976,7 @@ bool js_cocos2dx_CameraBackgroundColorBrush_create(JSContext *cx, uint32_t argc, cocos2d::Color4F arg0; double arg1 = 0; ok &= jsval_to_cccolor4f(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundColorBrush_create : Error processing arguments"); auto ret = cocos2d::CameraBackgroundColorBrush::create(arg0, arg1); @@ -55369,7 +55386,7 @@ bool js_cocos2dx_BaseLight_setIntensity(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_BaseLight_setIntensity : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_BaseLight_setIntensity : Error processing arguments"); cobj->setIntensity(arg0); args.rval().setUndefined(); @@ -55627,7 +55644,7 @@ bool js_cocos2dx_PointLight_setRange(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_PointLight_setRange : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_PointLight_setRange : Error processing arguments"); cobj->setRange(arg0); args.rval().setUndefined(); @@ -55647,7 +55664,7 @@ bool js_cocos2dx_PointLight_create(JSContext *cx, uint32_t argc, jsval *vp) double arg2 = 0; ok &= jsval_to_vector3(cx, args.get(0), &arg0); ok &= jsval_to_cccolor3b(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_PointLight_create : Error processing arguments"); auto ret = cocos2d::PointLight::create(arg0, arg1, arg2); @@ -55867,7 +55884,7 @@ bool js_cocos2dx_SpotLight_setOuterAngle(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpotLight_setOuterAngle : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpotLight_setOuterAngle : Error processing arguments"); cobj->setOuterAngle(arg0); args.rval().setUndefined(); @@ -55887,7 +55904,7 @@ bool js_cocos2dx_SpotLight_setInnerAngle(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpotLight_setInnerAngle : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpotLight_setInnerAngle : Error processing arguments"); cobj->setInnerAngle(arg0); args.rval().setUndefined(); @@ -55925,7 +55942,7 @@ bool js_cocos2dx_SpotLight_setRange(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpotLight_setRange : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpotLight_setRange : Error processing arguments"); cobj->setRange(arg0); args.rval().setUndefined(); @@ -55949,9 +55966,9 @@ bool js_cocos2dx_SpotLight_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_vector3(cx, args.get(0), &arg0); ok &= jsval_to_vector3(cx, args.get(1), &arg1); ok &= jsval_to_cccolor3b(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); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpotLight_create : Error processing arguments"); auto ret = cocos2d::SpotLight::create(arg0, arg1, arg2, arg3, arg4, arg5); @@ -56325,7 +56342,7 @@ bool js_cocos2dx_GLProgram_setUniformLocationWith1f(JSContext *cx, uint32_t argc int arg0 = 0; double arg1 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgram_setUniformLocationWith1f : Error processing arguments"); cobj->setUniformLocationWith1f(arg0, arg1); args.rval().setUndefined(); @@ -56398,9 +56415,9 @@ bool js_cocos2dx_GLProgram_setUniformLocationWith3f(JSContext *cx, uint32_t argc double arg2 = 0; double arg3 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&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(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgram_setUniformLocationWith3f : Error processing arguments"); cobj->setUniformLocationWith3f(arg0, arg1, arg2, arg3); args.rval().setUndefined(); @@ -56484,10 +56501,10 @@ bool js_cocos2dx_GLProgram_setUniformLocationWith4f(JSContext *cx, uint32_t argc double arg3 = 0; double arg4 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&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(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgram_setUniformLocationWith4f : Error processing arguments"); cobj->setUniformLocationWith4f(arg0, arg1, arg2, arg3, arg4); args.rval().setUndefined(); @@ -56626,8 +56643,8 @@ bool js_cocos2dx_GLProgram_setUniformLocationWith2f(JSContext *cx, uint32_t argc double arg1 = 0; double arg2 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&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(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgram_setUniformLocationWith2f : Error processing arguments"); cobj->setUniformLocationWith2f(arg0, arg1, arg2); args.rval().setUndefined(); @@ -58745,7 +58762,7 @@ bool js_cocos2dx_Device_setAccelerometerInterval(JSContext *cx, uint32_t argc, j bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Device_setAccelerometerInterval : Error processing arguments"); cocos2d::Device::setAccelerometerInterval(arg0); args.rval().setUndefined(); @@ -58777,7 +58794,7 @@ bool js_cocos2dx_Device_vibrate(JSContext *cx, uint32_t argc, jsval *vp) bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Device_vibrate : Error processing arguments"); cocos2d::Device::vibrate(arg0); args.rval().setUndefined(); @@ -60564,7 +60581,7 @@ bool js_cocos2dx_TextFieldTTF_initWithPlaceHolder(JSContext *cx, uint32_t argc, ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } bool ret = cobj->initWithPlaceHolder(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -60589,7 +60606,7 @@ bool js_cocos2dx_TextFieldTTF_initWithPlaceHolder(JSContext *cx, uint32_t argc, ok &= jsval_to_std_string(cx, args.get(3), &arg3); if (!ok) { ok = true; break; } double arg4 = 0; - ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); if (!ok) { ok = true; break; } bool ret = cobj->initWithPlaceHolder(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; @@ -60852,7 +60869,7 @@ bool js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder(JSContext *cx, uint32_t a ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::TextFieldTTF* ret = cocos2d::TextFieldTTF::textFieldWithPlaceHolder(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -60881,7 +60898,7 @@ bool js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder(JSContext *cx, uint32_t a ok &= jsval_to_std_string(cx, args.get(3), &arg3); if (!ok) { ok = true; break; } double arg4 = 0; - ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); if (!ok) { ok = true; break; } cocos2d::TextFieldTTF* ret = cocos2d::TextFieldTTF::textFieldWithPlaceHolder(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; @@ -64131,7 +64148,7 @@ bool js_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume(JSContext *cx, uint3 JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume : Error processing arguments"); cobj->setBackgroundMusicVolume(arg0); args.rval().setUndefined(); @@ -64271,7 +64288,7 @@ bool js_cocos2dx_SimpleAudioEngine_playEffect(JSContext *cx, uint32_t argc, jsva double arg2 = 0; 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)); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SimpleAudioEngine_playEffect : Error processing arguments"); unsigned int ret = cobj->playEffect(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -64286,8 +64303,8 @@ bool js_cocos2dx_SimpleAudioEngine_playEffect(JSContext *cx, uint32_t argc, jsva double arg3 = 0; 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)); - 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(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SimpleAudioEngine_playEffect : Error processing arguments"); unsigned int ret = cobj->playEffect(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; @@ -64303,9 +64320,9 @@ bool js_cocos2dx_SimpleAudioEngine_playEffect(JSContext *cx, uint32_t argc, jsva double arg4 = 0; 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)); - 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(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SimpleAudioEngine_playEffect : Error processing arguments"); unsigned int ret = cobj->playEffect(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; @@ -64389,7 +64406,7 @@ bool js_cocos2dx_SimpleAudioEngine_setEffectsVolume(JSContext *cx, uint32_t argc JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SimpleAudioEngine_setEffectsVolume : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SimpleAudioEngine_setEffectsVolume : Error processing arguments"); cobj->setEffectsVolume(arg0); args.rval().setUndefined(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index e57f0cc01d2b..f4574db8aed8 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -515,6 +515,7 @@ bool js_cocos2dx_Image_getData(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Image_getMipmaps(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Image_initWithRawData(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Image_setPNGPremultipliedAlphaEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Image_Image(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_GLProgramState_class; diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_builder_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_builder_auto.cpp index b3295e7196a6..4d1edf6d43ac 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_builder_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_builder_auto.cpp @@ -240,7 +240,7 @@ bool js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamedTweenD const char* arg0 = nullptr; double arg1 = 0; std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration : Error processing arguments"); cobj->runAnimationsForSequenceNamedTweenDuration(arg0, arg1); args.rval().setUndefined(); @@ -536,7 +536,7 @@ bool js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceIdTweenDura int arg0 = 0; double arg1 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration : Error processing arguments"); cobj->runAnimationsForSequenceIdTweenDuration(arg0, arg1); args.rval().setUndefined(); @@ -1358,7 +1358,7 @@ bool js_cocos2dx_builder_CCBReader_setResolutionScale(JSContext *cx, uint32_t ar bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_builder_CCBReader_setResolutionScale : Error processing arguments"); cocosbuilder::CCBReader::setResolutionScale(arg0); args.rval().setUndefined(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp index 25873b3e70c2..b55b26c0fe44 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp @@ -255,7 +255,7 @@ bool js_cocos2dx_experimental_video_VideoPlayer_seekTo(JSContext *cx, uint32_t a JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_seekTo : Error processing arguments"); cobj->seekTo(arg0); args.rval().setUndefined(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp index ad3162a52891..a3a095d722a0 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp @@ -181,6 +181,26 @@ bool js_cocos2dx_experimental_webView_WebView_loadURL(JSContext *cx, uint32_t ar JS_ReportError(cx, "js_cocos2dx_experimental_webView_WebView_loadURL : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_experimental_webView_WebView_setBounces(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::experimental::ui::WebView* cobj = (cocos2d::experimental::ui::WebView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_webView_WebView_setBounces : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_webView_WebView_setBounces : Error processing arguments"); + cobj->setBounces(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_experimental_webView_WebView_setBounces : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_experimental_webView_WebView_evaluateJS(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -384,6 +404,7 @@ void js_register_cocos2dx_experimental_webView_WebView(JSContext *cx, JS::Handle JS_FN("getOnDidFailLoading", js_cocos2dx_experimental_webView_WebView_getOnDidFailLoading, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("loadFile", js_cocos2dx_experimental_webView_WebView_loadFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("loadURL", js_cocos2dx_experimental_webView_WebView_loadURL, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setBounces", js_cocos2dx_experimental_webView_WebView_setBounces, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("evaluateJS", js_cocos2dx_experimental_webView_WebView_evaluateJS, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getOnJSCallback", js_cocos2dx_experimental_webView_WebView_getOnJSCallback, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("canGoForward", js_cocos2dx_experimental_webView_WebView_canGoForward, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.hpp index 0a6178d71c39..e6a06d65288d 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.hpp @@ -21,6 +21,7 @@ bool js_cocos2dx_experimental_webView_WebView_setScalesPageToFit(JSContext *cx, bool js_cocos2dx_experimental_webView_WebView_getOnDidFailLoading(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_webView_WebView_loadFile(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_webView_WebView_loadURL(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_experimental_webView_WebView_setBounces(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_webView_WebView_evaluateJS(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_webView_WebView_getOnJSCallback(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_experimental_webView_WebView_canGoForward(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp index a4a1188bc549..d93120939921 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp @@ -575,7 +575,7 @@ bool js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState(JSContext *cx, if (argc == 2) { double arg0 = 0; cocos2d::extension::Control::State arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState : Error processing arguments"); cobj->setTitleTTFSizeForState(arg0, arg1); @@ -758,7 +758,7 @@ bool js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize(JSC double arg2 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize : Error processing arguments"); bool ret = cobj->initWithTitleAndFontNameAndFontSize(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -986,7 +986,7 @@ bool js_cocos2dx_extension_ControlButton_setScaleRatio(JSContext *cx, uint32_t a JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlButton_setScaleRatio : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlButton_setScaleRatio : Error processing arguments"); cobj->setScaleRatio(arg0); args.rval().setUndefined(); @@ -1329,7 +1329,7 @@ bool js_cocos2dx_extension_ControlButton_create(JSContext *cx, uint32_t argc, js ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -1547,7 +1547,7 @@ bool js_cocos2dx_extension_ControlHuePicker_setHue(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlHuePicker_setHue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlHuePicker_setHue : Error processing arguments"); cobj->setHue(arg0); args.rval().setUndefined(); @@ -1653,7 +1653,7 @@ bool js_cocos2dx_extension_ControlHuePicker_setHuePercentage(JSContext *cx, uint JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlHuePicker_setHuePercentage : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlHuePicker_setHuePercentage : Error processing arguments"); cobj->setHuePercentage(arg0); args.rval().setUndefined(); @@ -2461,7 +2461,7 @@ bool js_cocos2dx_extension_ControlPotentiometer_setValue(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlPotentiometer_setValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlPotentiometer_setValue : Error processing arguments"); cobj->setValue(arg0); args.rval().setUndefined(); @@ -2569,7 +2569,7 @@ bool js_cocos2dx_extension_ControlPotentiometer_setMaximumValue(JSContext *cx, u JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlPotentiometer_setMaximumValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlPotentiometer_setMaximumValue : Error processing arguments"); cobj->setMaximumValue(arg0); args.rval().setUndefined(); @@ -2743,7 +2743,7 @@ bool js_cocos2dx_extension_ControlPotentiometer_setMinimumValue(JSContext *cx, u JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlPotentiometer_setMinimumValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlPotentiometer_setMinimumValue : Error processing arguments"); cobj->setMinimumValue(arg0); args.rval().setUndefined(); @@ -3222,7 +3222,7 @@ bool js_cocos2dx_extension_ControlSlider_setMaximumValue(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlSlider_setMaximumValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlSlider_setMaximumValue : Error processing arguments"); cobj->setMaximumValue(arg0); args.rval().setUndefined(); @@ -3350,7 +3350,7 @@ bool js_cocos2dx_extension_ControlSlider_setValue(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlSlider_setValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlSlider_setValue : Error processing arguments"); cobj->setValue(arg0); args.rval().setUndefined(); @@ -3400,7 +3400,7 @@ bool js_cocos2dx_extension_ControlSlider_setMinimumValue(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlSlider_setMinimumValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlSlider_setMinimumValue : Error processing arguments"); cobj->setMinimumValue(arg0); args.rval().setUndefined(); @@ -3420,7 +3420,7 @@ bool js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue(JSContext *cx, u JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue : Error processing arguments"); cobj->setMinimumAllowedValue(arg0); args.rval().setUndefined(); @@ -3490,7 +3490,7 @@ bool js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue(JSContext *cx, u JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue : Error processing arguments"); cobj->setMaximumAllowedValue(arg0); args.rval().setUndefined(); @@ -3796,7 +3796,7 @@ bool js_cocos2dx_extension_ControlStepper_setValue(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlStepper_setValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlStepper_setValue : Error processing arguments"); cobj->setValue(arg0); args.rval().setUndefined(); @@ -3816,7 +3816,7 @@ bool js_cocos2dx_extension_ControlStepper_setStepValue(JSContext *cx, uint32_t a JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlStepper_setStepValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlStepper_setStepValue : Error processing arguments"); cobj->setStepValue(arg0); args.rval().setUndefined(); @@ -3877,7 +3877,7 @@ bool js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent(JSContext *cx if (argc == 2) { double arg0 = 0; bool arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent : Error processing arguments"); cobj->setValueWithSendingEvent(arg0, arg1); @@ -3898,7 +3898,7 @@ bool js_cocos2dx_extension_ControlStepper_setMaximumValue(JSContext *cx, uint32_ JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlStepper_setMaximumValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlStepper_setMaximumValue : Error processing arguments"); cobj->setMaximumValue(arg0); args.rval().setUndefined(); @@ -4080,7 +4080,7 @@ bool js_cocos2dx_extension_ControlStepper_setMinimumValue(JSContext *cx, uint32_ JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ControlStepper_setMinimumValue : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlStepper_setMinimumValue : Error processing arguments"); cobj->setMinimumValue(arg0); args.rval().setUndefined(); @@ -4891,7 +4891,7 @@ bool js_cocos2dx_extension_ScrollView_setContentOffsetInDuration(JSContext *cx, cocos2d::Vec2 arg0; double arg1 = 0; ok &= jsval_to_vector2(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ScrollView_setContentOffsetInDuration : Error processing arguments"); cobj->setContentOffsetInDuration(arg0, arg1); args.rval().setUndefined(); @@ -4912,8 +4912,8 @@ bool js_cocos2dx_extension_ScrollView_setZoomScaleInDuration(JSContext *cx, uint if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ScrollView_setZoomScaleInDuration : Error processing arguments"); cobj->setZoomScaleInDuration(arg0, arg1); args.rval().setUndefined(); @@ -4934,7 +4934,7 @@ bool js_cocos2dx_extension_ScrollView_updateTweenAction(JSContext *cx, uint32_t if (argc == 2) { double arg0 = 0; std::string arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ScrollView_updateTweenAction : Error processing arguments"); cobj->updateTweenAction(arg0, arg1); @@ -4955,7 +4955,7 @@ bool js_cocos2dx_extension_ScrollView_setMaxScale(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ScrollView_setMaxScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ScrollView_setMaxScale : Error processing arguments"); cobj->setMaxScale(arg0); args.rval().setUndefined(); @@ -5033,7 +5033,7 @@ bool js_cocos2dx_extension_ScrollView_setMinScale(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_extension_ScrollView_setMinScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ScrollView_setMinScale : Error processing arguments"); cobj->setMinScale(arg0); args.rval().setUndefined(); @@ -5509,7 +5509,7 @@ bool js_cocos2dx_extension_ScrollView_setZoomScale(JSContext *cx, uint32_t argc, do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } bool arg1; arg1 = JS::ToBoolean(args.get(1)); @@ -5522,7 +5522,7 @@ bool js_cocos2dx_extension_ScrollView_setZoomScale(JSContext *cx, uint32_t argc, do { if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cobj->setZoomScale(arg0); args.rval().setUndefined(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp index 2c914819ccea..1afb44b7e50d 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp @@ -34,7 +34,7 @@ bool js_cocos2dx_navmesh_NavMeshAgent_setMaxSpeed(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setMaxSpeed : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setMaxSpeed : Error processing arguments"); cobj->setMaxSpeed(arg0); args.rval().setUndefined(); @@ -176,7 +176,7 @@ bool js_cocos2dx_navmesh_NavMeshAgent_setSeparationWeight(JSContext *cx, uint32_ JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setSeparationWeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setSeparationWeight : Error processing arguments"); cobj->setSeparationWeight(arg0); args.rval().setUndefined(); @@ -374,7 +374,7 @@ bool js_cocos2dx_navmesh_NavMeshAgent_setMaxAcceleration(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setMaxAcceleration : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setMaxAcceleration : Error processing arguments"); cobj->setMaxAcceleration(arg0); args.rval().setUndefined(); @@ -432,7 +432,7 @@ bool js_cocos2dx_navmesh_NavMeshAgent_setHeight(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setHeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setHeight : Error processing arguments"); cobj->setHeight(arg0); args.rval().setUndefined(); @@ -488,7 +488,7 @@ bool js_cocos2dx_navmesh_NavMeshAgent_setRadius(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setRadius : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_setRadius : Error processing arguments"); cobj->setRadius(arg0); args.rval().setUndefined(); @@ -676,8 +676,8 @@ bool js_cocos2dx_navmesh_NavMeshObstacle_initWith(JSContext *cx, uint32_t argc, if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshObstacle_initWith : Error processing arguments"); bool ret = cobj->initWith(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -784,8 +784,8 @@ bool js_cocos2dx_navmesh_NavMeshObstacle_create(JSContext *cx, uint32_t argc, js if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshObstacle_create : Error processing arguments"); auto ret = cocos2d::NavMeshObstacle::create(arg0, arg1); @@ -954,7 +954,7 @@ bool js_cocos2dx_navmesh_NavMesh_update(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_navmesh_NavMesh_update : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMesh_update : Error processing arguments"); cobj->update(arg0); args.rval().setUndefined(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp index a1a98d8b3c07..c0a516d8057e 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp @@ -88,7 +88,7 @@ bool js_cocos2dx_physics3d_Physics3DShape_initSphere(JSContext *cx, uint32_t arg JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DShape_initSphere : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_initSphere : Error processing arguments"); bool ret = cobj->initSphere(arg0); jsval jsret = JSVAL_NULL; @@ -133,8 +133,8 @@ bool js_cocos2dx_physics3d_Physics3DShape_initCapsule(JSContext *cx, uint32_t ar if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_initCapsule : Error processing arguments"); bool ret = cobj->initCapsule(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -157,8 +157,8 @@ bool js_cocos2dx_physics3d_Physics3DShape_initCylinder(JSContext *cx, uint32_t a if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_initCylinder : Error processing arguments"); bool ret = cobj->initCylinder(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -214,8 +214,8 @@ bool js_cocos2dx_physics3d_Physics3DShape_createCylinder(JSContext *cx, uint32_t if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createCylinder : Error processing arguments"); auto ret = cocos2d::Physics3DShape::createCylinder(arg0, arg1); @@ -264,8 +264,8 @@ bool js_cocos2dx_physics3d_Physics3DShape_createCapsule(JSContext *cx, uint32_t if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createCapsule : Error processing arguments"); auto ret = cocos2d::Physics3DShape::createCapsule(arg0, arg1); @@ -284,7 +284,7 @@ bool js_cocos2dx_physics3d_Physics3DShape_createSphere(JSContext *cx, uint32_t a bool ok = true; if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createSphere : Error processing arguments"); auto ret = cocos2d::Physics3DShape::createSphere(arg0); @@ -678,7 +678,7 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_setAngularFactor(JSContext *cx, ui do { if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } cobj->setAngularFactor(arg0); args.rval().setUndefined(); @@ -817,7 +817,7 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_setMassProps(JSContext *cx, uint32 if (argc == 2) { double arg0 = 0; cocos2d::Vec3 arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::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); @@ -838,7 +838,7 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_setFriction(JSContext *cx, uint32_ JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setFriction : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setFriction : Error processing arguments"); cobj->setFriction(arg0); args.rval().setUndefined(); @@ -879,8 +879,8 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_setDamping(JSContext *cx, uint32_t if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setDamping : Error processing arguments"); cobj->setDamping(arg0, arg1); args.rval().setUndefined(); @@ -960,7 +960,7 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_setCcdMotionThreshold(JSContext *c JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdMotionThreshold : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdMotionThreshold : Error processing arguments"); cobj->setCcdMotionThreshold(arg0); args.rval().setUndefined(); @@ -980,7 +980,7 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_setRollingFriction(JSContext *cx, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setRollingFriction : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setRollingFriction : Error processing arguments"); cobj->setRollingFriction(arg0); args.rval().setUndefined(); @@ -1036,7 +1036,7 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_applyDamping(JSContext *cx, uint32 JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyDamping : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_applyDamping : Error processing arguments"); cobj->applyDamping(arg0); args.rval().setUndefined(); @@ -1194,7 +1194,7 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_setCcdSweptSphereRadius(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdSweptSphereRadius : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setCcdSweptSphereRadius : Error processing arguments"); cobj->setCcdSweptSphereRadius(arg0); args.rval().setUndefined(); @@ -1584,7 +1584,7 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_setRestitution(JSContext *cx, uint JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setRestitution : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setRestitution : Error processing arguments"); cobj->setRestitution(arg0); args.rval().setUndefined(); @@ -1604,7 +1604,7 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_setHitFraction(JSContext *cx, uint JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setHitFraction : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DRigidBody_setHitFraction : Error processing arguments"); cobj->setHitFraction(arg0); args.rval().setUndefined(); @@ -2262,7 +2262,7 @@ bool js_cocos2dx_physics3d_Physics3DWorld_stepSimulate(JSContext *cx, uint32_t a JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_stepSimulate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_stepSimulate : Error processing arguments"); cobj->stepSimulate(arg0); args.rval().setUndefined(); @@ -2794,7 +2794,7 @@ bool js_cocos2dx_physics3d_Physics3DConstraint_setBreakingImpulse(JSContext *cx, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setBreakingImpulse : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConstraint_setBreakingImpulse : Error processing arguments"); cobj->setBreakingImpulse(arg0); args.rval().setUndefined(); @@ -3463,7 +3463,7 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setMaxMotorImpulse(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setMaxMotorImpulse : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setMaxMotorImpulse : Error processing arguments"); cobj->setMaxMotorImpulse(arg0); args.rval().setUndefined(); @@ -3486,8 +3486,8 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_enableAngularMotor(JSContext double arg1 = 0; double arg2 = 0; 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); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_enableAngularMotor : Error processing arguments"); cobj->enableAngularMotor(arg0, arg1, arg2); args.rval().setUndefined(); @@ -3698,8 +3698,8 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit(JSContext *cx, uint if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit : Error processing arguments"); cobj->setLimit(arg0, arg1); args.rval().setUndefined(); @@ -3709,9 +3709,9 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit(JSContext *cx, uint double arg0 = 0; double arg1 = 0; double arg2 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit : Error processing arguments"); cobj->setLimit(arg0, arg1, arg2); args.rval().setUndefined(); @@ -3722,10 +3722,10 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit(JSContext *cx, uint double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit : Error processing arguments"); cobj->setLimit(arg0, arg1, arg2, arg3); args.rval().setUndefined(); @@ -3737,11 +3737,11 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setLimit(JSContext *cx, uint double arg2 = 0; double arg3 = 0; double arg4 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::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(); @@ -3765,10 +3765,10 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setMotorTarget(JSContext *cx do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cobj->setMotorTarget(arg0, arg1); args.rval().setUndefined(); @@ -3782,7 +3782,7 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_setMotorTarget(JSContext *cx ok &= jsval_to_quaternion(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cobj->setMotorTarget(arg0, arg1); args.rval().setUndefined(); @@ -4298,7 +4298,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoLin(JSCo JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoLin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoLin : Error processing arguments"); cobj->setRestitutionOrthoLin(arg0); args.rval().setUndefined(); @@ -4318,7 +4318,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirLin(JSCont JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirLin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirLin : Error processing arguments"); cobj->setRestitutionDirLin(arg0); args.rval().setUndefined(); @@ -4466,7 +4466,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoLin(JSConte JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoLin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoLin : Error processing arguments"); cobj->setSoftnessOrthoLin(arg0); args.rval().setUndefined(); @@ -4486,7 +4486,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimLin(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimLin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimLin : Error processing arguments"); cobj->setSoftnessLimLin(arg0); args.rval().setUndefined(); @@ -4524,7 +4524,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimAng(JSCont JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimAng : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimAng : Error processing arguments"); cobj->setRestitutionLimAng(arg0); args.rval().setUndefined(); @@ -4544,7 +4544,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperLinLimit(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperLinLimit : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperLinLimit : Error processing arguments"); cobj->setUpperLinLimit(arg0); args.rval().setUndefined(); @@ -4564,7 +4564,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirLin(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirLin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirLin : Error processing arguments"); cobj->setDampingDirLin(arg0); args.rval().setUndefined(); @@ -4656,7 +4656,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerAngLimit(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerAngLimit : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerAngLimit : Error processing arguments"); cobj->setLowerAngLimit(arg0); args.rval().setUndefined(); @@ -4676,7 +4676,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperAngLimit(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperAngLimit : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setUpperAngLimit : Error processing arguments"); cobj->setUpperAngLimit(arg0); args.rval().setUndefined(); @@ -4696,7 +4696,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetLinMotorVelocity(J JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetLinMotorVelocity : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetLinMotorVelocity : Error processing arguments"); cobj->setTargetLinMotorVelocity(arg0); args.rval().setUndefined(); @@ -4716,7 +4716,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimAng(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimAng : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimAng : Error processing arguments"); cobj->setDampingLimAng(arg0); args.rval().setUndefined(); @@ -4828,7 +4828,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerLinLimit(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerLinLimit : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setLowerLinLimit : Error processing arguments"); cobj->setLowerLinLimit(arg0); args.rval().setUndefined(); @@ -4920,7 +4920,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoAng(JSContex JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoAng : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoAng : Error processing arguments"); cobj->setDampingOrthoAng(arg0); args.rval().setUndefined(); @@ -4940,7 +4940,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirAng(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirAng : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirAng : Error processing arguments"); cobj->setSoftnessDirAng(arg0); args.rval().setUndefined(); @@ -4978,7 +4978,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoAng(JSCo JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoAng : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionOrthoAng : Error processing arguments"); cobj->setRestitutionOrthoAng(arg0); args.rval().setUndefined(); @@ -4998,7 +4998,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirAng(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirAng : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingDirAng : Error processing arguments"); cobj->setDampingDirAng(arg0); args.rval().setUndefined(); @@ -5112,7 +5112,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxLinMotorForce(JSConte JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxLinMotorForce : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxLinMotorForce : Error processing arguments"); cobj->setMaxLinMotorForce(arg0); args.rval().setUndefined(); @@ -5150,7 +5150,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetAngMotorVelocity(J JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetAngMotorVelocity : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setTargetAngMotorVelocity : Error processing arguments"); cobj->setTargetAngMotorVelocity(arg0); args.rval().setUndefined(); @@ -5188,7 +5188,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirAng(JSCont JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirAng : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionDirAng : Error processing arguments"); cobj->setRestitutionDirAng(arg0); args.rval().setUndefined(); @@ -5280,7 +5280,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimLin(JSCont JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimLin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setRestitutionLimLin : Error processing arguments"); cobj->setRestitutionLimLin(arg0); args.rval().setUndefined(); @@ -5318,7 +5318,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoLin(JSContex JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoLin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingOrthoLin : Error processing arguments"); cobj->setDampingOrthoLin(arg0); args.rval().setUndefined(); @@ -5338,7 +5338,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoAng(JSConte JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoAng : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessOrthoAng : Error processing arguments"); cobj->setSoftnessOrthoAng(arg0); args.rval().setUndefined(); @@ -5358,7 +5358,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimLin(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimLin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setDampingLimLin : Error processing arguments"); cobj->setDampingLimLin(arg0); args.rval().setUndefined(); @@ -5378,7 +5378,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirLin(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirLin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessDirLin : Error processing arguments"); cobj->setSoftnessDirLin(arg0); args.rval().setUndefined(); @@ -5398,7 +5398,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxAngMotorForce(JSConte JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxAngMotorForce : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setMaxAngMotorForce : Error processing arguments"); cobj->setMaxAngMotorForce(arg0); args.rval().setUndefined(); @@ -5436,7 +5436,7 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimAng(JSContext JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimAng : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_setSoftnessLimAng : Error processing arguments"); cobj->setSoftnessLimAng(arg0); args.rval().setUndefined(); @@ -5666,7 +5666,7 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFixThresh(JSContext * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFixThresh : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setFixThresh : Error processing arguments"); cobj->setFixThresh(arg0); args.rval().setUndefined(); @@ -5776,7 +5776,7 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulse(JSCon JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulse : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulse : Error processing arguments"); cobj->setMaxMotorImpulse(arg0); args.rval().setUndefined(); @@ -5837,8 +5837,8 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_GetPointForAngle(JSConte if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::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; @@ -5860,7 +5860,7 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulseNormal JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulseNormalized : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setMaxMotorImpulseNormalized : Error processing arguments"); cobj->setMaxMotorImpulseNormalized(arg0); args.rval().setUndefined(); @@ -5898,7 +5898,7 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setDamping(JSContext *cx JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setDamping : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setDamping : Error processing arguments"); cobj->setDamping(arg0); args.rval().setUndefined(); @@ -5920,9 +5920,9 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit(JSContext *cx, double arg0 = 0; double arg1 = 0; double arg2 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit : Error processing arguments"); cobj->setLimit(arg0, arg1, arg2); args.rval().setUndefined(); @@ -5933,10 +5933,10 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit(JSContext *cx, double arg1 = 0; double arg2 = 0; double arg3 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit : Error processing arguments"); cobj->setLimit(arg0, arg1, arg2, arg3); args.rval().setUndefined(); @@ -5948,11 +5948,11 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit(JSContext *cx, double arg2 = 0; double arg3 = 0; double arg4 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::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(); @@ -5965,12 +5965,12 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_setLimit(JSContext *cx, double arg3 = 0; double arg4 = 0; double arg5 = 0; - 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); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::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(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp index 757613d6615c..2dc3a8ff7496 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp @@ -33,7 +33,7 @@ bool js_cocos2dx_spine_SkeletonRenderer_setTimeScale(JSContext *cx, uint32_t arg JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_spine_SkeletonRenderer_setTimeScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_spine_SkeletonRenderer_setTimeScale : Error processing arguments"); cobj->setTimeScale(arg0); args.rval().setUndefined(); @@ -369,7 +369,7 @@ bool js_cocos2dx_spine_SkeletonRenderer_initWithFile(JSContext *cx, uint32_t arg ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj->initWithFile(arg0, arg1, arg2); args.rval().setUndefined(); @@ -402,7 +402,7 @@ bool js_cocos2dx_spine_SkeletonRenderer_initWithFile(JSContext *cx, uint32_t arg ok = false; if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj->initWithFile(arg0, arg1, arg2); args.rval().setUndefined(); @@ -524,7 +524,7 @@ bool js_cocos2dx_spine_SkeletonRenderer_createWithFile(JSContext *cx, uint32_t a ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } spine::SkeletonRenderer* ret = spine::SkeletonRenderer::createWithFile(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -568,7 +568,7 @@ bool js_cocos2dx_spine_SkeletonRenderer_createWithFile(JSContext *cx, uint32_t a ok = false; if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } spine::SkeletonRenderer* ret = spine::SkeletonRenderer::createWithFile(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -670,7 +670,7 @@ bool js_cocos2dx_spine_SkeletonRenderer_constructor(JSContext *cx, uint32_t argc ok = false; if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1, arg2); @@ -711,7 +711,7 @@ bool js_cocos2dx_spine_SkeletonRenderer_constructor(JSContext *cx, uint32_t argc ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1, arg2); @@ -1039,7 +1039,7 @@ bool js_cocos2dx_spine_SkeletonAnimation_update(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_spine_SkeletonAnimation_update : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_spine_SkeletonAnimation_update : Error processing arguments"); cobj->update(arg0); args.rval().setUndefined(); @@ -1194,7 +1194,7 @@ bool js_cocos2dx_spine_SkeletonAnimation_setMix(JSContext *cx, uint32_t argc, js double arg2 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_spine_SkeletonAnimation_setMix : Error processing arguments"); cobj->setMix(arg0, arg1, arg2); args.rval().setUndefined(); @@ -1363,7 +1363,7 @@ bool js_cocos2dx_spine_SkeletonAnimation_createWithFile(JSContext *cx, uint32_t ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } spine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -1407,7 +1407,7 @@ bool js_cocos2dx_spine_SkeletonAnimation_createWithFile(JSContext *cx, uint32_t ok = false; if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } spine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -1509,7 +1509,7 @@ bool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t arg ok = false; if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2); @@ -1550,7 +1550,7 @@ bool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t arg ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2); @@ -1643,7 +1643,7 @@ bool js_cocos2dx_spine_SkeletonAnimation_ctor(JSContext *cx, uint32_t argc, jsva ok = false; if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2); @@ -1676,7 +1676,7 @@ bool js_cocos2dx_spine_SkeletonAnimation_ctor(JSContext *cx, uint32_t argc, jsva ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp index fbfd2cb2cfdc..eb21ea914cca 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp @@ -34,7 +34,7 @@ bool js_cocos2dx_studio_ActionObject_setCurrentTime(JSContext *cx, uint32_t argc JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ActionObject_setCurrentTime : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionObject_setCurrentTime : Error processing arguments"); cobj->setCurrentTime(arg0); args.rval().setUndefined(); @@ -90,7 +90,7 @@ bool js_cocos2dx_studio_ActionObject_setUnitTime(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ActionObject_setUnitTime : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionObject_setUnitTime : Error processing arguments"); cobj->setUnitTime(arg0); args.rval().setUndefined(); @@ -372,7 +372,7 @@ bool js_cocos2dx_studio_ActionObject_updateToFrameByTime(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ActionObject_updateToFrameByTime : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionObject_updateToFrameByTime : Error processing arguments"); cobj->updateToFrameByTime(arg0); args.rval().setUndefined(); @@ -412,7 +412,7 @@ bool js_cocos2dx_studio_ActionObject_simulationActionUpdate(JSContext *cx, uint3 JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ActionObject_simulationActionUpdate : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionObject_simulationActionUpdate : Error processing arguments"); cobj->simulationActionUpdate(arg0); args.rval().setUndefined(); @@ -557,6 +557,24 @@ bool js_cocos2dx_studio_ActionManagerEx_getActionByName(JSContext *cx, uint32_t JS_ReportError(cx, "js_cocos2dx_studio_ActionManagerEx_getActionByName : wrong number of arguments: %d, was expecting %d", argc, 2); return false; } +bool js_cocos2dx_studio_ActionManagerEx_getStudioVersionNumber(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); + cocostudio::ActionManagerEx* cobj = (cocostudio::ActionManagerEx *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ActionManagerEx_getStudioVersionNumber : Invalid Native Object"); + if (argc == 0) { + int ret = cobj->getStudioVersionNumber(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_studio_ActionManagerEx_getStudioVersionNumber : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_studio_ActionManagerEx_initWithBinary(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -728,6 +746,7 @@ void js_register_cocos2dx_studio_ActionManagerEx(JSContext *cx, JS::HandleObject static JSFunctionSpec funcs[] = { JS_FN("stopActionByName", js_cocos2dx_studio_ActionManagerEx_stopActionByName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getActionByName", js_cocos2dx_studio_ActionManagerEx_getActionByName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getStudioVersionNumber", js_cocos2dx_studio_ActionManagerEx_getStudioVersionNumber, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("initWithBinary", js_cocos2dx_studio_ActionManagerEx_initWithBinary, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("playActionByName", js_cocos2dx_studio_ActionManagerEx_playActionByName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("releaseActions", js_cocos2dx_studio_ActionManagerEx_releaseActions, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -1565,7 +1584,7 @@ bool js_cocos2dx_studio_ProcessBase_update(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ProcessBase_update : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ProcessBase_update : Error processing arguments"); cobj->update(arg0); args.rval().setUndefined(); @@ -1713,7 +1732,7 @@ bool js_cocos2dx_studio_ProcessBase_setProcessScale(JSContext *cx, uint32_t argc JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ProcessBase_setProcessScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ProcessBase_setProcessScale : Error processing arguments"); cobj->setProcessScale(arg0); args.rval().setUndefined(); @@ -2979,10 +2998,10 @@ bool js_cocos2dx_studio_DisplayManager_containPoint(JSContext *cx, uint32_t argc do { if (argc == 2) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } bool ret = cobj->containPoint(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -4422,7 +4441,7 @@ bool js_cocos2dx_studio_ArmatureAnimation_setSpeedScale(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ArmatureAnimation_setSpeedScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ArmatureAnimation_setSpeedScale : Error processing arguments"); cobj->setSpeedScale(arg0); args.rval().setUndefined(); @@ -5374,8 +5393,8 @@ bool js_cocos2dx_studio_Armature_getBoneAtPoint(JSContext *cx, uint32_t argc, js if (argc == 2) { double arg0 = 0; double arg1 = 0; - 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_Armature_getBoneAtPoint : Error processing arguments"); cocostudio::Bone* ret = cobj->getBoneAtPoint(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -5419,7 +5438,7 @@ bool js_cocos2dx_studio_Armature_setVersion(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_Armature_setVersion : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_Armature_setVersion : Error processing arguments"); cobj->setVersion(arg0); args.rval().setUndefined(); @@ -6264,7 +6283,7 @@ bool js_cocos2dx_studio_ComAttribute_getFloat(JSContext *cx, uint32_t argc, jsva std::string arg0; double arg1 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ComAttribute_getFloat : Error processing arguments"); double ret = cobj->getFloat(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -6356,7 +6375,7 @@ bool js_cocos2dx_studio_ComAttribute_setFloat(JSContext *cx, uint32_t argc, jsva std::string arg0; double arg1 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ComAttribute_setFloat : Error processing arguments"); cobj->setFloat(arg0, arg1); args.rval().setUndefined(); @@ -6679,7 +6698,7 @@ bool js_cocos2dx_studio_ComAudio_setBackgroundMusicVolume(JSContext *cx, uint32_ JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ComAudio_setBackgroundMusicVolume : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ComAudio_setBackgroundMusicVolume : Error processing arguments"); cobj->setBackgroundMusicVolume(arg0); args.rval().setUndefined(); @@ -7113,7 +7132,7 @@ bool js_cocos2dx_studio_ComAudio_setEffectsVolume(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ComAudio_setEffectsVolume : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ComAudio_setEffectsVolume : Error processing arguments"); cobj->setEffectsVolume(arg0); args.rval().setUndefined(); @@ -7986,7 +8005,7 @@ bool js_cocos2dx_studio_Frame_apply(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_Frame_apply : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_Frame_apply : Error processing arguments"); cobj->apply(arg0); args.rval().setUndefined(); @@ -8410,7 +8429,7 @@ bool js_cocos2dx_studio_RotationFrame_setRotation(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_RotationFrame_setRotation : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_RotationFrame_setRotation : Error processing arguments"); cobj->setRotation(arg0); args.rval().setUndefined(); @@ -8550,7 +8569,7 @@ bool js_cocos2dx_studio_SkewFrame_setSkewX(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_SkewFrame_setSkewX : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_SkewFrame_setSkewX : Error processing arguments"); cobj->setSkewX(arg0); args.rval().setUndefined(); @@ -8570,7 +8589,7 @@ bool js_cocos2dx_studio_SkewFrame_setSkewY(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_SkewFrame_setSkewY : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_SkewFrame_setSkewY : Error processing arguments"); cobj->setSkewY(arg0); args.rval().setUndefined(); @@ -8832,7 +8851,7 @@ bool js_cocos2dx_studio_PositionFrame_setX(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_PositionFrame_setX : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_PositionFrame_setX : Error processing arguments"); cobj->setX(arg0); args.rval().setUndefined(); @@ -8852,7 +8871,7 @@ bool js_cocos2dx_studio_PositionFrame_setY(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_PositionFrame_setY : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_PositionFrame_setY : Error processing arguments"); cobj->setY(arg0); args.rval().setUndefined(); @@ -8978,7 +8997,7 @@ bool js_cocos2dx_studio_ScaleFrame_setScaleY(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ScaleFrame_setScaleY : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ScaleFrame_setScaleY : Error processing arguments"); cobj->setScaleY(arg0); args.rval().setUndefined(); @@ -8998,7 +9017,7 @@ bool js_cocos2dx_studio_ScaleFrame_setScaleX(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ScaleFrame_setScaleX : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ScaleFrame_setScaleX : Error processing arguments"); cobj->setScaleX(arg0); args.rval().setUndefined(); @@ -9054,7 +9073,7 @@ bool js_cocos2dx_studio_ScaleFrame_setScale(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ScaleFrame_setScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ScaleFrame_setScale : Error processing arguments"); cobj->setScale(arg0); args.rval().setUndefined(); @@ -11407,7 +11426,7 @@ bool js_cocos2dx_studio_ActionTimeline_setTimeSpeed(JSContext *cx, uint32_t argc JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ActionTimeline_setTimeSpeed : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionTimeline_setTimeSpeed : Error processing arguments"); cobj->setTimeSpeed(arg0); args.rval().setUndefined(); @@ -11929,7 +11948,7 @@ bool js_cocos2dx_studio_BoneNode_setDebugDrawLength(JSContext *cx, uint32_t argc JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_BoneNode_setDebugDrawLength : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_BoneNode_setDebugDrawLength : Error processing arguments"); cobj->setDebugDrawLength(arg0); args.rval().setUndefined(); @@ -12001,7 +12020,7 @@ bool js_cocos2dx_studio_BoneNode_setDebugDrawWidth(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_BoneNode_setDebugDrawWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_BoneNode_setDebugDrawWidth : Error processing arguments"); cobj->setDebugDrawWidth(arg0); args.rval().setUndefined(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.hpp index e00a6278582e..ccb57f1d85a8 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.hpp @@ -41,6 +41,7 @@ void js_register_cocos2dx_studio_ActionManagerEx(JSContext *cx, JS::HandleObject void register_all_cocos2dx_studio(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_studio_ActionManagerEx_stopActionByName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_studio_ActionManagerEx_getActionByName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_studio_ActionManagerEx_getStudioVersionNumber(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_studio_ActionManagerEx_initWithBinary(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_studio_ActionManagerEx_playActionByName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_studio_ActionManagerEx_releaseActions(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp index 6d68ef5ae011..28829d26f972 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp @@ -3100,7 +3100,7 @@ bool js_cocos2dx_ui_Button_setTitleFontSize(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Button_setTitleFontSize : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Button_setTitleFontSize : Error processing arguments"); cobj->setTitleFontSize(arg0); args.rval().setUndefined(); @@ -3875,7 +3875,7 @@ bool js_cocos2dx_ui_Button_setZoomScale(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Button_setZoomScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Button_setZoomScale : Error processing arguments"); cobj->setZoomScale(arg0); args.rval().setUndefined(); @@ -4591,7 +4591,7 @@ bool js_cocos2dx_ui_AbstractCheckButton_setZoomScale(JSContext *cx, uint32_t arg JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_AbstractCheckButton_setZoomScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_AbstractCheckButton_setZoomScale : Error processing arguments"); cobj->setZoomScale(arg0); args.rval().setUndefined(); @@ -6233,7 +6233,7 @@ bool js_cocos2dx_ui_Text_init(JSContext *cx, uint32_t argc, jsval *vp) double arg2 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Text_init : Error processing arguments"); bool ret = cobj->init(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -6467,7 +6467,7 @@ bool js_cocos2dx_ui_Text_setFontSize(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Text_setFontSize : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Text_setFontSize : Error processing arguments"); cobj->setFontSize(arg0); args.rval().setUndefined(); @@ -6605,7 +6605,7 @@ bool js_cocos2dx_ui_Text_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::ui::Text* ret = cocos2d::ui::Text::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -7016,7 +7016,7 @@ bool js_cocos2dx_ui_LoadingBar_setPercent(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LoadingBar_setPercent : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LoadingBar_setPercent : Error processing arguments"); cobj->setPercent(arg0); args.rval().setUndefined(); @@ -7233,7 +7233,7 @@ bool js_cocos2dx_ui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(0), &arg0); if (!ok) { ok = true; break; } double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); if (!ok) { ok = true; break; } cocos2d::ui::LoadingBar* ret = cocos2d::ui::LoadingBar::create(arg0, arg1); jsval jsret = JSVAL_NULL; @@ -7289,7 +7289,7 @@ bool js_cocos2dx_ui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); if (!ok) { ok = true; break; } double arg2 = 0; - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); if (!ok) { ok = true; break; } cocos2d::ui::LoadingBar* ret = cocos2d::ui::LoadingBar::create(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; @@ -7409,7 +7409,7 @@ bool js_cocos2dx_ui_ScrollView_scrollToTop(JSContext *cx, uint32_t argc, jsval * if (argc == 2) { double arg0 = 0; bool arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToTop : Error processing arguments"); cobj->scrollToTop(arg0, arg1); @@ -7432,8 +7432,8 @@ bool js_cocos2dx_ui_ScrollView_scrollToPercentHorizontal(JSContext *cx, uint32_t double arg0 = 0; double arg1 = 0; bool 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); arg2 = JS::ToBoolean(args.get(2)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToPercentHorizontal : Error processing arguments"); cobj->scrollToPercentHorizontal(arg0, arg1, arg2); @@ -7513,7 +7513,7 @@ bool js_cocos2dx_ui_ScrollView_scrollToBottom(JSContext *cx, uint32_t argc, jsva if (argc == 2) { double arg0 = 0; bool arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToBottom : Error processing arguments"); cobj->scrollToBottom(arg0, arg1); @@ -7573,7 +7573,7 @@ bool js_cocos2dx_ui_ScrollView_scrollToBottomLeft(JSContext *cx, uint32_t argc, if (argc == 2) { double arg0 = 0; bool arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToBottomLeft : Error processing arguments"); cobj->scrollToBottomLeft(arg0, arg1); @@ -7673,7 +7673,7 @@ bool js_cocos2dx_ui_ScrollView_scrollToTopLeft(JSContext *cx, uint32_t argc, jsv if (argc == 2) { double arg0 = 0; bool arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToTopLeft : Error processing arguments"); cobj->scrollToTopLeft(arg0, arg1); @@ -7713,7 +7713,7 @@ bool js_cocos2dx_ui_ScrollView_scrollToPercentBothDirection(JSContext *cx, uint3 double arg1 = 0; bool arg2; ok &= jsval_to_vector2(cx, args.get(0), &arg0); - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); arg2 = JS::ToBoolean(args.get(2)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToPercentBothDirection : Error processing arguments"); cobj->scrollToPercentBothDirection(arg0, arg1, arg2); @@ -7808,7 +7808,7 @@ bool js_cocos2dx_ui_ScrollView_jumpToPercentVertical(JSContext *cx, uint32_t arg JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ScrollView_jumpToPercentVertical : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_jumpToPercentVertical : Error processing arguments"); cobj->jumpToPercentVertical(arg0); args.rval().setUndefined(); @@ -7875,7 +7875,7 @@ bool js_cocos2dx_ui_ScrollView_setScrollBarAutoHideTime(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ScrollView_setScrollBarAutoHideTime : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_setScrollBarAutoHideTime : Error processing arguments"); cobj->setScrollBarAutoHideTime(arg0); args.rval().setUndefined(); @@ -7989,7 +7989,7 @@ bool js_cocos2dx_ui_ScrollView_jumpToPercentHorizontal(JSContext *cx, uint32_t a JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ScrollView_jumpToPercentHorizontal : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_jumpToPercentHorizontal : Error processing arguments"); cobj->jumpToPercentHorizontal(arg0); args.rval().setUndefined(); @@ -8025,7 +8025,7 @@ bool js_cocos2dx_ui_ScrollView_setTouchTotalTimeThreshold(JSContext *cx, uint32_ JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ScrollView_setTouchTotalTimeThreshold : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_setTouchTotalTimeThreshold : Error processing arguments"); cobj->setTouchTotalTimeThreshold(arg0); args.rval().setUndefined(); @@ -8081,7 +8081,7 @@ bool js_cocos2dx_ui_ScrollView_setScrollBarWidth(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ScrollView_setScrollBarWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_setScrollBarWidth : Error processing arguments"); cobj->setScrollBarWidth(arg0); args.rval().setUndefined(); @@ -8154,7 +8154,7 @@ bool js_cocos2dx_ui_ScrollView_scrollToLeft(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; bool arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToLeft : Error processing arguments"); cobj->scrollToLeft(arg0, arg1); @@ -8215,8 +8215,8 @@ bool js_cocos2dx_ui_ScrollView_scrollToPercentVertical(JSContext *cx, uint32_t a double arg0 = 0; double arg1 = 0; bool 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(0), &arg0) && !std::isnan(arg0); + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !std::isnan(arg1); arg2 = JS::ToBoolean(args.get(2)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToPercentVertical : Error processing arguments"); cobj->scrollToPercentVertical(arg0, arg1, arg2); @@ -8256,7 +8256,7 @@ bool js_cocos2dx_ui_ScrollView_scrollToBottomRight(JSContext *cx, uint32_t argc, if (argc == 2) { double arg0 = 0; bool arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToBottomRight : Error processing arguments"); cobj->scrollToBottomRight(arg0, arg1); @@ -8352,7 +8352,7 @@ bool js_cocos2dx_ui_ScrollView_scrollToRight(JSContext *cx, uint32_t argc, jsval if (argc == 2) { double arg0 = 0; bool arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToRight : Error processing arguments"); cobj->scrollToRight(arg0, arg1); @@ -8460,7 +8460,7 @@ bool js_cocos2dx_ui_ScrollView_scrollToTopRight(JSContext *cx, uint32_t argc, js if (argc == 2) { double arg0 = 0; bool arg1; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollView_scrollToTopRight : Error processing arguments"); cobj->scrollToTopRight(arg0, arg1); @@ -8819,6 +8819,26 @@ bool js_cocos2dx_ui_ListView_pushBackCustomItem(JSContext *cx, uint32_t argc, js JS_ReportError(cx, "js_cocos2dx_ui_ListView_pushBackCustomItem : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_ui_ListView_setCurSelectedIndex(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::ui::ListView* cobj = (cocos2d::ui::ListView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_setCurSelectedIndex : Invalid Native Object"); + if (argc == 1) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_setCurSelectedIndex : Error processing arguments"); + cobj->setCurSelectedIndex(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_ListView_setCurSelectedIndex : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_ui_ListView_insertDefaultItem(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9032,7 +9052,7 @@ bool js_cocos2dx_ui_ListView_setItemsMargin(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ListView_setItemsMargin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ListView_setItemsMargin : Error processing arguments"); cobj->setItemsMargin(arg0); args.rval().setUndefined(); @@ -9129,7 +9149,7 @@ bool js_cocos2dx_ui_ListView_scrollToItem(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_vector2(cx, args.get(2), &arg2); if (!ok) { ok = true; break; } double arg3 = 0; - ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); if (!ok) { ok = true; break; } cobj->scrollToItem(arg0, arg1, arg2, arg3); args.rval().setUndefined(); @@ -9401,6 +9421,7 @@ void js_register_cocos2dx_ui_ListView(JSContext *cx, JS::HandleObject global) { JS_FN("setMagneticType", js_cocos2dx_ui_ListView_setMagneticType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getIndex", js_cocos2dx_ui_ListView_getIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("pushBackCustomItem", js_cocos2dx_ui_ListView_pushBackCustomItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setCurSelectedIndex", js_cocos2dx_ui_ListView_setCurSelectedIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("insertDefaultItem", js_cocos2dx_ui_ListView_insertDefaultItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setMagneticAllowedOutOfBoundary", js_cocos2dx_ui_ListView_setMagneticAllowedOutOfBoundary, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("addEventListener", js_cocos2dx_ui_ListView_addEventListener, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -10036,7 +10057,7 @@ bool js_cocos2dx_ui_Slider_setZoomScale(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Slider_setZoomScale : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Slider_setZoomScale : Error processing arguments"); cobj->setZoomScale(arg0); args.rval().setUndefined(); @@ -10749,7 +10770,7 @@ bool js_cocos2dx_ui_UICCTextField_create(JSContext *cx, uint32_t argc, jsval *vp double arg2 = 0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_UICCTextField_create : Error processing arguments"); auto ret = cocos2d::ui::UICCTextField::create(arg0, arg1, arg2); @@ -12183,7 +12204,7 @@ bool js_cocos2dx_ui_PageView_setIndicatorSpaceBetweenIndexNodes(JSContext *cx, u JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_PageView_setIndicatorSpaceBetweenIndexNodes : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_PageView_setIndicatorSpaceBetweenIndexNodes : Error processing arguments"); cobj->setIndicatorSpaceBetweenIndexNodes(arg0); args.rval().setUndefined(); @@ -12223,6 +12244,22 @@ bool js_cocos2dx_ui_PageView_insertPage(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_PageView_insertPage : wrong number of arguments: %d, was expecting %d", argc, 2); return false; } +bool js_cocos2dx_ui_PageView_removeAllPages(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::ui::PageView* cobj = (cocos2d::ui::PageView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_PageView_removeAllPages : Invalid Native Object"); + if (argc == 0) { + cobj->removeAllPages(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_PageView_removeAllPages : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ui_PageView_setAutoScrollStopEpsilon(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12233,7 +12270,7 @@ bool js_cocos2dx_ui_PageView_setAutoScrollStopEpsilon(JSContext *cx, uint32_t ar JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_PageView_setAutoScrollStopEpsilon : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_PageView_setAutoScrollStopEpsilon : Error processing arguments"); cobj->setAutoScrollStopEpsilon(arg0); args.rval().setUndefined(); @@ -12243,6 +12280,26 @@ bool js_cocos2dx_ui_PageView_setAutoScrollStopEpsilon(JSContext *cx, uint32_t ar JS_ReportError(cx, "js_cocos2dx_ui_PageView_setAutoScrollStopEpsilon : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_ui_PageView_setIndicatorIndexNodesScale(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::ui::PageView* cobj = (cocos2d::ui::PageView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_PageView_setIndicatorIndexNodesScale : Invalid Native Object"); + if (argc == 1) { + double arg0 = 0; + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_PageView_setIndicatorIndexNodesScale : Error processing arguments"); + cobj->setIndicatorIndexNodesScale(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_PageView_setIndicatorIndexNodesScale : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_ui_PageView_setIndicatorEnabled(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12368,6 +12425,24 @@ bool js_cocos2dx_ui_PageView_setCurrentPageIndex(JSContext *cx, uint32_t argc, j JS_ReportError(cx, "js_cocos2dx_ui_PageView_setCurrentPageIndex : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_ui_PageView_getIndicatorIndexNodesColor(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::ui::PageView* cobj = (cocos2d::ui::PageView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_PageView_getIndicatorIndexNodesColor : Invalid Native Object"); + if (argc == 0) { + const cocos2d::Color3B& ret = cobj->getIndicatorIndexNodesColor(); + jsval jsret = JSVAL_NULL; + jsret = cccolor3b_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_PageView_getIndicatorIndexNodesColor : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ui_PageView_getIndicatorSelectedIndexColor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12386,6 +12461,24 @@ bool js_cocos2dx_ui_PageView_getIndicatorSelectedIndexColor(JSContext *cx, uint3 JS_ReportError(cx, "js_cocos2dx_ui_PageView_getIndicatorSelectedIndexColor : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_ui_PageView_getIndicatorIndexNodesScale(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::ui::PageView* cobj = (cocos2d::ui::PageView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_PageView_getIndicatorIndexNodesScale : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getIndicatorIndexNodesScale(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_PageView_getIndicatorIndexNodesScale : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ui_PageView_setIndicatorPosition(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12466,20 +12559,24 @@ bool js_cocos2dx_ui_PageView_scrollToItem(JSContext *cx, uint32_t argc, jsval *v JS_ReportError(cx, "js_cocos2dx_ui_PageView_scrollToItem : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_ui_PageView_removeAllPages(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_ui_PageView_setIndicatorIndexNodesColor(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::ui::PageView* cobj = (cocos2d::ui::PageView *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_PageView_removeAllPages : Invalid Native Object"); - if (argc == 0) { - cobj->removeAllPages(); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_PageView_setIndicatorIndexNodesColor : Invalid Native Object"); + if (argc == 1) { + cocos2d::Color3B arg0; + ok &= jsval_to_cccolor3b(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_PageView_setIndicatorIndexNodesColor : Error processing arguments"); + cobj->setIndicatorIndexNodesColor(arg0); args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_ui_PageView_removeAllPages : wrong number of arguments: %d, was expecting %d", argc, 0); + JS_ReportError(cx, "js_cocos2dx_ui_PageView_setIndicatorIndexNodesColor : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } bool js_cocos2dx_ui_PageView_getIndicatorPositionAsAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp) @@ -12546,6 +12643,36 @@ bool js_cocos2dx_ui_PageView_removePage(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_PageView_removePage : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture(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::ui::PageView* cobj = (cocos2d::ui::PageView *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture : 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_ui_PageView_setIndicatorIndexNodesTexture : Error processing arguments"); + cobj->setIndicatorIndexNodesTexture(arg0); + args.rval().setUndefined(); + return true; + } + if (argc == 2) { + std::string arg0; + cocos2d::ui::Widget::TextureResType arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture : Error processing arguments"); + cobj->setIndicatorIndexNodesTexture(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_ui_PageView_getIndicatorEnabled(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12697,21 +12824,26 @@ void js_register_cocos2dx_ui_PageView(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec funcs[] = { JS_FN("setIndicatorSpaceBetweenIndexNodes", js_cocos2dx_ui_PageView_setIndicatorSpaceBetweenIndexNodes, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("insertPage", js_cocos2dx_ui_PageView_insertPage, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("removeAllPages", js_cocos2dx_ui_PageView_removeAllPages, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setAutoScrollStopEpsilon", js_cocos2dx_ui_PageView_setAutoScrollStopEpsilon, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setIndicatorIndexNodesScale", js_cocos2dx_ui_PageView_setIndicatorIndexNodesScale, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setIndicatorEnabled", js_cocos2dx_ui_PageView_setIndicatorEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setIndicatorSelectedIndexColor", js_cocos2dx_ui_PageView_setIndicatorSelectedIndexColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("addEventListener", js_cocos2dx_ui_PageView_addEventListener, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getIndicatorPosition", js_cocos2dx_ui_PageView_getIndicatorPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setCurrentPageIndex", js_cocos2dx_ui_PageView_setCurrentPageIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getIndicatorIndexNodesColor", js_cocos2dx_ui_PageView_getIndicatorIndexNodesColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getIndicatorSelectedIndexColor", js_cocos2dx_ui_PageView_getIndicatorSelectedIndexColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getIndicatorIndexNodesScale", js_cocos2dx_ui_PageView_getIndicatorIndexNodesScale, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setIndicatorPosition", js_cocos2dx_ui_PageView_setIndicatorPosition, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("scrollToPage", js_cocos2dx_ui_PageView_scrollToPage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setIndicatorPositionAsAnchorPoint", js_cocos2dx_ui_PageView_setIndicatorPositionAsAnchorPoint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("scrollToItem", js_cocos2dx_ui_PageView_scrollToItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("removeAllPages", js_cocos2dx_ui_PageView_removeAllPages, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setIndicatorIndexNodesColor", js_cocos2dx_ui_PageView_setIndicatorIndexNodesColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getIndicatorPositionAsAnchorPoint", js_cocos2dx_ui_PageView_getIndicatorPositionAsAnchorPoint, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getCurrentPageIndex", js_cocos2dx_ui_PageView_getCurrentPageIndex, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removePage", js_cocos2dx_ui_PageView_removePage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setIndicatorIndexNodesTexture", js_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getIndicatorEnabled", js_cocos2dx_ui_PageView_getIndicatorEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("removePageAtIndex", js_cocos2dx_ui_PageView_removePageAtIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getIndicatorSpaceBetweenIndexNodes", js_cocos2dx_ui_PageView_getIndicatorSpaceBetweenIndexNodes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -13184,7 +13316,7 @@ bool js_cocos2dx_ui_RichElementText_init(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementText_init : Error processing arguments"); @@ -13209,7 +13341,7 @@ bool js_cocos2dx_ui_RichElementText_init(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13236,7 +13368,7 @@ bool js_cocos2dx_ui_RichElementText_init(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13265,7 +13397,7 @@ bool js_cocos2dx_ui_RichElementText_init(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13296,7 +13428,7 @@ bool js_cocos2dx_ui_RichElementText_init(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13329,7 +13461,7 @@ bool js_cocos2dx_ui_RichElementText_init(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13364,7 +13496,7 @@ bool js_cocos2dx_ui_RichElementText_init(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13400,7 +13532,7 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementText_create : Error processing arguments"); auto ret = cocos2d::ui::RichElementText::create(arg0, arg1, arg2, arg3, arg4, arg5); @@ -13422,7 +13554,7 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementText_create : Error processing arguments"); @@ -13446,7 +13578,7 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementText_create : Error processing arguments"); @@ -13472,7 +13604,7 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13500,7 +13632,7 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13530,7 +13662,7 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13562,7 +13694,7 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13596,7 +13728,7 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -13632,7 +13764,7 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); ok &= jsval_to_std_string(cx, args.get(4), &arg4); - ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); ok &= jsval_to_uint32(cx, args.get(6), &arg6); ok &= jsval_to_std_string(cx, args.get(7), &arg7); ok &= jsval_to_cccolor3b(cx, args.get(8), &arg8); @@ -14899,7 +15031,7 @@ bool js_cocos2dx_ui_RichText_setVerticalSpace(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_RichText_setVerticalSpace : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichText_setVerticalSpace : Error processing arguments"); cobj->setVerticalSpace(arg0); args.rval().setUndefined(); @@ -14977,7 +15109,7 @@ bool js_cocos2dx_ui_RichText_setFontSize(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_RichText_setFontSize : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichText_setFontSize : Error processing arguments"); cobj->setFontSize(arg0); args.rval().setUndefined(); @@ -16118,7 +16250,7 @@ bool js_cocos2dx_ui_Scale9Sprite_setInsetBottom(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Scale9Sprite_setInsetBottom : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Scale9Sprite_setInsetBottom : Error processing arguments"); cobj->setInsetBottom(arg0); args.rval().setUndefined(); @@ -16203,7 +16335,7 @@ bool js_cocos2dx_ui_Scale9Sprite_setInsetTop(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Scale9Sprite_setInsetTop : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Scale9Sprite_setInsetTop : Error processing arguments"); cobj->setInsetTop(arg0); args.rval().setUndefined(); @@ -16672,7 +16804,7 @@ bool js_cocos2dx_ui_Scale9Sprite_setInsetLeft(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Scale9Sprite_setInsetLeft : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Scale9Sprite_setInsetLeft : Error processing arguments"); cobj->setInsetLeft(arg0); args.rval().setUndefined(); @@ -16825,7 +16957,7 @@ bool js_cocos2dx_ui_Scale9Sprite_setInsetRight(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Scale9Sprite_setInsetRight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Scale9Sprite_setInsetRight : Error processing arguments"); cobj->setInsetRight(arg0); args.rval().setUndefined(); @@ -17899,7 +18031,7 @@ bool js_cocos2dx_ui_LayoutComponent_setPercentWidth(JSContext *cx, uint32_t argc JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setPercentWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setPercentWidth : Error processing arguments"); cobj->setPercentWidth(arg0); args.rval().setUndefined(); @@ -18125,7 +18257,7 @@ bool js_cocos2dx_ui_LayoutComponent_setSizeWidth(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setSizeWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setSizeWidth : Error processing arguments"); cobj->setSizeWidth(arg0); args.rval().setUndefined(); @@ -18219,7 +18351,7 @@ bool js_cocos2dx_ui_LayoutComponent_setLeftMargin(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setLeftMargin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setLeftMargin : Error processing arguments"); cobj->setLeftMargin(arg0); args.rval().setUndefined(); @@ -18331,7 +18463,7 @@ bool js_cocos2dx_ui_LayoutComponent_setTopMargin(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setTopMargin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setTopMargin : Error processing arguments"); cobj->setTopMargin(arg0); args.rval().setUndefined(); @@ -18387,7 +18519,7 @@ bool js_cocos2dx_ui_LayoutComponent_setPositionPercentY(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setPositionPercentY : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setPositionPercentY : Error processing arguments"); cobj->setPositionPercentY(arg0); args.rval().setUndefined(); @@ -18407,7 +18539,7 @@ bool js_cocos2dx_ui_LayoutComponent_setPositionPercentX(JSContext *cx, uint32_t JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setPositionPercentX : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setPositionPercentX : Error processing arguments"); cobj->setPositionPercentX(arg0); args.rval().setUndefined(); @@ -18427,7 +18559,7 @@ bool js_cocos2dx_ui_LayoutComponent_setRightMargin(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setRightMargin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setRightMargin : Error processing arguments"); cobj->setRightMargin(arg0); args.rval().setUndefined(); @@ -18465,7 +18597,7 @@ bool js_cocos2dx_ui_LayoutComponent_setPercentHeight(JSContext *cx, uint32_t arg JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setPercentHeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setPercentHeight : Error processing arguments"); cobj->setPercentHeight(arg0); args.rval().setUndefined(); @@ -18601,7 +18733,7 @@ bool js_cocos2dx_ui_LayoutComponent_setSizeHeight(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setSizeHeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setSizeHeight : Error processing arguments"); cobj->setSizeHeight(arg0); args.rval().setUndefined(); @@ -18769,7 +18901,7 @@ bool js_cocos2dx_ui_LayoutComponent_setBottomMargin(JSContext *cx, uint32_t argc JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_LayoutComponent_setBottomMargin : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_setBottomMargin : Error processing arguments"); cobj->setBottomMargin(arg0); args.rval().setUndefined(); @@ -19024,7 +19156,7 @@ bool js_cocos2dx_ui_TabHeader_setTitleFontSize(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_TabHeader_setTitleFontSize : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_TabHeader_setTitleFontSize : Error processing arguments"); cobj->setTitleFontSize(arg0); args.rval().setUndefined(); @@ -19377,7 +19509,7 @@ bool js_cocos2dx_ui_TabControl_setHeaderWidth(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_TabControl_setHeaderWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_TabControl_setHeaderWidth : Error processing arguments"); cobj->setHeaderWidth(arg0); args.rval().setUndefined(); @@ -19700,7 +19832,7 @@ bool js_cocos2dx_ui_TabControl_setHeaderSelectedZoom(JSContext *cx, uint32_t arg JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_TabControl_setHeaderSelectedZoom : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_TabControl_setHeaderSelectedZoom : Error processing arguments"); cobj->setHeaderSelectedZoom(arg0); args.rval().setUndefined(); @@ -19720,7 +19852,7 @@ bool js_cocos2dx_ui_TabControl_setHeaderHeight(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_TabControl_setHeaderHeight : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_TabControl_setHeaderHeight : Error processing arguments"); cobj->setHeaderHeight(arg0); args.rval().setUndefined(); @@ -19976,7 +20108,7 @@ bool js_cocos2dx_ui_ScrollViewBar_setAutoHideTime(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ScrollViewBar_setAutoHideTime : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollViewBar_setAutoHideTime : Error processing arguments"); cobj->setAutoHideTime(arg0); args.rval().setUndefined(); @@ -20070,7 +20202,7 @@ bool js_cocos2dx_ui_ScrollViewBar_setWidth(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_ScrollViewBar_setWidth : Invalid Native Object"); if (argc == 1) { double arg0 = 0; - ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); + ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollViewBar_setWidth : Error processing arguments"); cobj->setWidth(arg0); args.rval().setUndefined(); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp index da2f26d2ae2b..52ee698405ff 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp @@ -466,6 +466,7 @@ bool js_cocos2dx_ui_ListView_jumpToItem(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_ui_ListView_setMagneticType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_getIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_pushBackCustomItem(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_ListView_setCurSelectedIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_insertDefaultItem(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_setMagneticAllowedOutOfBoundary(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_addEventListener(JSContext *cx, uint32_t argc, jsval *vp); @@ -640,21 +641,26 @@ void js_register_cocos2dx_ui_PageView(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_ui_PageView_setIndicatorSpaceBetweenIndexNodes(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_insertPage(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_PageView_removeAllPages(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_setAutoScrollStopEpsilon(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_PageView_setIndicatorIndexNodesScale(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_setIndicatorEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_setIndicatorSelectedIndexColor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_addEventListener(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_getIndicatorPosition(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_setCurrentPageIndex(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_PageView_getIndicatorIndexNodesColor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_getIndicatorSelectedIndexColor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_PageView_getIndicatorIndexNodesScale(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_setIndicatorPosition(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_scrollToPage(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_setIndicatorPositionAsAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_scrollToItem(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_PageView_removeAllPages(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_PageView_setIndicatorIndexNodesColor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_getIndicatorPositionAsAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_getCurrentPageIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_removePage(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_getIndicatorEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_removePageAtIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_getIndicatorSpaceBetweenIndexNodes(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index d9b111c33289..88088ac20cd5 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -68,8 +68,6 @@ #define LOGD(...) js_log(__VA_ARGS__) #endif -#include "scripting/js-bindings/manual/js_bindings_config.h" - #if COCOS2D_DEBUG #define TRACE_DEBUGGER_SERVER(...) CCLOG(__VA_ARGS__) #else @@ -386,6 +384,16 @@ bool JSB_core_restartVM(JSContext *cx, uint32_t argc, jsval *vp) return true; }; +bool JSB_closeWindow(JSContext *cx, uint32_t argc, jsval *vp) +{ + ScriptingCore::getInstance()->cleanup(); + Director::getInstance()->end(); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + exit(0); +#endif + return true; +}; + void registerDefaultClasses(JSContext* cx, JS::HandleObject global) { // first, try to get the ns JS::RootedValue nsval(cx); @@ -419,7 +427,7 @@ void registerDefaultClasses(JSContext* cx, JS::HandleObject global) { // register some global functions JS_DefineFunction(cx, global, "require", ScriptingCore::executeScript, 1, JSPROP_PERMANENT); - JS_DefineFunction(cx, global, "log", ScriptingCore::log, 0, JSPROP_READONLY | JSPROP_PERMANENT); + JS_DefineFunction(cx, global, "log", ScriptingCore::log, 0, JSPROP_PERMANENT); JS_DefineFunction(cx, global, "executeScript", ScriptingCore::executeScript, 1, JSPROP_READONLY | JSPROP_PERMANENT); JS_DefineFunction(cx, global, "forceGC", ScriptingCore::forceGC, 0, JSPROP_READONLY | JSPROP_PERMANENT); @@ -429,6 +437,7 @@ void registerDefaultClasses(JSContext* cx, JS::HandleObject global) { JS_DefineFunction(cx, global, "__restartVM", JSB_core_restartVM, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE ); JS_DefineFunction(cx, global, "__cleanScript", JSB_cleanScript, 1, JSPROP_READONLY | JSPROP_PERMANENT); JS_DefineFunction(cx, global, "__isObjectValid", ScriptingCore::isObjectValid, 1, JSPROP_READONLY | JSPROP_PERMANENT); + JS_DefineFunction(cx, global, "close", JSB_closeWindow, 0, JSPROP_READONLY | JSPROP_PERMANENT); } static void sc_finalize(JSFreeOp *freeOp, JSObject *obj) { @@ -463,6 +472,7 @@ ScriptingCore::ScriptingCore() : _rt(nullptr) , _cx(nullptr) , _jsInited(false) +, _needCleanup(false) //, _global(nullptr) //, _debugGlobal(nullptr) , _callFromScript(false) @@ -627,6 +637,8 @@ void ScriptingCore::createGlobalContext() { sc_register_sth callback = *it; callback(_cx, _global.ref()); } + + _needCleanup = true; } static std::string RemoveFileExt(const std::string& filePath) { @@ -822,6 +834,9 @@ ScriptingCore::~ScriptingCore() void ScriptingCore::cleanup() { + if (!_needCleanup) { + return; + } localStorageFree(); removeAllRoots(_cx); garbageCollect(); @@ -851,6 +866,8 @@ void ScriptingCore::cleanup() _js_global_type_map.clear(); filename_script.clear(); registrationList.clear(); + + _needCleanup = false; } void ScriptingCore::reportError(JSContext *cx, const char *message, JSErrorReport *report) @@ -1313,12 +1330,10 @@ int ScriptingCore::handleComponentEvent(void* data) else if (action == kComponentOnEnter) { ret = executeFunctionWithOwner(nodeValue, "onEnter", 1, &dataVal, &retval); - resumeSchedulesAndActions(p); } else if (action == kComponentOnExit) { ret = executeFunctionWithOwner(nodeValue, "onExit", 1, &dataVal, &retval); - pauseSchedulesAndActions(p); } else if (action == kComponentOnUpdate) { @@ -1506,7 +1521,7 @@ bool ScriptingCore::executeFunctionWithOwner(jsval owner, const char *name, cons return bRet; } -bool ScriptingCore::handleKeybardEvent(void* nativeObj, cocos2d::EventKeyboard::KeyCode keyCode, bool isPressed, cocos2d::Event* event) +bool ScriptingCore::handleKeyboardEvent(void* nativeObj, cocos2d::EventKeyboard::KeyCode keyCode, bool isPressed, cocos2d::Event* event) { JSAutoCompartment ac(_cx, _global.ref()); @@ -1738,20 +1753,26 @@ void ScriptingCore::garbageCollect() void SimpleRunLoop::update(float dt) { - g_qMutex.lock(); - size_t size = g_queue.size(); - g_qMutex.unlock(); - - while (size > 0) + std::string message; + size_t messageCount = 0; + while (true) { g_qMutex.lock(); - auto first = g_queue.begin(); - std::string str = *first; - g_queue.erase(first); - size = g_queue.size(); + messageCount = g_queue.size(); + if (messageCount > 0) + { + auto first = g_queue.begin(); + message = *first; + g_queue.erase(first); + --messageCount; + } g_qMutex.unlock(); - - ScriptingCore::getInstance()->debugProcessInput(str); + + if (!message.empty()) + ScriptingCore::getInstance()->debugProcessInput(message); + + if (messageCount == 0) + break; } } @@ -1769,20 +1790,26 @@ void ScriptingCore::debugProcessInput(const std::string& str) static bool NS_ProcessNextEvent() { - g_qMutex.lock(); - size_t size = g_queue.size(); - g_qMutex.unlock(); - - while (size > 0) + std::string message; + size_t messageCount = 0; + while (true) { g_qMutex.lock(); - auto first = g_queue.begin(); - std::string str = *first; - g_queue.erase(first); - size = g_queue.size(); + messageCount = g_queue.size(); + if (messageCount > 0) + { + auto first = g_queue.begin(); + message = *first; + g_queue.erase(first); + --messageCount; + } g_qMutex.unlock(); - - ScriptingCore::getInstance()->debugProcessInput(str); + + if (!message.empty()) + ScriptingCore::getInstance()->debugProcessInput(message); + + if (messageCount == 0) + break; } // std::this_thread::yield(); std::this_thread::sleep_for(std::chrono::milliseconds(10)); @@ -1867,7 +1894,7 @@ static void serverEntryPoint(unsigned int port) struct addrinfo hints, *result = nullptr, *rp = nullptr; int s = 0; memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = AF_INET; // IPv4 + hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; // TCP stream sockets hints.ai_flags = AI_PASSIVE; // fill in my IP for me @@ -1919,6 +1946,12 @@ static void serverEntryPoint(unsigned int port) listen(s, 1); + +#define MAX_RECEIVED_SIZE 1024 +#define BUF_SIZE MAX_RECEIVED_SIZE + 1 + + char buf[BUF_SIZE] = {0}; + int readBytes = 0; while (true) { clientSocket = accept(s, NULL, NULL); @@ -1935,10 +1968,8 @@ static void serverEntryPoint(unsigned int port) inData = "connected"; // process any input, send any output clearBuffers(); - - char buf[1024] = {0}; - int readBytes = 0; - while ((readBytes = (int)::recv(clientSocket, buf, sizeof(buf), 0)) > 0) + + while ((readBytes = (int)::recv(clientSocket, buf, MAX_RECEIVED_SIZE, 0)) > 0) { buf[readBytes] = '\0'; // TRACE_DEBUGGER_SERVER("debug server : received command >%s", buf); @@ -1952,6 +1983,9 @@ static void serverEntryPoint(unsigned int port) cc_closesocket(clientSocket); } } // while(true) + +#undef BUF_SIZE +#undef MAX_RECEIVED_SIZE } bool JSBDebug_BufferWrite(JSContext* cx, unsigned argc, jsval* vp) diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.h b/cocos/scripting/js-bindings/manual/ScriptingCore.h index aec568aa8a3f..4574c74a274c 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.h +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.h @@ -85,6 +85,7 @@ class CC_JS_DLL ScriptingCore : public cocos2d::ScriptEngineProtocol mozilla::Maybe _debugGlobal; SimpleRunLoop* _runLoop; bool _jsInited; + bool _needCleanup; bool _callFromScript; ScriptingCore(); @@ -547,7 +548,7 @@ class CC_JS_DLL ScriptingCore : public cocos2d::ScriptEngineProtocol bool handleMouseEvent(void* nativeObj, cocos2d::EventMouse::MouseEventType eventType, cocos2d::Event* event); bool handleMouseEvent(void* nativeObj, cocos2d::EventMouse::MouseEventType eventType, cocos2d::Event* event, JS::MutableHandleValue jsvalRet); - bool handleKeybardEvent(void* nativeObj, cocos2d::EventKeyboard::KeyCode keyCode, bool isPressed, cocos2d::Event* event); + bool handleKeyboardEvent(void* nativeObj, cocos2d::EventKeyboard::KeyCode keyCode, bool isPressed, cocos2d::Event* event); bool handleFocusEvent(void* nativeObj, cocos2d::ui::Widget* widgetLoseFocus, cocos2d::ui::Widget* widgetGetFocus); void restartVM(); diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 298b8e0a4069..121a8dab2bc6 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -1263,11 +1263,16 @@ void JSScheduleWrapper::scheduleFunc(float dt) JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET JS::RootedValue callback(cx, getJSCallbackFunc()); - if(!callback.isNullOrUndefined()) { - JS::HandleValueArray args = JS::HandleValueArray::fromMarkedLocation(1, &data); - JS::RootedValue retval(cx); - JS::RootedObject callbackTarget(cx, getJSCallbackThis().toObjectOrNull()); - JS_CallFunctionValue(cx, callbackTarget, callback, args, &retval); + if(!callback.isNullOrUndefined()) + { + auto exist = JSScheduleWrapper::getTargetForSchedule(callback); + if (exist) + { + JS::HandleValueArray args = JS::HandleValueArray::fromMarkedLocation(1, &data); + JS::RootedValue retval(cx); + JS::RootedObject target(cx, getJSCallbackThis().toObjectOrNull()); + JS_CallFunctionValue(cx, target, callback, args, &retval); + } } } @@ -2738,7 +2743,7 @@ bool js_cocos2dx_ActionInterval_easing(JSContext *cx, uint32_t argc, jsval *vp) double tag; double parameter; - for (int i = 0; i < argc; i++) + for (uint32_t i = 0; i < argc; i++) { // jsval vpi = argv[i]; JS::RootedValue vpi(cx, args.get(i)); @@ -5712,7 +5717,7 @@ bool js_cocos2dx_AutoPolygon_generatePolygon(JSContext *cx, uint32_t argc, jsval double arg2; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_ccrect(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); + ok &= JS::ToNumber( cx, args.get(2), &arg2) && !std::isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AutoPolygon_generatePolygon : Error processing arguments"); cocos2d::PolygonInfo* ret = new (std::nothrow) cocos2d::PolygonInfo(cocos2d::AutoPolygon::generatePolygon(arg0, arg1, arg2)); jsval jsret = JSVAL_NULL; @@ -5729,8 +5734,8 @@ bool js_cocos2dx_AutoPolygon_generatePolygon(JSContext *cx, uint32_t argc, jsval double arg3; ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_ccrect(cx, args.get(1), &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(2), &arg2) && !std::isnan(arg2); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AutoPolygon_generatePolygon : Error processing arguments"); cocos2d::PolygonInfo* ret = new (std::nothrow) cocos2d::PolygonInfo(cocos2d::AutoPolygon::generatePolygon(arg0, arg1, arg2, arg3)); jsval jsret = JSVAL_NULL; diff --git a/cocos/scripting/js-bindings/manual/cocostudio/jsb_cocos2dx_studio_conversions.cpp b/cocos/scripting/js-bindings/manual/cocostudio/jsb_cocos2dx_studio_conversions.cpp index 409b9b102f29..e0d9f5f1ccbe 100644 --- a/cocos/scripting/js-bindings/manual/cocostudio/jsb_cocos2dx_studio_conversions.cpp +++ b/cocos/scripting/js-bindings/manual/cocostudio/jsb_cocos2dx_studio_conversions.cpp @@ -56,7 +56,7 @@ bool jsval_to_animationInfo(JSContext* cx, JS::HandleValue vp, cocostudio::timel JS::ToNumber(cx, jsStartId, &startIndex) && JS::ToNumber(cx, jsEndId, &endIndex) && jsval_to_std_string(cx, jsName, &name) && - !isnan(startIndex) && !isnan(endIndex); + !std::isnan(startIndex) && !std::isnan(endIndex); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); 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 8ce870784fb3..572bfe310bc6 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 @@ -251,7 +251,12 @@ static bool js_cocos2dx_studio_ActionManagerEx_initWithDictionaryEx(JSContext *c js_proxy_t *proxy = jsb_get_js_proxy(obj); cocostudio::ActionManagerEx* cobj = (cocostudio::ActionManagerEx *)(proxy ? proxy->ptr : NULL); JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_studio_ActionManagerEx_initWithDictionaryEx : Invalid Native Object"); - if (argc == 3) { + + int version = 0; + if (argc == 4) { + ok &= jsval_to_int(cx, args.get(3), &version); + } + if (argc >= 3) { const char* arg0; const char* arg1; cocos2d::Ref* arg2; @@ -271,7 +276,7 @@ static bool js_cocos2dx_studio_ActionManagerEx_initWithDictionaryEx(JSContext *c JSB_PRECONDITION2( arg2, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionManagerEx_initWithDictionaryEx : Error processing arguments"); - cobj->initWithDictionary(arg0, arg1Jsondoc, arg2); + cobj->initWithDictionary(arg0, arg1Jsondoc, arg2, version); args.rval().setUndefined(); return true; } diff --git a/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp b/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp index e78200c40352..14e2247ca133 100644 --- a/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp +++ b/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp @@ -482,7 +482,7 @@ bool jsval_to_ushort( JSContext *cx, JS::HandleValue vp, unsigned short *outval double dp; ok &= JS::ToNumber(cx, vp, &dp); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); - ok &= !isnan(dp); + ok &= !std::isnan(dp); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); *outval = (unsigned short)dp; @@ -496,7 +496,7 @@ bool jsval_to_int32( JSContext *cx, JS::HandleValue vp, int32_t *outval ) double dp; ok &= JS::ToNumber(cx, vp, &dp); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); - ok &= !isnan(dp); + ok &= !std::isnan(dp); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); *outval = (int32_t)dp; @@ -510,7 +510,7 @@ bool jsval_to_uint32( JSContext *cx, JS::HandleValue vp, uint32_t *outval ) double dp; ok &= JS::ToNumber(cx, vp, &dp); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); - ok &= !isnan(dp); + ok &= !std::isnan(dp); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); *outval = (uint32_t)dp; @@ -524,7 +524,7 @@ bool jsval_to_uint16( JSContext *cx, JS::HandleValue vp, uint16_t *outval ) double dp; ok &= JS::ToNumber(cx, vp, &dp); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); - ok &= !isnan(dp); + ok &= !std::isnan(dp); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); *outval = (uint16_t)dp; @@ -675,7 +675,8 @@ bool jsval_to_quaternion( JSContext *cx, JS::HandleValue v, cocos2d::Quaternion* JS::ToNumber(cx, y, &yy) && JS::ToNumber(cx, z, &zz) && JS::ToNumber(cx, w, &ww) && - !isnan(xx) && !isnan(yy) && !isnan(zz) && !isnan(ww); + !std::isnan(xx) && !std::isnan(yy) && !std::isnan(zz) && !std:: +isnan(ww); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); @@ -1538,7 +1539,7 @@ bool jsval_to_vector2(JSContext *cx, JS::HandleValue vp, cocos2d::Vec2* ret) JS_GetProperty(cx, tmp, "y", &jsy) && JS::ToNumber(cx, jsx, &x) && JS::ToNumber(cx, jsy, &y) && - !isnan(x) && !isnan(y); + !std::isnan(x) && !std::isnan(y); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); @@ -1562,7 +1563,7 @@ bool jsval_to_vector3(JSContext *cx, JS::HandleValue vp, cocos2d::Vec3* ret) JS::ToNumber(cx, jsx, &x) && JS::ToNumber(cx, jsy, &y) && JS::ToNumber(cx, jsz, &z) && - !isnan(x) && !isnan(y) && !isnan(z); + !std::isnan(x) && !std::isnan(y) && !std::isnan(z); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); @@ -1590,7 +1591,7 @@ bool jsval_to_vector4(JSContext *cx, JS::HandleValue vp, cocos2d::Vec4* ret) JS::ToNumber(cx, jsy, &y) && JS::ToNumber(cx, jsz, &z) && JS::ToNumber(cx, jsw, &w) && - !isnan(x) && !isnan(y) && !isnan(z) && !isnan(w); + !std::isnan(x) && !std::isnan(y) && !std::isnan(z) && !std::isnan(w); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); @@ -1657,7 +1658,7 @@ bool jsval_to_cctex2f(JSContext* cx, JS::HandleValue vp, cocos2d::Tex2F* ret) JS_GetProperty(cx, tmp, "y", &jsy) && JS::ToNumber(cx, jsx, &x) && JS::ToNumber(cx, jsy, &y) && - !isnan(x) && !isnan(y); + !std::isnan(x) && !std::isnan(y); JSB_PRECONDITION3(ok, cx, false, "Error processing arguments"); diff --git a/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp b/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp index 900ee3e20520..948b2db45fa9 100644 --- a/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp +++ b/cocos/scripting/js-bindings/manual/jsb_event_dispatcher_manual.cpp @@ -138,11 +138,11 @@ bool js_EventListenerKeyboard_create(JSContext *cx, uint32_t argc, jsval *vp) auto ret = EventListenerKeyboard::create(); ret->onKeyPressed = [ret](EventKeyboard::KeyCode keyCode, Event* event) { - ScriptingCore::getInstance()->handleKeybardEvent(ret, keyCode, true, event); + ScriptingCore::getInstance()->handleKeyboardEvent(ret, keyCode, true, event); }; ret->onKeyReleased = [ret](EventKeyboard::KeyCode keyCode, Event* event) { - ScriptingCore::getInstance()->handleKeybardEvent(ret, keyCode, false, event); + ScriptingCore::getInstance()->handleKeyboardEvent(ret, keyCode, false, event); }; jsval jsret = OBJECT_TO_JSVAL(js_get_or_create_jsobject(cx, ret)); 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 index 4c2711e5d57a..73dabb9b522f 100644 --- a/cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp +++ b/cocos/scripting/js-bindings/manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp @@ -321,9 +321,9 @@ bool js_cocos2dx_physics3d_Physics3dShape_initHeightfield(JSContext *cx, uint32_ 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); + ok &= JS::ToNumber(cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber(cx, args.get(4), &arg4) && !std::isnan(arg4); + ok &= JS::ToNumber(cx, args.get(5), &arg5) && !std::isnan(arg5); arg6 = JS::ToBoolean(args.get(6)); arg7 = JS::ToBoolean(args.get(7)); if (argc == 9) @@ -363,9 +363,9 @@ bool js_cocos2dx_physics3d_Physics3dShape_createHeightfield(JSContext *cx, uint3 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); + ok &= JS::ToNumber( cx, args.get(3), &arg3) && !std::isnan(arg3); + ok &= JS::ToNumber( cx, args.get(4), &arg4) && !std::isnan(arg4); + ok &= JS::ToNumber( cx, args.get(5), &arg5) && !std::isnan(arg5); arg6 = JS::ToBoolean(args.get(6)); arg7 = JS::ToBoolean(args.get(7)); if(argc == 9) diff --git a/cocos/scripting/js-bindings/manual/platform/android/CCJavascriptJavaBridge.cpp b/cocos/scripting/js-bindings/manual/platform/android/CCJavascriptJavaBridge.cpp index 964473b35f55..a38f4c8d4b54 100644 --- a/cocos/scripting/js-bindings/manual/platform/android/CCJavascriptJavaBridge.cpp +++ b/cocos/scripting/js-bindings/manual/platform/android/CCJavascriptJavaBridge.cpp @@ -83,11 +83,18 @@ bool JavascriptJavaBridge::CallInfo::execute(void) break; case TypeString: + { m_retjstring = (jstring)m_env->CallStaticObjectMethod(m_classID, m_methodID); std::string strValue = cocos2d::StringUtils::getStringUTFCharsJNI(m_env, m_retjstring); m_ret.stringValue = new string(strValue); break; + } + + default: + m_error = JSJ_ERR_TYPE_NOT_SUPPORT; + LOGD("Return type '%d' is not supported", static_cast(m_returnType)); + return false; } if (m_env->ExceptionCheck() == JNI_TRUE) @@ -123,10 +130,17 @@ bool JavascriptJavaBridge::CallInfo::executeWithArgs(jvalue *args) break; case TypeString: + { m_retjstring = (jstring)m_env->CallStaticObjectMethodA(m_classID, m_methodID, args); std::string strValue = cocos2d::StringUtils::getStringUTFCharsJNI(m_env, m_retjstring); m_ret.stringValue = new string(strValue); break; + } + + default: + m_error = JSJ_ERR_TYPE_NOT_SUPPORT; + LOGD("Return type '%d' is not supported", static_cast(m_returnType)); + return false; } if (m_env->ExceptionCheck() == JNI_TRUE) @@ -279,6 +293,8 @@ JS::Value JavascriptJavaBridge::convertReturnValue(JSContext *cx, ReturnValue re return BOOLEAN_TO_JSVAL(retValue.boolValue); case TypeString: return c_string_to_jsval(cx, retValue.stringValue->c_str(),retValue.stringValue->size()); + default: + break; } return ret; diff --git a/cocos/scripting/js-bindings/script/jsb_boot.js b/cocos/scripting/js-bindings/script/jsb_boot.js index f1299ef9aba9..2895ef81bcad 100644 --- a/cocos/scripting/js-bindings/script/jsb_boot.js +++ b/cocos/scripting/js-bindings/script/jsb_boot.js @@ -810,6 +810,7 @@ cc.view.getVisibleOriginInPixel = cc.view.getVisibleOrigin; cc.view.setContentTranslateLeftTop = function(){return;}; cc.view.getContentTranslateLeftTop = function(){return null;}; cc.view.setFrameZoomFactor = function(){return;}; +cc.view.setOrientation = function () {}; cc.DENSITYDPI_DEVICE = "device-dpi"; cc.DENSITYDPI_HIGH = "high-dpi"; cc.DENSITYDPI_MEDIUM = "medium-dpi"; @@ -1662,6 +1663,13 @@ cc.game = /** @lends cc.game# */{ __restartVM(); }, + /** + * End game, it will close the game window + */ + end: function () { + close(); + }, + // @Game loading /** * Prepare game. diff --git a/cocos/scripting/js-bindings/script/jsb_cocos2d.js b/cocos/scripting/js-bindings/script/jsb_cocos2d.js index 691c9170642a..114280b02395 100644 --- a/cocos/scripting/js-bindings/script/jsb_cocos2d.js +++ b/cocos/scripting/js-bindings/script/jsb_cocos2d.js @@ -2626,6 +2626,26 @@ _p.setDisabledSpriteFrame = function(frame) { cc.MenuItemToggle.prototype.selectedItem = cc.MenuItemToggle.prototype.getSelectedItem; +// playMusic searchPaths +if (cc.sys.os === cc.sys.OS_ANDROID && cc.audioEngine) { + cc.audioEngine._playMusic = cc.audioEngine.playMusic; + cc.audioEngine.playMusic = function () { + var args = arguments; + var searchPaths = jsb.fileUtils.getSearchPaths(); + var path = args[0]; + searchPaths.some(function (item) { + var temp = item + '/' + path; + var exists = jsb.fileUtils.isFileExist(temp); + if (exists) { + path = temp; + return true; + } + }); + args[0] = path; + cc.audioEngine._playMusic.apply(cc.audioEngine, args); + }; +} + // // LabelTTF API wrappers // diff --git a/cocos/scripting/js-bindings/script/jsb_prepare.js b/cocos/scripting/js-bindings/script/jsb_prepare.js index e4948d57851c..bf020fa79c80 100644 --- a/cocos/scripting/js-bindings/script/jsb_prepare.js +++ b/cocos/scripting/js-bindings/script/jsb_prepare.js @@ -129,8 +129,7 @@ cc.isUndefined = function(obj) { * @returns {boolean} */ cc.isObject = function(obj) { - return obj.__nativeObj !== undefined || - ( typeof obj === "object" && Object.prototype.toString.call(obj) === '[object Object]' ); + return ( obj !== null && typeof obj === "object" ); }; /** diff --git a/cocos/scripting/js-bindings/script/studio/jsb_studio_boot.js b/cocos/scripting/js-bindings/script/studio/jsb_studio_boot.js index e64312fc7efd..88f4b6aa415b 100644 --- a/cocos/scripting/js-bindings/script/studio/jsb_studio_boot.js +++ b/cocos/scripting/js-bindings/script/studio/jsb_studio_boot.js @@ -40,8 +40,8 @@ ccs.actionManager = ccs.ActionManager.getInstance(); ccs.ActionManager.prototype.clear = function() { this.releaseActions(); }; -ccs.ActionManager.prototype.initWithDictionary = function(file, dic, node) { - ccs.actionManager.initWithDictionaryEx(file, JSON.stringify(dic), node); +ccs.ActionManager.prototype.initWithDictionary = function(file, dic, node, version) { + ccs.actionManager.initWithDictionaryEx(file, JSON.stringify(dic), node, version); } /** @@ -70,4 +70,4 @@ ccs.Component.extend = ccs.Component.extend || cc.Component.extend; ccs.SkinNode = cc.Node; ccs.BoneNode.extend = cc.Class.extend; -ccs.SkeletonNode.extend = cc.Class.extend; \ No newline at end of file +ccs.SkeletonNode.extend = cc.Class.extend; diff --git a/cocos/scripting/js-bindings/script/studio/parsers/uiParser-1.x.js b/cocos/scripting/js-bindings/script/studio/parsers/uiParser-1.x.js index 4f88976592d1..c11d51c67c1e 100644 --- a/cocos/scripting/js-bindings/script/studio/parsers/uiParser-1.x.js +++ b/cocos/scripting/js-bindings/script/studio/parsers/uiParser-1.x.js @@ -39,7 +39,9 @@ deferred: function(json, resourcePath, node, file){ if(node){ - ccs.actionManager.initWithDictionary(file, json["animation"], node); + var version = json["Version"] || json["version"]; + var versionNum = ccs.uiReader.getVersionInteger(version); + ccs.actionManager.initWithDictionary(file, json["animation"], node, versionNum); node.setContentSize(cc.size(json["designWidth"], json["designHeight"])); } } @@ -702,4 +704,4 @@ load.registerParser("ccui", "*", parser); -})(ccs._load, ccs._parser); \ No newline at end of file +})(ccs._load, ccs._parser); diff --git a/cocos/scripting/lua-bindings/auto/api/ActionManagerEx.lua b/cocos/scripting/lua-bindings/auto/api/ActionManagerEx.lua index 057ed7919a3d..a2327fd1e292 100644 --- a/cocos/scripting/lua-bindings/auto/api/ActionManagerEx.lua +++ b/cocos/scripting/lua-bindings/auto/api/ActionManagerEx.lua @@ -26,6 +26,12 @@ -- @param #char actionName -- @return ActionObject#ActionObject ret (return value: ccs.ActionObject) +-------------------------------- +-- +-- @function [parent=#ActionManagerEx] getStudioVersionNumber +-- @param self +-- @return int#int ret (return value: int) + -------------------------------- -- @overload self, char, char, cc.CallFunc -- @overload self, char, char diff --git a/cocos/scripting/lua-bindings/auto/api/Image.lua b/cocos/scripting/lua-bindings/auto/api/Image.lua index a8763727c2ed..5c229bfaac1d 100644 --- a/cocos/scripting/lua-bindings/auto/api/Image.lua +++ b/cocos/scripting/lua-bindings/auto/api/Image.lua @@ -93,6 +93,14 @@ -- @param #bool haveAlphaPremultiplied -- @return Image#Image self (return value: cc.Image) +-------------------------------- +-- Enables or disables premultiplied alpha for PNG files.
+-- param enabled (default: true) +-- @function [parent=#Image] setPNGPremultipliedAlphaEnabled +-- @param self +-- @param #bool enabled +-- @return Image#Image self (return value: cc.Image) + -------------------------------- -- js ctor -- @function [parent=#Image] Image diff --git a/cocos/scripting/lua-bindings/auto/api/ListView.lua b/cocos/scripting/lua-bindings/auto/api/ListView.lua index e0e16fd0136b..e462384539cf 100644 --- a/cocos/scripting/lua-bindings/auto/api/ListView.lua +++ b/cocos/scripting/lua-bindings/auto/api/ListView.lua @@ -76,6 +76,15 @@ -- @param #ccui.Widget item -- @return ListView#ListView self (return value: ccui.ListView) +-------------------------------- +-- + * @brief Set current selected widget's index and call TouchEventType::ENDED event.
+-- + * @param A index of a selected item.
+-- + +-- @function [parent=#ListView] setCurSelectedIndex +-- @param self +-- @param #int itemIndex +-- @return ListView#ListView self (return value: ccui.ListView) + -------------------------------- -- Insert a default item(create by cloning model) into listview at a give index.
-- param index An index in ssize_t. diff --git a/cocos/scripting/lua-bindings/auto/api/PageView.lua b/cocos/scripting/lua-bindings/auto/api/PageView.lua index 42c5c967a1cf..c8d08df80eeb 100644 --- a/cocos/scripting/lua-bindings/auto/api/PageView.lua +++ b/cocos/scripting/lua-bindings/auto/api/PageView.lua @@ -22,6 +22,12 @@ -- @param #int idx -- @return PageView#PageView self (return value: ccui.PageView) +-------------------------------- +-- brief Remove all pages of the PageView. +-- @function [parent=#PageView] removeAllPages +-- @param self +-- @return PageView#PageView self (return value: ccui.PageView) + -------------------------------- -- -- @function [parent=#PageView] setAutoScrollStopEpsilon @@ -29,6 +35,14 @@ -- @param #float epsilon -- @return PageView#PageView self (return value: ccui.PageView) +-------------------------------- +-- brief Set scale of page indicator's index nodes.
+-- param indexNodesScale Scale of index nodes. +-- @function [parent=#PageView] setIndicatorIndexNodesScale +-- @param self +-- @param #float indexNodesScale +-- @return PageView#PageView self (return value: ccui.PageView) + -------------------------------- -- brief Toggle page indicator enabled.
-- param enabled True if enable page indicator, false otherwise. @@ -39,7 +53,7 @@ -------------------------------- -- brief Set color of page indicator's selected index.
--- param spaceBetweenIndexNodes Space between nodes in pixel. +-- param color Space between nodes in pixel. -- @function [parent=#PageView] setIndicatorSelectedIndexColor -- @param self -- @param #color3b_table color @@ -69,6 +83,13 @@ -- @param #long index -- @return PageView#PageView self (return value: ccui.PageView) +-------------------------------- +-- brief Get the color of page indicator's index nodes.
+-- return color +-- @function [parent=#PageView] getIndicatorIndexNodesColor +-- @param self +-- @return color3b_table#color3b_table ret (return value: color3b_table) + -------------------------------- -- brief Get the color of page indicator's selected index.
-- return color @@ -76,6 +97,13 @@ -- @param self -- @return color3b_table#color3b_table ret (return value: color3b_table) +-------------------------------- +-- brief Get scale of page indicator's index nodes.
+-- return indexNodesScale +-- @function [parent=#PageView] getIndicatorIndexNodesScale +-- @param self +-- @return float#float ret (return value: float) + -------------------------------- -- brief Set the page indicator's position in page view.
-- param position The position in page view @@ -109,9 +137,11 @@ -- @return PageView#PageView self (return value: ccui.PageView) -------------------------------- --- brief Remove all pages of the PageView. --- @function [parent=#PageView] removeAllPages +-- brief Set color of page indicator's index nodes.
+-- param color Space between nodes in pixel. +-- @function [parent=#PageView] setIndicatorIndexNodesColor -- @param self +-- @param #color3b_table color -- @return PageView#PageView self (return value: ccui.PageView) -------------------------------- @@ -136,6 +166,16 @@ -- @param #ccui.Widget page -- @return PageView#PageView self (return value: ccui.PageView) +-------------------------------- +-- sets texture for index nodes.
+-- param fileName File name of texture.
+-- param resType @see TextureResType . +-- @function [parent=#PageView] setIndicatorIndexNodesTexture +-- @param self +-- @param #string texName +-- @param #int texType +-- @return PageView#PageView self (return value: ccui.PageView) + -------------------------------- -- brief Query page indicator state.
-- return True if page indicator is enabled, false otherwise. diff --git a/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua b/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua index 4187063f3dda..b229a0e7e6d3 100644 --- a/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua +++ b/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua @@ -120,9 +120,14 @@ -------------------------------- -- --- @function [parent=#VideoPlayer] setVisible +-- @function [parent=#VideoPlayer] onEnter +-- @param self +-- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) + +-------------------------------- +-- +-- @function [parent=#VideoPlayer] onExit -- @param self --- @param #bool visible -- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) -------------------------------- @@ -131,6 +136,13 @@ -- @param self -- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) +-------------------------------- +-- +-- @function [parent=#VideoPlayer] setVisible +-- @param self +-- @param #bool visible +-- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer self (return value: cc.experimental::ui::VideoPlayer) + -------------------------------- -- -- @function [parent=#VideoPlayer] VideoPlayer diff --git a/cocos/scripting/lua-bindings/auto/api/WebView.lua b/cocos/scripting/lua-bindings/auto/api/WebView.lua index cb2aea1a8b1b..7d41fdeb7e39 100644 --- a/cocos/scripting/lua-bindings/auto/api/WebView.lua +++ b/cocos/scripting/lua-bindings/auto/api/WebView.lua @@ -56,6 +56,13 @@ -- @param #string url -- @return experimental::ui::WebView#experimental::ui::WebView self (return value: cc.experimental::ui::WebView) +-------------------------------- +-- Set whether the webview bounces at end of scroll of WebView. +-- @function [parent=#WebView] setBounces +-- @param self +-- @param #bool bounce +-- @return experimental::ui::WebView#experimental::ui::WebView self (return value: cc.experimental::ui::WebView) + -------------------------------- -- Evaluates JavaScript in the context of the currently displayed page. -- @function [parent=#WebView] evaluateJS @@ -102,6 +109,12 @@ -- @param self -- @return experimental::ui::WebView#experimental::ui::WebView ret (return value: cc.experimental::ui::WebView) +-------------------------------- +-- +-- @function [parent=#WebView] onEnter +-- @param self +-- @return experimental::ui::WebView#experimental::ui::WebView self (return value: cc.experimental::ui::WebView) + -------------------------------- -- Toggle visibility of WebView. -- @function [parent=#WebView] setVisible @@ -109,6 +122,12 @@ -- @param #bool visible -- @return experimental::ui::WebView#experimental::ui::WebView self (return value: cc.experimental::ui::WebView) +-------------------------------- +-- +-- @function [parent=#WebView] onExit +-- @param self +-- @return experimental::ui::WebView#experimental::ui::WebView self (return value: cc.experimental::ui::WebView) + -------------------------------- -- Default constructor. -- @function [parent=#WebView] WebView 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 6385de7dbc60..51de59350b66 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.hpp" -#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_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN #include "audio/include/AudioEngine.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.hpp index 01e014651068..58f93112b115 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.hpp @@ -1,5 +1,5 @@ #include "base/ccConfig.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_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN #ifndef __cocos2dx_audioengine_h__ #define __cocos2dx_audioengine_h__ @@ -41,4 +41,4 @@ int register_all_cocos2dx_audioengine(lua_State* tolua_S); #endif // __cocos2dx_audioengine_h__ -#endif //#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 +#endif //#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 || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 80ef6562e286..813e8fb2dc51 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -19135,6 +19135,42 @@ int lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(lua_State* tolua_S) #endif return 0; } +int lua_cocos2dx_Image_setPNGPremultipliedAlphaEnabled(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Image:setPNGPremultipliedAlphaEnabled"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_setPNGPremultipliedAlphaEnabled'", nullptr); + return 0; + } + cocos2d::Image::setPNGPremultipliedAlphaEnabled(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Image:setPNGPremultipliedAlphaEnabled",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_setPNGPremultipliedAlphaEnabled'.",&tolua_err); +#endif + return 0; +} int lua_cocos2dx_Image_constructor(lua_State* tolua_S) { int argc = 0; @@ -19198,6 +19234,7 @@ int lua_register_cocos2dx_Image(lua_State* tolua_S) tolua_function(tolua_S,"getNumberOfMipmaps",lua_cocos2dx_Image_getNumberOfMipmaps); tolua_function(tolua_S,"getRenderFormat",lua_cocos2dx_Image_getRenderFormat); tolua_function(tolua_S,"setPVRImagesHavePremultipliedAlpha", lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha); + tolua_function(tolua_S,"setPNGPremultipliedAlphaEnabled", lua_cocos2dx_Image_setPNGPremultipliedAlphaEnabled); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::Image).name(); g_luaType[typeName] = "cc.Image"; diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 3fecb2e27ce9..65e753fd5b09 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -2195,6 +2195,7 @@ int register_all_cocos2dx(lua_State* tolua_S); + #endif // __cocos2dx_h__ diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_webview_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_webview_auto.cpp index 082bc68fa163..86a9cea4ffac 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_webview_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_webview_auto.cpp @@ -362,6 +362,56 @@ int lua_cocos2dx_experimental_webview_WebView_loadURL(lua_State* tolua_S) return 0; } +int lua_cocos2dx_experimental_webview_WebView_setBounces(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::WebView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.WebView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::WebView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_webview_WebView_setBounces'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccexp.WebView:setBounces"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_webview_WebView_setBounces'", nullptr); + return 0; + } + cobj->setBounces(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.WebView:setBounces",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_webview_WebView_setBounces'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_experimental_webview_WebView_evaluateJS(lua_State* tolua_S) { int argc = 0; @@ -741,6 +791,7 @@ int lua_register_cocos2dx_experimental_webview_WebView(lua_State* tolua_S) tolua_function(tolua_S,"setScalesPageToFit",lua_cocos2dx_experimental_webview_WebView_setScalesPageToFit); tolua_function(tolua_S,"loadFile",lua_cocos2dx_experimental_webview_WebView_loadFile); tolua_function(tolua_S,"loadURL",lua_cocos2dx_experimental_webview_WebView_loadURL); + tolua_function(tolua_S,"setBounces",lua_cocos2dx_experimental_webview_WebView_setBounces); tolua_function(tolua_S,"evaluateJS",lua_cocos2dx_experimental_webview_WebView_evaluateJS); tolua_function(tolua_S,"getOnJSCallback",lua_cocos2dx_experimental_webview_WebView_getOnJSCallback); tolua_function(tolua_S,"canGoForward",lua_cocos2dx_experimental_webview_WebView_canGoForward); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_webview_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_webview_auto.hpp index bc69bdec7cc5..4c48ba6da9db 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_webview_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_webview_auto.hpp @@ -29,5 +29,6 @@ int register_all_cocos2dx_experimental_webview(lua_State* tolua_S); + #endif // __cocos2dx_experimental_webview_h__ #endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) 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 10db37ce7599..568342f825fb 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp @@ -2719,6 +2719,53 @@ int lua_cocos2dx_studio_ActionManagerEx_getActionByName(lua_State* tolua_S) return 0; } +int lua_cocos2dx_studio_ActionManagerEx_getStudioVersionNumber(lua_State* tolua_S) +{ + int argc = 0; + cocostudio::ActionManagerEx* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccs.ActionManagerEx",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocostudio::ActionManagerEx*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionManagerEx_getStudioVersionNumber'", 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_studio_ActionManagerEx_getStudioVersionNumber'", nullptr); + return 0; + } + int ret = cobj->getStudioVersionNumber(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionManagerEx:getStudioVersionNumber",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionManagerEx_getStudioVersionNumber'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_studio_ActionManagerEx_playActionByName(lua_State* tolua_S) { int argc = 0; @@ -2915,6 +2962,7 @@ int lua_register_cocos2dx_studio_ActionManagerEx(lua_State* tolua_S) tolua_beginmodule(tolua_S,"ActionManagerEx"); tolua_function(tolua_S,"stopActionByName",lua_cocos2dx_studio_ActionManagerEx_stopActionByName); tolua_function(tolua_S,"getActionByName",lua_cocos2dx_studio_ActionManagerEx_getActionByName); + tolua_function(tolua_S,"getStudioVersionNumber",lua_cocos2dx_studio_ActionManagerEx_getStudioVersionNumber); tolua_function(tolua_S,"playActionByName",lua_cocos2dx_studio_ActionManagerEx_playActionByName); tolua_function(tolua_S,"releaseActions",lua_cocos2dx_studio_ActionManagerEx_releaseActions); tolua_function(tolua_S,"destroyInstance", lua_cocos2dx_studio_ActionManagerEx_destroyInstance); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.hpp index f21c604148e8..5375818e60a4 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.hpp @@ -566,6 +566,7 @@ int register_all_cocos2dx_studio(lua_State* tolua_S); + #endif // __cocos2dx_studio_h__ 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 38b28f436f94..5eb6b991edca 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -17485,6 +17485,56 @@ int lua_cocos2dx_ui_ListView_pushBackCustomItem(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_ListView_setCurSelectedIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::ListView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.ListView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::ListView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ListView_setCurSelectedIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccui.ListView:setCurSelectedIndex"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ListView_setCurSelectedIndex'", nullptr); + return 0; + } + cobj->setCurSelectedIndex(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ListView:setCurSelectedIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ListView_setCurSelectedIndex'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_ListView_insertDefaultItem(lua_State* tolua_S) { int argc = 0; @@ -18670,6 +18720,7 @@ int lua_register_cocos2dx_ui_ListView(lua_State* tolua_S) tolua_function(tolua_S,"setMagneticType",lua_cocos2dx_ui_ListView_setMagneticType); tolua_function(tolua_S,"getIndex",lua_cocos2dx_ui_ListView_getIndex); tolua_function(tolua_S,"pushBackCustomItem",lua_cocos2dx_ui_ListView_pushBackCustomItem); + tolua_function(tolua_S,"setCurSelectedIndex",lua_cocos2dx_ui_ListView_setCurSelectedIndex); tolua_function(tolua_S,"insertDefaultItem",lua_cocos2dx_ui_ListView_insertDefaultItem); tolua_function(tolua_S,"setMagneticAllowedOutOfBoundary",lua_cocos2dx_ui_ListView_setMagneticAllowedOutOfBoundary); tolua_function(tolua_S,"addEventListener",lua_cocos2dx_ui_ListView_addEventListener); @@ -23177,6 +23228,53 @@ int lua_cocos2dx_ui_PageView_insertPage(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_PageView_removeAllPages(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::PageView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::PageView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_removeAllPages'", 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_ui_PageView_removeAllPages'", nullptr); + return 0; + } + cobj->removeAllPages(); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:removeAllPages",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_removeAllPages'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_PageView_setAutoScrollStopEpsilon(lua_State* tolua_S) { int argc = 0; @@ -23227,6 +23325,56 @@ int lua_cocos2dx_ui_PageView_setAutoScrollStopEpsilon(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_PageView_setIndicatorIndexNodesScale(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::PageView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::PageView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesScale'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "ccui.PageView:setIndicatorIndexNodesScale"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesScale'", nullptr); + return 0; + } + cobj->setIndicatorIndexNodesScale(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:setIndicatorIndexNodesScale",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesScale'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_PageView_setIndicatorEnabled(lua_State* tolua_S) { int argc = 0; @@ -23478,6 +23626,53 @@ int lua_cocos2dx_ui_PageView_setCurrentPageIndex(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_PageView_getIndicatorIndexNodesColor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::PageView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::PageView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_getIndicatorIndexNodesColor'", 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_ui_PageView_getIndicatorIndexNodesColor'", nullptr); + return 0; + } + const cocos2d::Color3B& ret = cobj->getIndicatorIndexNodesColor(); + color3b_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:getIndicatorIndexNodesColor",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_getIndicatorIndexNodesColor'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_PageView_getIndicatorSelectedIndexColor(lua_State* tolua_S) { int argc = 0; @@ -23525,6 +23720,53 @@ int lua_cocos2dx_ui_PageView_getIndicatorSelectedIndexColor(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_PageView_getIndicatorIndexNodesScale(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::PageView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::PageView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_getIndicatorIndexNodesScale'", 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_ui_PageView_getIndicatorIndexNodesScale'", nullptr); + return 0; + } + double ret = cobj->getIndicatorIndexNodesScale(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:getIndicatorIndexNodesScale",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_getIndicatorIndexNodesScale'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_PageView_setIndicatorPosition(lua_State* tolua_S) { int argc = 0; @@ -23725,7 +23967,7 @@ int lua_cocos2dx_ui_PageView_scrollToItem(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_PageView_removeAllPages(lua_State* tolua_S) +int lua_cocos2dx_ui_PageView_setIndicatorIndexNodesColor(lua_State* tolua_S) { int argc = 0; cocos2d::ui::PageView* cobj = nullptr; @@ -23745,29 +23987,32 @@ int lua_cocos2dx_ui_PageView_removeAllPages(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_removeAllPages'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) + if (argc == 1) { + cocos2d::Color3B arg0; + + ok &= luaval_to_color3b(tolua_S, 2, &arg0, "ccui.PageView:setIndicatorIndexNodesColor"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_PageView_removeAllPages'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesColor'", nullptr); return 0; } - cobj->removeAllPages(); + cobj->setIndicatorIndexNodesColor(arg0); lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:removeAllPages",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:setIndicatorIndexNodesColor",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_removeAllPages'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesColor'.",&tolua_err); #endif return 0; @@ -23916,6 +24161,73 @@ int lua_cocos2dx_ui_PageView_removePage(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::PageView* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.PageView",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::PageView*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccui.PageView:setIndicatorIndexNodesTexture"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture'", nullptr); + return 0; + } + cobj->setIndicatorIndexNodesTexture(arg0); + lua_settop(tolua_S, 1); + return 1; + } + if (argc == 2) + { + std::string arg0; + cocos2d::ui::Widget::TextureResType arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccui.PageView:setIndicatorIndexNodesTexture"); + + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "ccui.PageView:setIndicatorIndexNodesTexture"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture'", nullptr); + return 0; + } + cobj->setIndicatorIndexNodesTexture(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.PageView:setIndicatorIndexNodesTexture",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_PageView_getIndicatorEnabled(lua_State* tolua_S) { int argc = 0; @@ -24230,21 +24542,26 @@ int lua_register_cocos2dx_ui_PageView(lua_State* tolua_S) tolua_function(tolua_S,"new",lua_cocos2dx_ui_PageView_constructor); tolua_function(tolua_S,"setIndicatorSpaceBetweenIndexNodes",lua_cocos2dx_ui_PageView_setIndicatorSpaceBetweenIndexNodes); tolua_function(tolua_S,"insertPage",lua_cocos2dx_ui_PageView_insertPage); + tolua_function(tolua_S,"removeAllPages",lua_cocos2dx_ui_PageView_removeAllPages); tolua_function(tolua_S,"setAutoScrollStopEpsilon",lua_cocos2dx_ui_PageView_setAutoScrollStopEpsilon); + tolua_function(tolua_S,"setIndicatorIndexNodesScale",lua_cocos2dx_ui_PageView_setIndicatorIndexNodesScale); tolua_function(tolua_S,"setIndicatorEnabled",lua_cocos2dx_ui_PageView_setIndicatorEnabled); tolua_function(tolua_S,"setIndicatorSelectedIndexColor",lua_cocos2dx_ui_PageView_setIndicatorSelectedIndexColor); tolua_function(tolua_S,"addEventListener",lua_cocos2dx_ui_PageView_addEventListener); tolua_function(tolua_S,"getIndicatorPosition",lua_cocos2dx_ui_PageView_getIndicatorPosition); tolua_function(tolua_S,"setCurrentPageIndex",lua_cocos2dx_ui_PageView_setCurrentPageIndex); + tolua_function(tolua_S,"getIndicatorIndexNodesColor",lua_cocos2dx_ui_PageView_getIndicatorIndexNodesColor); tolua_function(tolua_S,"getIndicatorSelectedIndexColor",lua_cocos2dx_ui_PageView_getIndicatorSelectedIndexColor); + tolua_function(tolua_S,"getIndicatorIndexNodesScale",lua_cocos2dx_ui_PageView_getIndicatorIndexNodesScale); tolua_function(tolua_S,"setIndicatorPosition",lua_cocos2dx_ui_PageView_setIndicatorPosition); tolua_function(tolua_S,"scrollToPage",lua_cocos2dx_ui_PageView_scrollToPage); tolua_function(tolua_S,"setIndicatorPositionAsAnchorPoint",lua_cocos2dx_ui_PageView_setIndicatorPositionAsAnchorPoint); tolua_function(tolua_S,"scrollToItem",lua_cocos2dx_ui_PageView_scrollToItem); - tolua_function(tolua_S,"removeAllPages",lua_cocos2dx_ui_PageView_removeAllPages); + tolua_function(tolua_S,"setIndicatorIndexNodesColor",lua_cocos2dx_ui_PageView_setIndicatorIndexNodesColor); tolua_function(tolua_S,"getIndicatorPositionAsAnchorPoint",lua_cocos2dx_ui_PageView_getIndicatorPositionAsAnchorPoint); tolua_function(tolua_S,"getCurrentPageIndex",lua_cocos2dx_ui_PageView_getCurrentPageIndex); tolua_function(tolua_S,"removePage",lua_cocos2dx_ui_PageView_removePage); + tolua_function(tolua_S,"setIndicatorIndexNodesTexture",lua_cocos2dx_ui_PageView_setIndicatorIndexNodesTexture); tolua_function(tolua_S,"getIndicatorEnabled",lua_cocos2dx_ui_PageView_getIndicatorEnabled); tolua_function(tolua_S,"removePageAtIndex",lua_cocos2dx_ui_PageView_removePageAtIndex); tolua_function(tolua_S,"getIndicatorSpaceBetweenIndexNodes",lua_cocos2dx_ui_PageView_getIndicatorSpaceBetweenIndexNodes); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index 2b02790790df..c120314acce0 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -745,6 +745,12 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + + + + + + diff --git a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp index 3e56bbf6bdc5..be53250526d7 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -60,89 +60,46 @@ extern "C" { #include "platform/CCFileUtils.h" namespace { -int lua_print(lua_State * luastate) -{ - int nargs = lua_gettop(luastate); - - std::string t; - for (int i=1; i <= nargs; i++) - { - if (lua_istable(luastate, i)) - t += "table"; - else if (lua_isnone(luastate, i)) - t += "none"; - else if (lua_isnil(luastate, i)) - t += "nil"; - else if (lua_isboolean(luastate, i)) - { - if (lua_toboolean(luastate, i) != 0) - t += "true"; - else - t += "false"; - } - else if (lua_isfunction(luastate, i)) - t += "function"; - else if (lua_islightuserdata(luastate, i)) - t += "lightuserdata"; - else if (lua_isthread(luastate, i)) - t += "thread"; - else - { - const char * str = lua_tostring(luastate, i); - if (str) - t += lua_tostring(luastate, i); - else - t += lua_typename(luastate, lua_type(luastate, i)); + int get_string_for_print(lua_State * L, std::string* out) + { + int n = lua_gettop(L); /* number of arguments */ + int i; + + lua_getglobal(L, "tostring"); + for (i=1; i<=n; i++) { + const char *s; + lua_pushvalue(L, -1); /* function to be called */ + lua_pushvalue(L, i); /* value to print */ + lua_call(L, 1, 1); + size_t sz; + s = lua_tolstring(L, -1, &sz); /* get result */ + if (s == NULL) + return luaL_error(L, LUA_QL("tostring") " must return a string to " + LUA_QL("print")); + if (i>1) out->append("\t"); + out->append(s, sz); + lua_pop(L, 1); /* pop result */ } - if (i!=nargs) - t += "\t"; + return 0; } - CCLOG("[LUA-print] %s", t.c_str()); - return 0; -} + int lua_print(lua_State * L) + { + std::string t; + get_string_for_print(L, &t); + CCLOG("[LUA-print] %s", t.c_str()); -int lua_release_print(lua_State * L) -{ - int nargs = lua_gettop(L); + return 0; + } - std::string t; - for (int i=1; i <= nargs; i++) + int lua_release_print(lua_State * L) { - if (lua_istable(L, i)) - t += "table"; - else if (lua_isnone(L, i)) - t += "none"; - else if (lua_isnil(L, i)) - t += "nil"; - else if (lua_isboolean(L, i)) - { - if (lua_toboolean(L, i) != 0) - t += "true"; - else - t += "false"; - } - else if (lua_isfunction(L, i)) - t += "function"; - else if (lua_islightuserdata(L, i)) - t += "lightuserdata"; - else if (lua_isthread(L, i)) - t += "thread"; - else - { - const char * str = lua_tostring(L, i); - if (str) - t += lua_tostring(L, i); - else - t += lua_typename(L, lua_type(L, i)); - } - if (i!=nargs) - t += "\t"; - } - log("[LUA-print] %s", t.c_str()); + std::string t; + get_string_for_print(L, &t); + log("[LUA-print] %s", t.c_str()); - return 0; -} + return 0; + } } NS_CC_BEGIN @@ -818,7 +775,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State *L) bool isXXTEA = stack && stack->_xxteaEnabled && size >= stack->_xxteaSignLen && memcmp(stack->_xxteaSign, bytes, stack->_xxteaSignLen) == 0; - + if (isXXTEA) { // decrypt XXTEA xxtea_long len = 0; buffer = xxtea_decrypt(bytes + stack->_xxteaSignLen, diff --git a/cocos/scripting/lua-bindings/manual/audioengine/lua_cocos2dx_audioengine_manual.cpp b/cocos/scripting/lua-bindings/manual/audioengine/lua_cocos2dx_audioengine_manual.cpp index b81761f9cb9d..99017031fb8a 100644 --- a/cocos/scripting/lua-bindings/manual/audioengine/lua_cocos2dx_audioengine_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/audioengine/lua_cocos2dx_audioengine_manual.cpp @@ -25,7 +25,7 @@ #include "scripting/lua-bindings/manual/audioengine/lua_cocos2dx_audioengine_manual.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_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN #include "scripting/lua-bindings/auto/lua_cocos2dx_audioengine_auto.hpp" #include "scripting/lua-bindings/manual/tolua_fix.h" diff --git a/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp b/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp index d342f3645e7c..3cddf8496c0f 100644 --- a/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp +++ b/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp @@ -40,10 +40,17 @@ bool LuaJavaBridge::CallInfo::execute(void) break; case TypeString: + { m_retjs = (jstring)m_env->CallStaticObjectMethod(m_classID, m_methodID); std::string strValue = cocos2d::StringUtils::getStringUTFCharsJNI(m_env, m_retjs); m_ret.stringValue = new string(strValue); break; + } + + default: + m_error = LUAJ_ERR_TYPE_NOT_SUPPORT; + LOGD("Return type '%d' is not supported", static_cast(m_returnType)); + return false; } if (m_env->ExceptionCheck() == JNI_TRUE) @@ -79,10 +86,17 @@ bool LuaJavaBridge::CallInfo::executeWithArgs(jvalue *args) break; case TypeString: + { m_retjs = (jstring)m_env->CallStaticObjectMethodA(m_classID, m_methodID, args); std::string strValue = cocos2d::StringUtils::getStringUTFCharsJNI(m_env, m_retjs); m_ret.stringValue = new string(strValue); break; + } + + default: + m_error = LUAJ_ERR_TYPE_NOT_SUPPORT; + LOGD("Return type '%d' is not supported", static_cast(m_returnType)); + return false; } if (m_env->ExceptionCheck() == JNI_TRUE) @@ -118,6 +132,8 @@ int LuaJavaBridge::CallInfo::pushReturnValue(lua_State *L) case TypeString: lua_pushstring(L, m_ret.stringValue->c_str()); return 1; + default: + break; } return 0; diff --git a/cocos/scripting/lua-bindings/proj.tizen/.cproject b/cocos/scripting/lua-bindings/proj.tizen/.cproject new file mode 100644 index 000000000000..cd425c04d2ee --- /dev/null +++ b/cocos/scripting/lua-bindings/proj.tizen/.cproject @@ -0,0 +1,1166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos/scripting/lua-bindings/proj.tizen/.gitignore b/cocos/scripting/lua-bindings/proj.tizen/.gitignore new file mode 100644 index 000000000000..bfc40a35ed1f --- /dev/null +++ b/cocos/scripting/lua-bindings/proj.tizen/.gitignore @@ -0,0 +1,2 @@ +/res +/Emulator diff --git a/cocos/scripting/lua-bindings/proj.tizen/.project b/cocos/scripting/lua-bindings/proj.tizen/.project new file mode 100644 index 000000000000..3486dacac07a --- /dev/null +++ b/cocos/scripting/lua-bindings/proj.tizen/.project @@ -0,0 +1,137 @@ + + + libcocos2dxluabindings + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + org.tizen.nativecore.apichecker.core.builder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.tizen.nativecore.apichecker.core.tizenCppNature + + + + auto + 2 + PARENT-1-PROJECT_LOC/auto + + + lua + 2 + PARENT-4-PROJECT_LOC/external/lua + + + manual + 2 + PARENT-1-PROJECT_LOC/manual + + + script + 2 + PARENT-1-PROJECT_LOC/script + + + + + 1414551199494 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-projectRelativePath-matches-false-false-*/.tpk + + + + 1414551199497 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-luajit + + + + 1414551199500 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-android + + + + 1414551199504 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-ios + + + + 1414551199507 + + 22 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-true-false-wsocket.c + + + + 1426065422920 + lua + 9 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-lua + + + + 1426065422967 + lua + 9 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-tolua + + + + 1426065422983 + lua + 9 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-luasocket + + + + 1426065452420 + lua/lua + 6 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-lua.c + + + + diff --git a/cocos/scripting/lua-bindings/proj.tizen/.tproject b/cocos/scripting/lua-bindings/proj.tizen/.tproject new file mode 100644 index 000000000000..824eaa1748c9 --- /dev/null +++ b/cocos/scripting/lua-bindings/proj.tizen/.tproject @@ -0,0 +1,12 @@ + + + + + mobile-2.4 + + + + + + + diff --git a/cocos/scripting/lua-bindings/script/framework/display.lua b/cocos/scripting/lua-bindings/script/framework/display.lua index 8466a3081bd6..e0a3fad043c3 100644 --- a/cocos/scripting/lua-bindings/script/framework/display.lua +++ b/cocos/scripting/lua-bindings/script/framework/display.lua @@ -185,31 +185,31 @@ display.CENTER_TOP = cc.p(0.5, 1) display.CENTER_BOTTOM = cc.p(0.5, 0) display.SCENE_TRANSITIONS = { - CROSSFADE = cc.TransitionCrossFade, + CROSSFADE = {cc.TransitionCrossFade}, FADE = {cc.TransitionFade, cc.c3b(0, 0, 0)}, - FADEBL = cc.TransitionFadeBL, - FADEDOWN = cc.TransitionFadeDown, - FADETR = cc.TransitionFadeTR, - FADEUP = cc.TransitionFadeUp, + FADEBL = {cc.TransitionFadeBL}, + FADEDOWN = {cc.TransitionFadeDown}, + FADETR = {cc.TransitionFadeTR}, + FADEUP = {cc.TransitionFadeUp}, FLIPANGULAR = {cc.TransitionFlipAngular, cc.TRANSITION_ORIENTATION_LEFT_OVER}, FLIPX = {cc.TransitionFlipX, cc.TRANSITION_ORIENTATION_LEFT_OVER}, FLIPY = {cc.TransitionFlipY, cc.TRANSITION_ORIENTATION_UP_OVER}, - JUMPZOOM = cc.TransitionJumpZoom, - MOVEINB = cc.TransitionMoveInB, - MOVEINL = cc.TransitionMoveInL, - MOVEINR = cc.TransitionMoveInR, - MOVEINT = cc.TransitionMoveInT, + JUMPZOOM = {cc.TransitionJumpZoom}, + MOVEINB = {cc.TransitionMoveInB}, + MOVEINL = {cc.TransitionMoveInL}, + MOVEINR = {cc.TransitionMoveInR}, + MOVEINT = {cc.TransitionMoveInT}, PAGETURN = {cc.TransitionPageTurn, false}, - ROTOZOOM = cc.TransitionRotoZoom, - SHRINKGROW = cc.TransitionShrinkGrow, - SLIDEINB = cc.TransitionSlideInB, - SLIDEINL = cc.TransitionSlideInL, - SLIDEINR = cc.TransitionSlideInR, - SLIDEINT = cc.TransitionSlideInT, - SPLITCOLS = cc.TransitionSplitCols, - SPLITROWS = cc.TransitionSplitRows, - TURNOFFTILES = cc.TransitionTurnOffTiles, - ZOOMFLIPANGULAR = cc.TransitionZoomFlipAngular, + ROTOZOOM = {cc.TransitionRotoZoom}, + SHRINKGROW = {cc.TransitionShrinkGrow}, + SLIDEINB = {cc.TransitionSlideInB}, + SLIDEINL = {cc.TransitionSlideInL}, + SLIDEINR = {cc.TransitionSlideInR}, + SLIDEINT = {cc.TransitionSlideInT}, + SPLITCOLS = {cc.TransitionSplitCols}, + SPLITROWS = {cc.TransitionSplitRows}, + TURNOFFTILES = {cc.TransitionTurnOffTiles}, + ZOOMFLIPANGULAR = {cc.TransitionZoomFlipAngular}, ZOOMFLIPX = {cc.TransitionZoomFlipX, cc.TRANSITION_ORIENTATION_LEFT_OVER}, ZOOMFLIPY = {cc.TransitionZoomFlipY, cc.TRANSITION_ORIENTATION_UP_OVER}, } @@ -252,12 +252,13 @@ function display.wrapScene(scene, transition, time, more) if display.SCENE_TRANSITIONS[key] then local t = display.SCENE_TRANSITIONS[key] + local cls = t[1] time = time or 0.2 more = more or t[2] - if type(t) == "table" then - scene = t[1]:create(time, scene, more) + if more ~= nil then + scene = cls:create(time, scene, more) else - scene = t:create(time, scene) + scene = cls:create(time, scene) end else error(string.format("display.wrapScene() - invalid transition %s", tostring(transition))) diff --git a/cocos/scripting/lua-bindings/script/framework/extends/UIListView.lua b/cocos/scripting/lua-bindings/script/framework/extends/UIListView.lua index cab47a935cbf..a9f7f1ef324e 100644 --- a/cocos/scripting/lua-bindings/script/framework/extends/UIListView.lua +++ b/cocos/scripting/lua-bindings/script/framework/extends/UIListView.lua @@ -60,6 +60,10 @@ function ListView:onScroll(callback) event.name = "BOUNCE_LEFT" elseif eventType == 8 then event.name = "BOUNCE_RIGHT" + elseif eventType == 9 then + event.name = "CONTAINER_MOVED" + elseif eventType == 10 then + event.name = "AUTOSCROLL_ENDED" end event.target = sender callback(event) diff --git a/cocos/scripting/lua-bindings/script/framework/extends/UIScrollView.lua b/cocos/scripting/lua-bindings/script/framework/extends/UIScrollView.lua index 601faf936bb7..0fd4c69f519d 100644 --- a/cocos/scripting/lua-bindings/script/framework/extends/UIScrollView.lua +++ b/cocos/scripting/lua-bindings/script/framework/extends/UIScrollView.lua @@ -46,6 +46,10 @@ function ScrollView:onEvent(callback) event.name = "BOUNCE_LEFT" elseif eventType == 8 then event.name = "BOUNCE_RIGHT" + elseif eventType == 9 then + event.name = "CONTAINER_MOVED" + elseif eventType == 10 then + event.name = "AUTOSCROLL_ENDED" end event.target = sender callback(event) diff --git a/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua b/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua index ae7d63f96418..219d4db4cce3 100644 --- a/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua +++ b/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua @@ -59,6 +59,8 @@ SCROLLVIEW_EVENT_BOUNCE_TOP = ccui.ScrollviewEventType.bounceTop SCROLLVIEW_EVENT_BOUNCE_BOTTOM = ccui.ScrollviewEventType.bounceBottom SCROLLVIEW_EVENT_BOUNCE_LEFT = ccui.ScrollviewEventType.bounceLeft SCROLLVIEW_EVENT_BOUNCE_RIGHT = ccui.ScrollviewEventType.bounceRight +SCROLLVIEW_EVENT_CONTAINER_MOVED = ccui.ScrollviewEventType.containerMoved +SCROLLVIEW_EVENT_AUTOSCROLL_ENDED = ccui.ScrollviewEventType.autoscrollEnded PAGEVIEW_EVENT_TURNING = ccui.PageViewEventType.turning diff --git a/cocos/scripting/lua-bindings/script/ui/GuiConstants.lua b/cocos/scripting/lua-bindings/script/ui/GuiConstants.lua index 3a522ffa40a7..58bdd6358e41 100644 --- a/cocos/scripting/lua-bindings/script/ui/GuiConstants.lua +++ b/cocos/scripting/lua-bindings/script/ui/GuiConstants.lua @@ -152,6 +152,8 @@ ccui.ScrollviewEventType = { bounceBottom = 6, bounceLeft = 7, bounceRight = 8, + containerMoved = 9, + autoscrollEnded = 10, } ccui.ListViewDirection = { diff --git a/cocos/storage/local-storage/LocalStorage-android.cpp b/cocos/storage/local-storage/LocalStorage-android.cpp index afa01d154949..a00c50d5684f 100644 --- a/cocos/storage/local-storage/LocalStorage-android.cpp +++ b/cocos/storage/local-storage/LocalStorage-android.cpp @@ -72,7 +72,7 @@ void localStorageInit( const std::string& fullpath) void localStorageFree() { if (_initialized) { - JniHelper::callStaticVoidMethod(className, "destory"); + JniHelper::callStaticVoidMethod(className, "destroy"); _initialized = 0; } } @@ -94,11 +94,21 @@ bool localStorageGetItem( const std::string& key, std::string *outItem ) { jstring jkey = t.env->NewStringUTF(key.c_str()); jstring jret = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID, jkey); - outItem->assign(JniHelper::jstring2string(jret)); - t.env->DeleteLocalRef(jret); - t.env->DeleteLocalRef(jkey); - t.env->DeleteLocalRef(t.classID); - return true; + if (jret == nullptr) + { + t.env->DeleteLocalRef(jret); + t.env->DeleteLocalRef(jkey); + t.env->DeleteLocalRef(t.classID); + return false; + } + else + { + outItem->assign(JniHelper::jstring2string(jret)); + t.env->DeleteLocalRef(jret); + t.env->DeleteLocalRef(jkey); + t.env->DeleteLocalRef(t.classID); + return true; + } } else { diff --git a/cocos/ui/CocosGUI.h b/cocos/ui/CocosGUI.h index 8f32d2d3fc74..87fae1bb79a9 100644 --- a/cocos/ui/CocosGUI.h +++ b/cocos/ui/CocosGUI.h @@ -46,10 +46,10 @@ THE SOFTWARE. #include "ui/UIHBox.h" #include "ui/UIVBox.h" #include "ui/UIRelativeBox.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) #include "ui/UIVideoPlayer.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) #include "ui/UIWebView.h" #endif #include "ui/UIDeprecated.h" diff --git a/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm b/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm index 018ec665577b..833a1817ab94 100644 --- a/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm +++ b/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm @@ -44,7 +44,7 @@ - (instancetype)initWithFrame:(NSRect)frameRect editBox:(void *)editBox self.frameRect = frameRect; self.editBox = editBox; - self.dataInputMode = cocos2d::ui::EditBox::InputFlag::INITIAL_CAPS_ALL_CHARACTERS; + self.dataInputMode = cocos2d::ui::EditBox::InputFlag::LOWERCASE_ALL_CHARACTERS; self.keyboardReturnType = cocos2d::ui::EditBox::KeyboardReturnType::DEFAULT; [self createMultiLineTextField]; @@ -243,6 +243,9 @@ - (void)setInputFlag:(cocos2d::ui::EditBox::InputFlag)inputFlag case cocos2d::ui::EditBox::InputFlag::SENSITIVE: CCLOG("SENSITIVE not implemented"); break; + case cocos2d::ui::EditBox::InputFlag::LOWERCASE_ALL_CHARACTERS: + CCLOG("LOWERCASE_ALL_CHARACTERS not implemented"); + break; default: break; } diff --git a/cocos/ui/UIEditBox/UIEditBox.cpp b/cocos/ui/UIEditBox/UIEditBox.cpp index 6a6fcaf56729..685c10b05877 100644 --- a/cocos/ui/UIEditBox/UIEditBox.cpp +++ b/cocos/ui/UIEditBox/UIEditBox.cpp @@ -36,7 +36,7 @@ EditBox::EditBox(void) : _editBoxImpl(nullptr) , _delegate(nullptr) , _editBoxInputMode(EditBox::InputMode::SINGLE_LINE) -, _editBoxInputFlag(EditBox::InputFlag::INITIAL_CAPS_ALL_CHARACTERS) +, _editBoxInputFlag(EditBox::InputFlag::LOWERCASE_ALL_CHARACTERS) , _keyboardReturnType(KeyboardReturnType::DEFAULT) , _backgroundSprite(nullptr) , _fontSize(-1) diff --git a/cocos/ui/UIEditBox/UIEditBox.h b/cocos/ui/UIEditBox/UIEditBox.h index c4e2a91287da..1ee89d860416 100644 --- a/cocos/ui/UIEditBox/UIEditBox.h +++ b/cocos/ui/UIEditBox/UIEditBox.h @@ -185,6 +185,11 @@ namespace ui { * Capitalize all characters automatically. */ INITIAL_CAPS_ALL_CHARACTERS, + + /** + * Lowercase all characters automatically. + */ + LOWERCASE_ALL_CHARACTERS }; /** diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp index 88df3bf56e58..a2b5b65a946d 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp @@ -110,7 +110,7 @@ void EditBoxImplCommon::setInactiveText(const char* pText) if(EditBox::InputFlag::PASSWORD == _editBoxInputFlag) { std::string passwordString; - for(int i = 0; i < strlen(pText); ++i) + for(size_t i = 0; i < strlen(pText); ++i) passwordString.append(PASSWORD_CHAR); _label->setString(passwordString); } diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-common.h b/cocos/ui/UIEditBox/UIEditBoxImpl-common.h index 1785bf6ec1bd..2a0c95fd4fb2 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-common.h +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-common.h @@ -37,7 +37,7 @@ namespace ui { class EditBox; -class EditBoxImplCommon : public EditBoxImpl +class CC_GUI_DLL EditBoxImplCommon : public EditBoxImpl { public: /** diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-tizen.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-tizen.cpp new file mode 100644 index 000000000000..1108db04d83a --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-tizen.cpp @@ -0,0 +1,439 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 James Chen + + 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 "ui/UIEditBox/UIEditBoxImpl-tizen.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) + +#include +#include +#include + +#include "ui/UIEditBox/UIEditBox.h" +#include "2d/CCLabel.h" +#include "base/ccUTF8.h" + + +#include "platform/tizen/CCApplication-tizen.h" +#include "base/CCDirector.h" + +NS_CC_BEGIN + +namespace ui { + +EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) +{ + return new EditBoxImplTizen(pEditBox); +} + +EditBoxImplTizen::EditBoxImplTizen(EditBox* pEditText) +: EditBoxImpl(pEditText) +, _label(nullptr) +, _labelPlaceHolder(nullptr) +, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE) +, _editBoxInputFlag(EditBox::InputFlag::INITIAL_CAPS_ALL_CHARACTERS) +, _keyboardReturnType(EditBox::KeyboardReturnType::DEFAULT) +, _colText(Color3B::WHITE) +, _colPlaceHolder(Color3B::GRAY) +, _maxLength(-1) +{ + +} + +EditBoxImplTizen::~EditBoxImplTizen() +{ + +} + +void EditBoxImplTizen::doAnimationWhenKeyboardMove(float duration, float distance) +{ // don't need to be implemented on tizen platform. + +} + +static const int CC_EDIT_BOX_PADDING = 5; + +bool EditBoxImplTizen::initWithSize(const Size& size) +{ + int fontSize = size.height-12; + _label = Label::create(); + _label->setSystemFontSize(size.height-12); + // align the text vertically center + _label->setAnchorPoint(Vec2(0, 0.5f)); + _label->setPosition(Vec2(CC_EDIT_BOX_PADDING, size.height / 2.0f)); + _label->setTextColor(_colText); + _editBox->addChild(_label); + + _labelPlaceHolder = Label::create(); + _labelPlaceHolder->setSystemFontSize(size.height-12); + // align the text vertically center + _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); + _labelPlaceHolder->setPosition(CC_EDIT_BOX_PADDING, size.height / 2.0f); + _labelPlaceHolder->setVisible(false); + _labelPlaceHolder->setTextColor(_colPlaceHolder); + _editBox->addChild(_labelPlaceHolder); + + _editSize = size; + return true; +} + +void EditBoxImplTizen::setFont(const char* pFontName, int fontSize) +{ + if(_label != NULL) { + _label->setSystemFontName(pFontName); + _label->setSystemFontSize(fontSize); + } + + if(_labelPlaceHolder != NULL) { + _labelPlaceHolder->setSystemFontName(pFontName); + _labelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void EditBoxImplTizen::setFontColor(const Color4B& color) +{ + _colText = color; + _label->setTextColor(color); +} + +void EditBoxImplTizen::setPlaceholderFont(const char* pFontName, int fontSize) +{ + if(_labelPlaceHolder != NULL) { + _labelPlaceHolder->setSystemFontName(pFontName); + _labelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void EditBoxImplTizen::setPlaceholderFontColor(const Color4B& color) +{ + _colPlaceHolder = color; + _labelPlaceHolder->setTextColor(color); +} + +void EditBoxImplTizen::setInputMode(EditBox::InputMode inputMode) +{ + _editBoxInputMode = inputMode; +} + +void EditBoxImplTizen::setMaxLength(int maxLength) +{ + _maxLength = maxLength; +} + +int EditBoxImplTizen::getMaxLength() +{ + return _maxLength; +} + +void EditBoxImplTizen::setInputFlag(EditBox::InputFlag inputFlag) +{ + _editBoxInputFlag = inputFlag; +} + +void EditBoxImplTizen::setReturnType(EditBox::KeyboardReturnType returnType) +{ + _keyboardReturnType = returnType; +} + +bool EditBoxImplTizen::isEditing() +{ + return false; +} + +void EditBoxImplTizen::setText(const char* pText) +{ + if (pText != NULL) + { + _text = pText; + + if (_text.length() > 0) + { + _labelPlaceHolder->setVisible(false); + + std::string strToShow; + + if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag) + { + long length = cc_utf8_strlen(_text.c_str(), -1); + for (long i = 0; i < length; i++) + { + strToShow.append("*"); + } + } + else + { + strToShow = _text; + } + + _label->setString(strToShow.c_str()); + + // Clip the text width to fit to the text box + + float fMaxWidth = _editSize.width - CC_EDIT_BOX_PADDING * 2; + auto labelSize = _label->getContentSize(); + if(labelSize.width > fMaxWidth) { + _label->setDimensions(fMaxWidth,labelSize.height); + } + } + else + { + _labelPlaceHolder->setVisible(true); + _label->setString(""); + } + + } +} + +const char* EditBoxImplTizen::getText(void) +{ + return _text.c_str(); +} + +void EditBoxImplTizen::setPlaceHolder(const char* pText) +{ + if (pText != NULL) + { + _placeHolder = pText; + if (_placeHolder.length() > 0 && _text.length() == 0) + { + _labelPlaceHolder->setVisible(true); + } + + _labelPlaceHolder->setString(_placeHolder.c_str()); + } +} + +void EditBoxImplTizen::setPosition(const Vec2& pos) +{ // don't need to be implemented on tizen platform. + +} + +void EditBoxImplTizen::setVisible(bool visible) +{ // don't need to be implemented on tizen platform. + +} + +void EditBoxImplTizen::setContentSize(const Size& size) +{ // don't need to be implemented on tizen platform. + +} + +void EditBoxImplTizen::setAnchorPoint(const Vec2& anchorPoint) +{ // don't need to be implemented on tizen platform. + +} + +void EditBoxImplTizen::visit(void) +{ // don't need to be implemented on tizen platform. + +} + +void EditBoxImplTizen::onEnter(void) +{ // don't need to be implemented on tizen platform. + +} + +static void editBoxCallbackFunc(const char* pText, void* ctx) +{ + EditBoxImplTizen* thiz = (EditBoxImplTizen*)ctx; + thiz->setText(pText); + + if (thiz->getDelegate() != NULL) + { + thiz->getDelegate()->editBoxTextChanged(thiz->getEditBox(), thiz->getText()); + thiz->getDelegate()->editBoxEditingDidEnd(thiz->getEditBox()); + thiz->getDelegate()->editBoxReturn(thiz->getEditBox()); + } + +#if CC_ENABLE_SCRIPT_BINDING + EditBox* pEditBox = thiz->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox); + ScriptEvent event(kCommonEvent,(void*)&data); + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + memset(data.eventName, 0, sizeof(data.eventName)); + strncpy(data.eventName, "ended", sizeof(data.eventName)); + event.data = (void*)&data; + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + memset(data.eventName, 0, sizeof(data.eventName)); + strncpy(data.eventName, "return", sizeof(data.eventName)); + event.data = (void*)&data; + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif +} + +static Evas_Object * s_keypadWin = nullptr; + +static void entry_back_cb(void *data, Evas_Object *obj, void *event_info) +{ + evas_object_del(s_keypadWin); + s_keypadWin = nullptr; +} + +static void entry_activated_cb(void *data, Evas_Object *obj, void *event_info) +{ + char *commit_str = (char *)event_info; + const char* text = elm_entry_entry_get(obj); + editBoxCallbackFunc(text, data); + elm_entry_input_panel_hide(obj); + evas_object_del(s_keypadWin); + s_keypadWin = nullptr; +} + +void EditBoxImplTizen::openKeyboard() +{ + if (s_keypadWin) + { + return; + } + + if (_delegate != NULL) + { + _delegate->editBoxEditingDidBegin(_editBox); + } + +#if CC_ENABLE_SCRIPT_BINDING + EditBox* pEditBox = this->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); + ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif + + Evas_Object* parent = Application::getInstance()->_win; + GLView* glView = Director::getInstance()->getOpenGLView(); + Size frameSize = glView->getFrameSize(); + + s_keypadWin = elm_win_add(parent, "cocos2d-x", ELM_WIN_BASIC); + elm_win_autodel_set(s_keypadWin, EINA_TRUE); + elm_win_conformant_set(s_keypadWin, EINA_TRUE); + elm_win_alpha_set(s_keypadWin, EINA_TRUE); + evas_object_show(s_keypadWin); + eext_object_event_callback_add(s_keypadWin, EEXT_CALLBACK_BACK, entry_back_cb, this); + int rots[2]; + rots[0] = (int)(elm_win_rotation_get(parent)); + rots[1] = rots[0] + 180 % 360; + elm_win_wm_rotation_available_rotations_set(s_keypadWin, rots, 2); + + Evas_Object* bgFull = elm_bg_add(s_keypadWin); + evas_object_color_set(bgFull, 0, 0, 0, 0xa0); + evas_object_resize(bgFull, frameSize.width, frameSize.height); + evas_object_show(bgFull); + + int height = frameSize.height / 10; + Evas_Object* rectangle = elm_bg_add(bgFull); + evas_object_resize(rectangle, frameSize.width, height); + evas_object_move(rectangle, 0, height); + evas_object_color_set(rectangle, 0xff, 0xff, 0xff, 0xff); + evas_object_show(rectangle); + + Evas_Object* title = elm_entry_add(rectangle); + evas_object_resize(title, frameSize.width, height); + auto text = _placeHolder.c_str(); + auto richText = (char*)malloc(strlen(text) + 50); + sprintf(richText,"%s", text); + elm_entry_entry_set(title, richText); + elm_entry_editable_set(title, EINA_FALSE); + //elm_entry_drag_disabled_set(title, EINA_TRUE); + //elm_entry_drop_disabled_set(title, EINA_TRUE); + evas_object_show(title); + free(richText); + + Evas_Object* entry = elm_entry_add(bgFull); + elm_object_focus_set(entry, EINA_TRUE); + evas_object_resize(entry, frameSize.width, height); + evas_object_move(entry, 0, height); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_line_wrap_set(entry, ELM_WRAP_MIXED); + elm_entry_entry_set(entry, _text.c_str()); + evas_object_show(entry); + elm_object_focus_set(entry, EINA_TRUE); + eext_entry_selection_back_event_allow_set(entry, EINA_TRUE); + Elm_Entry_Filter_Limit_Size limit_size = { 0, }; + limit_size.max_char_count = _maxLength; + elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_size); + elm_entry_input_panel_return_key_type_set(entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE); + elm_entry_prediction_allow_set(entry, EINA_FALSE); + + evas_object_smart_callback_add(entry, "activated", entry_activated_cb, this); + + switch(_editBoxInputFlag) + { + case EditBox::InputFlag::PASSWORD: + elm_entry_password_set(entry, EINA_TRUE); + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_EMAIL); + break; + case EditBox::InputFlag::SENSITIVE: + elm_entry_input_hint_set(entry, ELM_INPUT_HINT_SENSITIVE_DATA); + break; + case EditBox::InputFlag::INITIAL_CAPS_WORD: + elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_WORD); + break; + case EditBox::InputFlag::INITIAL_CAPS_SENTENCE: + elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_SENTENCE); + break; + case EditBox::InputFlag::INITIAL_CAPS_ALL_CHARACTERS: + elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_ALLCHARACTER); + break; + } + + switch(_editBoxInputMode) + { + case EditBox::InputMode::ANY: + break; + case EditBox::InputMode::EMAIL_ADDRESS: + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_EMAIL); + break; + case EditBox::InputMode::NUMERIC: + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBER); + break; + case EditBox::InputMode::PHONE_NUMBER: + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_PHONENUMBER); + break; + case EditBox::InputMode::URL: + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_URL); + break; + case EditBox::InputMode::DECIMAL: + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_HEX); //fixme? + break; + case EditBox::InputMode::SINGLE_LINE: + break; + } +} + +void EditBoxImplTizen::closeKeyboard() +{ + +} + +} + +NS_CC_END + +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) */ + diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-tizen.h b/cocos/ui/UIEditBox/UIEditBoxImpl-tizen.h new file mode 100644 index 000000000000..b4ca623ff02e --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-tizen.h @@ -0,0 +1,117 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 James Chen + + 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 __UIEDITBOXIMPLTIZEN_H__ +#define __UIEDITBOXIMPLTIZEN_H__ + +#include "platform/CCPlatformConfig.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) + +#include "ui/UIEditBox/UIEditBoxImpl.h" +#include "platform/CCGLView.h" + +NS_CC_BEGIN + +class Label; + +namespace ui { + +class EditBox; + +class EditBoxImplTizen : public EditBoxImpl +{ +public: + /** + * @js NA + */ + EditBoxImplTizen(EditBox* pEditText); + /** + * @js NA + * @lua NA + */ + virtual ~EditBoxImplTizen(); + + virtual void draw(cocos2d::Renderer *renderer, cocos2d::Mat4 const &transform, uint32_t flags) {}; + + virtual bool initWithSize(const Size& size); + virtual void setFont(const char* pFontName, int fontSize); + virtual void setFontColor(const Color4B& color); + virtual void setPlaceholderFont(const char* pFontName, int fontSize); + virtual void setPlaceholderFontColor(const Color4B& color); + virtual void setInputMode(EditBox::InputMode inputMode); + virtual void setInputFlag(EditBox::InputFlag inputFlag); + virtual void setMaxLength(int maxLength); + virtual int getMaxLength(); + virtual void setReturnType(EditBox::KeyboardReturnType returnType); + virtual bool isEditing(); + + virtual void setText(const char* pText); + virtual const char* getText(void); + virtual void setPlaceHolder(const char* pText); + virtual void setPosition(const Vec2& pos); + virtual void setVisible(bool visible); + virtual void setContentSize(const Size& size); + virtual void setAnchorPoint(const Vec2& anchorPoint); + /** + * @js NA + * @lua NA + */ + virtual void visit(void); + /** + * @js NA + * @lua NA + */ + virtual void onEnter(void); + virtual void doAnimationWhenKeyboardMove(float duration, float distance); + virtual void openKeyboard(); + virtual void closeKeyboard(); + +private: + Label* _label; + Label* _labelPlaceHolder; + EditBox::InputMode _editBoxInputMode; + EditBox::InputFlag _editBoxInputFlag; + EditBox::KeyboardReturnType _keyboardReturnType; + + std::string _text; + std::string _placeHolder; + + Color4B _colText; + Color4B _colPlaceHolder; + + int _maxLength; + Size _editSize; +}; + + +} + +NS_CC_END + +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) */ + +#endif /* __UIEDITBOXIMPLTIZEN_H__ */ + diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp index 1f0144b339f8..07b282ca1cf5 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp @@ -307,7 +307,7 @@ INT_PTR CWin32InputBox::InputBoxEx(WIN32INPUTBOX_PARAM *param, dlgTemplate->y = param->yPos; } - CCAssert(s_win32InputBox == nullptr, "Only one instance of Win32InputBox allowed"); + CCASSERT(s_win32InputBox == nullptr, "Only one instance of Win32InputBox allowed"); s_win32InputBox = new (std::nothrow) CWin32InputBox(param); s_win32InputBox->_returnType = eReturnType; @@ -389,7 +389,7 @@ void CWin32InputBox::InitDialog() _hwndEditCtrl = hwndEdit1; std::u16string utf16Result; - cocos2d::StringUtils::UTF8ToUTF16(_param->pstrResult->c_str(), utf16Result); + cocos2d::StringUtils::UTF8ToUTF16(*_param->pstrResult, utf16Result); ::SetWindowTextW(_hwndEditCtrl, (LPCWSTR) utf16Result.c_str()); RECT rectDlg, rectEdit1, rectEdit2; @@ -492,7 +492,7 @@ void CWin32InputBox::InitDialog() break; } - CCAssert(_getMsgHook == NULL, "Windows Message hook already set"); + CCASSERT(_getMsgHook == nullptr, "Windows Message hook already set"); // To make the enter key work, here need a Windows Message hook. // Please refer to https://support.microsoft.com/en-us/kb/187988 diff --git a/cocos/ui/UIEditBox/iOS/CCUIEditBoxIOS.mm b/cocos/ui/UIEditBox/iOS/CCUIEditBoxIOS.mm index 9a6f8b79da5d..bb04aadfb555 100644 --- a/cocos/ui/UIEditBox/iOS/CCUIEditBoxIOS.mm +++ b/cocos/ui/UIEditBox/iOS/CCUIEditBoxIOS.mm @@ -57,7 +57,7 @@ - (instancetype)initWithFrame:(CGRect)frameRect editBox:(void *)editBox _editState = NO; self.frameRect = frameRect; self.editBox = editBox; - self.dataInputMode = cocos2d::ui::EditBox::InputFlag::INITIAL_CAPS_ALL_CHARACTERS; + self.dataInputMode = cocos2d::ui::EditBox::InputFlag::LOWERCASE_ALL_CHARACTERS; self.keyboardReturnType = cocos2d::ui::EditBox::KeyboardReturnType::DEFAULT; [self createMultiLineTextField]; @@ -206,6 +206,10 @@ - (void)setInputFlag:(cocos2d::ui::EditBox::InputFlag)flag self.textInput.autocorrectionType = UITextAutocorrectionTypeNo; break; + case cocos2d::ui::EditBox::InputFlag::LOWERCASE_ALL_CHARACTERS: + self.textInput.autocapitalizationType = UITextAutocapitalizationTypeNone; + break; + default: break; } diff --git a/cocos/ui/UIListView.cpp b/cocos/ui/UIListView.cpp index 3fe85a218a94..0050903d52ed 100644 --- a/cocos/ui/UIListView.cpp +++ b/cocos/ui/UIListView.cpp @@ -794,6 +794,17 @@ ssize_t ListView::getCurSelectedIndex() const return _curSelectedIndex; } +void ListView::setCurSelectedIndex(int itemIndex) +{ + Widget* item = getItem(itemIndex); + if (item == nullptr) + { + return; + } + _curSelectedIndex = itemIndex; + this->selectedItemEvent(cocos2d::ui::Widget::TouchEventType::ENDED); +} + void ListView::onSizeChanged() { ScrollView::onSizeChanged(); diff --git a/cocos/ui/UIListView.h b/cocos/ui/UIListView.h index b415cbd6ae0b..11175a797d0f 100644 --- a/cocos/ui/UIListView.h +++ b/cocos/ui/UIListView.h @@ -344,6 +344,12 @@ class CC_GUI_DLL ListView : public ScrollView */ ssize_t getCurSelectedIndex() const; + /** + + * @brief Set current selected widget's index and call TouchEventType::ENDED event. + + * @param A index of a selected item. + + */ + void setCurSelectedIndex(int itemIndex); + /** * Add an event click callback to ListView, then one item of Listview is clicked, the callback will be called. *@deprecated Use `addEventListener` instead. diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index 8e27e193d3bc..4e0727563c2a 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -444,6 +444,44 @@ const Color3B& PageView::getIndicatorSelectedIndexColor() const return _indicator->getSelectedIndexColor(); } +void PageView::setIndicatorIndexNodesColor(const Color3B& color) +{ + if(_indicator != nullptr) + { + _indicator->setIndexNodesColor(color); + } +} + +const Color3B& PageView::getIndicatorIndexNodesColor() const +{ + CCASSERT(_indicator != nullptr, ""); + return _indicator->getIndexNodesColor(); +} + +void PageView::setIndicatorIndexNodesScale(float indexNodesScale) +{ + if(_indicator != nullptr) + { + _indicator->setIndexNodesScale(indexNodesScale); + _indicator->indicate(_currentPageIndex); + } +} + +float PageView::getIndicatorIndexNodesScale() const +{ + CCASSERT(_indicator != nullptr, ""); + return _indicator->getIndexNodesScale(); +} + +void PageView::setIndicatorIndexNodesTexture(const std::string& texName,Widget::TextureResType texType) +{ + if(_indicator != nullptr) + { + _indicator->setIndexNodesTexture(texName, texType); + _indicator->indicate(_currentPageIndex); + } +} + void PageView::remedyLayoutParameter(Widget *item) { item->setContentSize(this->getContentSize()); diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index 7dd3b3f57da1..70ce4aa2ee08 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -301,7 +301,7 @@ class CC_GUI_DLL PageView : public ListView /** * @brief Set color of page indicator's selected index. * - * @param spaceBetweenIndexNodes Space between nodes in pixel. + * @param color Space between nodes in pixel. */ void setIndicatorSelectedIndexColor(const Color3B& color); @@ -312,6 +312,42 @@ class CC_GUI_DLL PageView : public ListView */ const Color3B& getIndicatorSelectedIndexColor() const; + /** + * @brief Set color of page indicator's index nodes. + * + * @param color Space between nodes in pixel. + */ + void setIndicatorIndexNodesColor(const Color3B& color); + + /** + * @brief Get the color of page indicator's index nodes. + * + * @return color + */ + const Color3B& getIndicatorIndexNodesColor() const; + + /** + * @brief Set scale of page indicator's index nodes. + * + * @param indexNodesScale Scale of index nodes. + */ + void setIndicatorIndexNodesScale(float indexNodesScale); + + /** + * sets texture for index nodes. + * + * @param fileName File name of texture. + * @param resType @see TextureResType . + */ + void setIndicatorIndexNodesTexture(const std::string& texName,Widget::TextureResType texType = Widget::TextureResType::LOCAL); + + /** + * @brief Get scale of page indicator's index nodes. + * + * @return indexNodesScale + */ + float getIndicatorIndexNodesScale() const; + /** *@brief If you don't specify the value, the pageView will turn page when scrolling at the half width of a page. *@param threshold A threshold in float. diff --git a/cocos/ui/UIPageViewIndicator.cpp b/cocos/ui/UIPageViewIndicator.cpp index d1b61c640183..af8c033bbd1d 100644 --- a/cocos/ui/UIPageViewIndicator.cpp +++ b/cocos/ui/UIPageViewIndicator.cpp @@ -27,6 +27,7 @@ THE SOFTWARE. #include "base/ccUtils.h" static const char* CIRCLE_IMAGE = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAA8ElEQVRIx62VyRGCQBBF+6gWRCEmYDIQkhiBCgHhSclC8YqWzOV5oVzKAYZp3r1/9fpbxAIBMTsKrjx5cqVgR0wgLhCRUWOjJiPqD56xoaGPhpRZV/iSEy6crHmw5oIrF9b/lVeMofrJgjlnxlIy/wik+JB+mme8BExbBhm+5CJC2LE2LtSEQoyGWDioBA5CoRIohJtK4CYDxzNEM4GAugR1E9VjVC+SZpXvhCJCrjomESLvc17pDGX7bWmlh6UtpjPVCWy9zaJ0TD7qfm3pwERMz2trRVZk3K3BD/L34AY+dEDCniMVBkPFkT2J/b2/AIV+dRpFLOYoAAAAAElFTkSuQmCC"; +static const char* CIRCLE_IMAGE_KEY = "/__circleImage"; NS_CC_BEGIN @@ -50,6 +51,11 @@ PageViewIndicator::PageViewIndicator() : _direction(PageView::Direction::HORIZONTAL) , _currentIndexNode(nullptr) , _spaceBetweenIndexNodes(SPACE_BETWEEN_INDEX_NODES_DEFAULT) +, _indexNodesScale(1.0f) +, _indexNodesColor(Color3B::WHITE) +, _useDefaultTexture(true) +, _indexNodesTextureFile("") +, _indexNodesTexType(Widget::TextureResType::LOCAL) { } @@ -59,7 +65,7 @@ PageViewIndicator::~PageViewIndicator() bool PageViewIndicator::init() { - _currentIndexNode = (Node*) utils::createSpriteFromBase64(CIRCLE_IMAGE); + _currentIndexNode = utils::createSpriteFromBase64Cached(CIRCLE_IMAGE, CIRCLE_IMAGE_KEY); _currentIndexNode->setVisible(false); addProtectedChild(_currentIndexNode, 1); return true; @@ -137,9 +143,83 @@ void PageViewIndicator::setSpaceBetweenIndexNodes(float spaceBetweenIndexNodes) rearrange(); } +void PageViewIndicator::setIndexNodesColor(const Color3B& indexNodesColor) +{ + _indexNodesColor = indexNodesColor; + + for(auto indexNode : _indexNodes) { + indexNode->setColor(indexNodesColor); + } +} + +void PageViewIndicator::setIndexNodesScale(float indexNodesScale) +{ + if(_indexNodesScale == indexNodesScale) + { + return; + } + _indexNodesScale = indexNodesScale; + + _currentIndexNode->setScale(indexNodesScale); + for(auto indexNode : _indexNodes) { + indexNode->setScale(_indexNodesScale); + } + + rearrange(); +} + +void PageViewIndicator::setIndexNodesTexture(const std::string& texName, Widget::TextureResType texType) +{ + _useDefaultTexture = false; + _indexNodesTextureFile = texName; + _indexNodesTexType = texType; + + switch (texType) + { + case Widget::TextureResType::LOCAL: + _currentIndexNode->setTexture(texName); + for(auto indexNode : _indexNodes) { + indexNode->setTexture(texName); + } + break; + case Widget::TextureResType::PLIST: + _currentIndexNode->setSpriteFrame(texName); + for(auto indexNode : _indexNodes) { + indexNode->setSpriteFrame(texName); + } + break; + default: + break; + } + + rearrange(); +} + void PageViewIndicator::increaseNumberOfPages() { - Sprite* indexNode = utils::createSpriteFromBase64(CIRCLE_IMAGE); + Sprite* indexNode; + + if(_useDefaultTexture) + { + indexNode = utils::createSpriteFromBase64(CIRCLE_IMAGE); + } + else + { + switch (_indexNodesTexType) + { + case Widget::TextureResType::LOCAL: + indexNode = Sprite::create(_indexNodesTextureFile); + break; + case Widget::TextureResType::PLIST: + indexNode = Sprite::createWithSpriteFrameName(_indexNodesTextureFile); + break; + default: + break; + } + } + + indexNode->setColor(_indexNodesColor); + indexNode->setScale(_indexNodesScale); // indexNode->setOpacity(255 * 0.3f); addProtectedChild(indexNode); _indexNodes.pushBack(indexNode); diff --git a/cocos/ui/UIPageViewIndicator.h b/cocos/ui/UIPageViewIndicator.h index 1545b91ca2f9..2e20938bc7b3 100644 --- a/cocos/ui/UIPageViewIndicator.h +++ b/cocos/ui/UIPageViewIndicator.h @@ -26,6 +26,7 @@ THE SOFTWARE. #define __UIPAGEVIEWINDICATOR_H__ #include "ui/UIPageView.h" +#include "2d/CCSprite.h" NS_CC_BEGIN /** @@ -56,7 +57,19 @@ class PageViewIndicator : public ProtectedNode float getSpaceBetweenIndexNodes() const { return _spaceBetweenIndexNodes; } void setSelectedIndexColor(const Color3B& color) { _currentIndexNode->setColor(color); } const Color3B& getSelectedIndexColor() const { return _currentIndexNode->getColor(); } - + void setIndexNodesColor(const Color3B& indexNodesColor); + const Color3B& getIndexNodesColor() const { return _indexNodesColor; } + void setIndexNodesScale(float indexNodesScale); + float getIndexNodesScale() const { return _indexNodesScale; } + + /** + * Sets texture for index nodes. + * + * @param fileName File name of texture. + * @param resType @see TextureResType . + */ + void setIndexNodesTexture(const std::string& texName,Widget::TextureResType texType = Widget::TextureResType::LOCAL); + protected: bool init() override; void increaseNumberOfPages(); @@ -64,10 +77,15 @@ class PageViewIndicator : public ProtectedNode void rearrange(); PageView::Direction _direction; - Vector _indexNodes; - Node* _currentIndexNode; + Vector _indexNodes; + Sprite* _currentIndexNode; float _spaceBetweenIndexNodes; - + float _indexNodesScale; + Color3B _indexNodesColor; + + bool _useDefaultTexture; + std::string _indexNodesTextureFile; + Widget::TextureResType _indexNodesTexType; }; } diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index 44ead9a89d29..7d213a43053a 100644 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -1570,7 +1570,7 @@ int RichText::findSplitPositionForChar(cocos2d::Label* label, const std::string& leftLength--; break; } - else if (stringLength <= leftLength) { + else if (static_cast(stringLength) <= leftLength) { break; } } @@ -1691,7 +1691,7 @@ void RichText::handleTextRenderer(const std::string& text, const std::string& fo } } -void RichText::handleImageRenderer(const std::string& filePath, const Color3B &color, GLubyte opacity, int width, int height, const std::string url) +void RichText::handleImageRenderer(const std::string& filePath, const Color3B &color, GLubyte opacity, int width, int height, const std::string& url) { Sprite* imageRenderer = Sprite::create(filePath); if (imageRenderer) diff --git a/cocos/ui/UIRichText.h b/cocos/ui/UIRichText.h index 0062993889c5..539d38cb860a 100644 --- a/cocos/ui/UIRichText.h +++ b/cocos/ui/UIRichText.h @@ -553,7 +553,7 @@ class CC_GUI_DLL RichText : public Widget const Color3B& outlineColor = Color3B::WHITE, int outlineSize = -1, const Color3B& shadowColor = Color3B::BLACK, const cocos2d::Size& shadowOffset = Size(2.0, -2.0), int shadowBlurRadius = 0, const Color3B& glowColor = Color3B::WHITE); - void handleImageRenderer(const std::string& fileParh, const Color3B& color, GLubyte opacity, int width, int height, const std::string url); + void handleImageRenderer(const std::string& fileParh, const Color3B& color, GLubyte opacity, int width, int height, const std::string& url); void handleCustomRenderer(Node* renderer); void formarRenderers(); void addNewLine(); diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 41e70471cb3b..8ec0ce24f94a 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -87,11 +87,11 @@ namespace ui { bool ret = false; do { Texture2D* texture = spriteFrame->getTexture(); - CCASSERT(texture != NULL, "CCTexture must be not nil"); + CCASSERT(texture != nullptr, "Texture2D must be not null"); if(texture == nullptr) break; Sprite *sprite = Sprite::createWithSpriteFrame(spriteFrame); - CCASSERT(sprite != NULL, "sprite must be not nil"); + CCASSERT(sprite != nullptr, "Sprite must be not null"); if(sprite == nullptr) break; ret = this->init(sprite, @@ -106,7 +106,7 @@ namespace ui { } bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame) { - CCASSERT(spriteFrame != NULL, "Invalid spriteFrame for sprite"); + CCASSERT(spriteFrame != nullptr, "Invalid spriteFrame for sprite"); bool pReturn = this->initWithSpriteFrame(spriteFrame, Rect::ZERO); return pReturn; } @@ -137,7 +137,7 @@ namespace ui { bool Scale9Sprite::init() { - return this->init(NULL, Rect::ZERO, Rect::ZERO); + return this->init(nullptr, Rect::ZERO, Rect::ZERO); } bool Scale9Sprite::init(Sprite* sprite, const Rect& rect, const Rect& capInsets) @@ -236,7 +236,7 @@ namespace ui { return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } Scale9Sprite* Scale9Sprite::create(const std::string& file, @@ -250,7 +250,7 @@ namespace ui { return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } @@ -263,7 +263,7 @@ namespace ui { return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } @@ -278,7 +278,7 @@ namespace ui { return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } @@ -291,7 +291,7 @@ namespace ui { return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } @@ -305,7 +305,7 @@ namespace ui { return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) @@ -317,7 +317,7 @@ namespace ui { return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } @@ -331,7 +331,7 @@ namespace ui { return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName) @@ -345,8 +345,7 @@ namespace ui { CC_SAFE_DELETE(pReturn); log("Could not allocate Scale9Sprite()"); - return NULL; - + return nullptr; } void Scale9Sprite::cleanupSlicedSprites() @@ -552,7 +551,9 @@ namespace ui { auto vertices = this->calculateVertices(capInsets, originalSize, offsets); auto triangles = this->calculateTriangles(uv, vertices); - _scale9Image->getPolygonInfo().setTriangles(triangles); + auto polyInfo = _scale9Image->getPolygonInfo(); + polyInfo.setTriangles(triangles); + _scale9Image->setPolygonInfo(polyInfo); } } @@ -582,7 +583,7 @@ namespace ui { return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } Scale9Sprite::State Scale9Sprite::getState()const diff --git a/cocos/ui/UIScrollViewBar.cpp b/cocos/ui/UIScrollViewBar.cpp index 96c2c744d4bf..fbbeb246e5c4 100644 --- a/cocos/ui/UIScrollViewBar.cpp +++ b/cocos/ui/UIScrollViewBar.cpp @@ -34,6 +34,9 @@ namespace ui { static const char* HALF_CIRCLE_IMAGE = "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAGCAMAAADAMI+zAAAAJ1BMVEX///////////////////////////////////////////////////9Ruv0SAAAADHRSTlMABgcbbW7Hz9Dz+PmlcJP5AAAAMElEQVR4AUXHwQ2AQAhFwYcLH1H6r1djzDK3ASxUpTBeK/uTCyz7dx54b44m4p5cD1MwAooEJyk3AAAAAElFTkSuQmCC"; static const char* BODY_IMAGE_1_PIXEL_HEIGHT = "iVBORw0KGgoAAAANSUhEUgAAAAwAAAABCAMAAADdNb8LAAAAA1BMVEX///+nxBvIAAAACklEQVR4AWNABgAADQABYc2cpAAAAABJRU5ErkJggg=="; +static const char* HALF_CIRCLE_IMAGE_KEY = "/__halfCircleImage"; +static const char* BODY_IMAGE_1_PIXEL_HEIGHT_KEY = "/__bodyImage"; + static const Color3B DEFAULT_COLOR(52, 65, 87); static const float DEFAULT_MARGIN = 20; static const float DEFAULT_AUTO_HIDE_TIME = 0.2f; @@ -82,7 +85,7 @@ bool ScrollViewBar::init() return false; } - _upperHalfCircle = utils::createSpriteFromBase64(HALF_CIRCLE_IMAGE); + _upperHalfCircle = utils::createSpriteFromBase64Cached(HALF_CIRCLE_IMAGE, HALF_CIRCLE_IMAGE_KEY); _upperHalfCircle->setAnchorPoint(Vec2::ANCHOR_MIDDLE_BOTTOM); addProtectedChild(_upperHalfCircle); @@ -91,7 +94,7 @@ bool ScrollViewBar::init() _lowerHalfCircle->setAnchorPoint(Vec2::ANCHOR_MIDDLE_BOTTOM); addProtectedChild(_lowerHalfCircle); - _body = utils::createSpriteFromBase64(BODY_IMAGE_1_PIXEL_HEIGHT); + _body = utils::createSpriteFromBase64Cached(BODY_IMAGE_1_PIXEL_HEIGHT, BODY_IMAGE_1_PIXEL_HEIGHT_KEY); _body->setAnchorPoint(Vec2::ANCHOR_MIDDLE_BOTTOM); addProtectedChild(_body); diff --git a/cocos/ui/UITabControl.cpp b/cocos/ui/UITabControl.cpp index 3a41f17d0ece..f6377fc87bfe 100644 --- a/cocos/ui/UITabControl.cpp +++ b/cocos/ui/UITabControl.cpp @@ -479,7 +479,7 @@ namespace ui TabHeader* tabcell = new (std::nothrow) TabHeader(); if (tabcell != nullptr && tabcell->init()) { - tabcell->_frontCrossRenderer->setVisible(false); // _isSelected == fales + tabcell->_frontCrossRenderer->setVisible(false); // _isSelected == false tabcell->_anchorPoint = Vec2(.5f, 0); tabcell->autorelease(); return tabcell; diff --git a/cocos/ui/UITextField.cpp b/cocos/ui/UITextField.cpp index 97b66f17c6d6..2c158c2c6215 100644 --- a/cocos/ui/UITextField.cpp +++ b/cocos/ui/UITextField.cpp @@ -86,7 +86,7 @@ bool UICCTextField::onTextFieldInsertText(TextFieldTTF *pSender, const char *tex setInsertText(true); if (_maxLengthEnabled) { - if (TextFieldTTF::getCharCount() >= _maxLength) + if (static_cast(TextFieldTTF::getCharCount()) >= _maxLength) { return true; } @@ -402,16 +402,15 @@ void TextField::setString(const std::string& text) } } - const char* content = strText.c_str(); if (isPasswordEnabled()) { - _textFieldRenderer->setPasswordText(content); + _textFieldRenderer->setPasswordText(strText); _textFieldRenderer->setString(""); - _textFieldRenderer->insertText(content, strlen(content)); + _textFieldRenderer->insertText(strText.c_str(), strText.size()); } else { - _textFieldRenderer->setString(content); + _textFieldRenderer->setString(strText); } _textFieldRendererAdaptDirty = true; updateContentSizeWithTextureSize(_textFieldRenderer->getContentSize()); diff --git a/cocos/ui/UIVideoPlayer-android.cpp b/cocos/ui/UIVideoPlayer-android.cpp index d0dfb471fc78..c3b473d9e43a 100644 --- a/cocos/ui/UIVideoPlayer-android.cpp +++ b/cocos/ui/UIVideoPlayer-android.cpp @@ -234,10 +234,25 @@ void VideoPlayer::setVisible(bool visible) { cocos2d::ui::Widget::setVisible(visible); - if (! _videoURL.empty()) + if (!visible || isRunning()) { JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoVisible", _videoPlayerIndex, visible); - } + } +} + +void VideoPlayer::onEnter() +{ + Widget::onEnter(); + if (isVisible() && !_videoURL.empty()) + { + JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoVisible", _videoPlayerIndex, true); + } +} + +void VideoPlayer::onExit() +{ + Widget::onExit(); + JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoVisible", _videoPlayerIndex, false); } void VideoPlayer::addEventListener(const VideoPlayer::ccVideoPlayerCallback& callback) diff --git a/cocos/ui/UIVideoPlayer-ios.mm b/cocos/ui/UIVideoPlayer-ios.mm index 76f1d7dd5f18..3cbd28b96fa0 100644 --- a/cocos/ui/UIVideoPlayer-ios.mm +++ b/cocos/ui/UIVideoPlayer-ios.mm @@ -46,10 +46,10 @@ - (void) pause; - (void) resume; - (void) stop; - (void) seekTo:(float) sec; -- (void) setVisible:(bool) visible; -- (void) setKeepRatioEnabled:(bool) enabled; -- (void) setFullScreenEnabled:(bool) enabled; -- (bool) isFullScreenEnabled; +- (void) setVisible:(BOOL) visible; +- (void) setKeepRatioEnabled:(BOOL) enabled; +- (void) setFullScreenEnabled:(BOOL) enabled; +- (BOOL) isFullScreenEnabled; -(id) init:(void*) videoPlayer; @@ -66,7 +66,7 @@ @implementation UIVideoViewWrapperIos int _width; int _height; bool _keepRatioEnabled; - + VideoPlayer* _videoPlayer; } @@ -77,7 +77,7 @@ -(id)init:(void*)videoPlayer _videoPlayer = (VideoPlayer*)videoPlayer; _keepRatioEnabled = false; } - + return self; } @@ -86,7 +86,7 @@ -(void) dealloc if (self.moviePlayer != nullptr) { [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayer]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackStateDidChangeNotification object:self.moviePlayer]; - + [self.moviePlayer stop]; [self.moviePlayer.view removeFromSuperview]; self.moviePlayer = nullptr; @@ -106,19 +106,19 @@ -(void) setFrame:(int)left :(int)top :(int)width :(int)height } } --(void) setFullScreenEnabled:(bool) enabled +-(void) setFullScreenEnabled:(BOOL) enabled { if (self.moviePlayer != nullptr) { [self.moviePlayer setFullscreen:enabled animated:(true)]; } } --(bool) isFullScreenEnabled +-(BOOL) isFullScreenEnabled { if (self.moviePlayer != nullptr) { return [self.moviePlayer isFullscreen]; } - + return false; } @@ -127,12 +127,12 @@ -(void) setURL:(int)videoSource :(std::string &)videoUrl if (self.moviePlayer != nullptr) { [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayer]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackStateDidChangeNotification object:self.moviePlayer]; - + [self.moviePlayer stop]; [self.moviePlayer.view removeFromSuperview]; self.moviePlayer = nullptr; } - + if (videoSource == 1) { self.moviePlayer = [[[MPMoviePlayerController alloc] init] autorelease]; self.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming; @@ -144,24 +144,24 @@ -(void) setURL:(int)videoSource :(std::string &)videoUrl self.moviePlayer.allowsAirPlay = false; self.moviePlayer.controlStyle = MPMovieControlStyleEmbedded; self.moviePlayer.view.userInteractionEnabled = true; - + auto clearColor = [UIColor clearColor]; self.moviePlayer.backgroundView.backgroundColor = clearColor; self.moviePlayer.view.backgroundColor = clearColor; for (UIView * subView in self.moviePlayer.view.subviews) { subView.backgroundColor = clearColor; } - + if (_keepRatioEnabled) { self.moviePlayer.scalingMode = MPMovieScalingModeAspectFit; } else { self.moviePlayer.scalingMode = MPMovieScalingModeFill; } - + auto view = cocos2d::Director::getInstance()->getOpenGLView(); auto eaglview = (CCEAGLView *) view->getEAGLView(); [eaglview addSubview:self.moviePlayer.view]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayer]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playStateChange) name:MPMoviePlayerPlaybackStateDidChangeNotification object:self.moviePlayer]; } @@ -208,14 +208,14 @@ -(void) seekTo:(float)sec } } --(void) setVisible:(bool)visible +-(void) setVisible:(BOOL)visible { if (self.moviePlayer != NULL) { [self.moviePlayer.view setHidden:!visible]; } } --(void) setKeepRatioEnabled:(bool)enabled +-(void) setKeepRatioEnabled:(BOOL)enabled { _keepRatioEnabled = enabled; if (self.moviePlayer != NULL) { @@ -303,27 +303,27 @@ -(void) stop void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags) { cocos2d::ui::Widget::draw(renderer,transform,flags); - + if (flags & FLAGS_TRANSFORM_DIRTY) { auto directorInstance = Director::getInstance(); auto glView = directorInstance->getOpenGLView(); auto frameSize = glView->getFrameSize(); auto scaleFactor = [static_cast(glView->getEAGLView()) contentScaleFactor]; - + auto winSize = directorInstance->getWinSize(); - + auto leftBottom = convertToWorldSpace(Vec2::ZERO); auto rightTop = convertToWorldSpace(Vec2(_contentSize.width,_contentSize.height)); - + auto uiLeft = (frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX()) / scaleFactor; auto uiTop = (frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY()) / scaleFactor; - + [((UIVideoViewWrapperIos*)_videoView) setFrame :uiLeft :uiTop :(rightTop.x - leftBottom.x) * glView->getScaleX() / scaleFactor :( (rightTop.y - leftBottom.y) * glView->getScaleY()/scaleFactor)]; } - + #if CC_VIDEOPLAYER_DEBUG_DRAW _debugDrawNode->clear(); auto size = getContentSize(); @@ -405,13 +405,32 @@ -(void) stop void VideoPlayer::setVisible(bool visible) { cocos2d::ui::Widget::setVisible(visible); - - if (! _videoURL.empty()) + + if (!visible) + { + [((UIVideoViewWrapperIos*)_videoView) setVisible:NO]; + } + else if(isRunning()) + { + [((UIVideoViewWrapperIos*)_videoView) setVisible:YES]; + } +} + +void VideoPlayer::onEnter() +{ + Widget::onEnter(); + if (isVisible()) { - [((UIVideoViewWrapperIos*)_videoView) setVisible:visible]; + [((UIVideoViewWrapperIos*)_videoView) setVisible: YES]; } } +void VideoPlayer::onExit() +{ + Widget::onExit(); + [((UIVideoViewWrapperIos*)_videoView) setVisible: NO]; +} + void VideoPlayer::addEventListener(const VideoPlayer::ccVideoPlayerCallback& callback) { _eventCallback = callback; @@ -424,7 +443,7 @@ -(void) stop } else { _isPlaying = false; } - + if (_eventCallback) { _eventCallback(this, (VideoPlayer::EventType)event); diff --git a/cocos/ui/UIVideoPlayer-tizen.cpp b/cocos/ui/UIVideoPlayer-tizen.cpp new file mode 100644 index 000000000000..86f6f17aebdc --- /dev/null +++ b/cocos/ui/UIVideoPlayer-tizen.cpp @@ -0,0 +1,449 @@ +/**************************************************************************** + 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 "ui/UIVideoPlayer.h" + + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) + +#include +#include +#include "base/CCDirector.h" +#include "base/CCEventListenerKeyboard.h" + +#include "player.h" +#include "platform/tizen/CCApplication-tizen.h" + +#include +#include +#include + +//----------------------------------------------------------------------------------------------------------- +USING_NS_CC; + +#define QUIT_FULLSCREEN 1000 + +using namespace cocos2d::experimental::ui; + +class _VideoPlayerTizen +{ +public: + _VideoPlayerTizen(VideoPlayer* videoPlayer) + { + _videoPlayer = videoPlayer; + + Application* app = Application::getInstance(); + _layout = elm_layout_add(app->_win); + Evas *evas = evas_object_evas_get(_layout); + _image = evas_object_image_filled_add(evas); + evas_object_show(_image); + player_create(&_player); + + evas_object_event_callback_add(_image, EVAS_CALLBACK_MOUSE_UP, _VideoPlayerTizen::mouse_up_cb, this); + eext_object_event_callback_add(app->_win, EEXT_CALLBACK_BACK, _VideoPlayerTizen::win_back_cb, this); + } + + virtual ~_VideoPlayerTizen() + { + Application* app = Application::getInstance(); + eext_object_event_callback_del(app->_win, EEXT_CALLBACK_BACK, _VideoPlayerTizen::win_back_cb); + evas_object_event_callback_del(_image, EVAS_CALLBACK_MOUSE_UP, _VideoPlayerTizen::mouse_up_cb); + + player_stop(_player); + player_unprepare(_player); + player_destroy(_player); + evas_object_del(_image); + evas_object_del(_layout); + } + + static void mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) + { + _VideoPlayerTizen* videoPlayerTizen = (_VideoPlayerTizen*)data; + if (videoPlayerTizen->_videoPlayer->isPlaying()) + { + videoPlayerTizen->_videoPlayer->pause(); + } + else + { + videoPlayerTizen->_videoPlayer->resume(); + } + } + + static void win_back_cb(void *data, Evas_Object *obj, void *event_info) { + _VideoPlayerTizen* videoPlayerTizen = (_VideoPlayerTizen*)data; + videoPlayerTizen->_videoPlayer->onPlayEvent(QUIT_FULLSCREEN); + evas_object_resize(videoPlayerTizen->_image, videoPlayerTizen->_width, videoPlayerTizen->_height); + evas_object_move(videoPlayerTizen->_image, videoPlayerTizen->_x, videoPlayerTizen->_y); + } + + void setRectangle(Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height) + { + _x = x; + _y = y; + _width = width; + _height = height; + } + + player_h _player; + Evas_Object* _image; + Evas_Object* _layout; + VideoPlayer* _videoPlayer; + Evas_Coord _x; + Evas_Coord _y; + Evas_Coord _width; + Evas_Coord _height; +}; + +VideoPlayer::VideoPlayer() +: _videoPlayerIndex(-1) +, _eventCallback(nullptr) +, _fullScreenEnabled(false) +, _fullScreenDirty(false) +, _keepAspectRatioEnabled(false) +{ + _videoView = (void*) new (std::nothrow) _VideoPlayerTizen(this); + +#if CC_VIDEOPLAYER_DEBUG_DRAW + _debugDrawNode = DrawNode::create(); + addchild(_debugDrawNode); +#endif +} + +VideoPlayer::~VideoPlayer() +{ + delete (_VideoPlayerTizen*)_videoView; +} + +void VideoPlayer::setFileName(const std::string& fileName) +{ + _videoURL = fileName; + _videoSource = VideoPlayer::Source::FILENAME; + + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + + const char* uri = _videoURL.c_str(); + std::string fullpath; + fullpath.append(app_get_resource_path()); + fullpath.append(fileName.c_str()); + player_set_uri(impl->_player, fullpath.c_str()); +} + +void VideoPlayer::setURL(const std::string& videoUrl) +{ + _videoURL = videoUrl; + _videoSource = VideoPlayer::Source::URL; + + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + player_set_uri(impl->_player, videoUrl.c_str()); +} + +void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags) +{ + cocos2d::ui::Widget::draw(renderer,transform,flags); + + if (flags & FLAGS_TRANSFORM_DIRTY) + { + auto directorInstance = Director::getInstance(); + auto glView = directorInstance->getOpenGLView(); + auto frameSize = glView->getFrameSize(); + + auto winSize = directorInstance->getWinSize(); + + auto leftBottom = convertToWorldSpace(Point::ZERO); + auto rightTop = convertToWorldSpace(Point(_contentSize.width,_contentSize.height)); + + auto uiLeft = frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX(); + auto uiTop = frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY(); + + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + Evas_Coord width = (rightTop.x - leftBottom.x) * glView->getScaleX(); + Evas_Coord height = (rightTop.y - leftBottom.y) * glView->getScaleY(); + Evas_Coord x = leftBottom.x * glView->getScaleX(); + Evas_Coord y = leftBottom.y * glView->getScaleY(); + + impl->setRectangle(x, y, width, height); + evas_object_resize(impl->_image, width, height); + evas_object_move(impl->_image, uiLeft, uiTop); + } + +#if CC_VIDEOPLAYER_DEBUG_DRAW + _debugDrawNode->clear(); + auto size = getContentSize(); + Point vertices[4]= + { + Point::ZERO, + Point(size.width, 0), + Point(size.width, size.height), + Point(0, size.height) + }; + _debugdrawNode->drawPoly(vertices, 4, true, Color4F(1.0, 1.0, 1.0, 1.0)); +#endif +} + +void VideoPlayer::setFullScreenEnabled(bool enabled) +{ + if (_fullScreenEnabled != enabled) + { + _fullScreenEnabled = enabled; + + auto directorInstance = Director::getInstance(); + auto glView = directorInstance->getOpenGLView(); + auto frameSize = glView->getFrameSize(); + + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + evas_object_resize(impl->_image, frameSize.width, frameSize.height); + evas_object_move(impl->_image, 0, 0); + } +} + +bool VideoPlayer::isFullScreenEnabled()const +{ + return _fullScreenEnabled; +} + +void VideoPlayer::setKeepAspectRatioEnabled(bool enable) +{ + if (_keepAspectRatioEnabled != enable) + { + _keepAspectRatioEnabled = enable; + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + if (_keepAspectRatioEnabled == enable) + { + player_set_display_mode(impl->_player, PLAYER_DISPLAY_MODE_LETTER_BOX); + } + else + { + player_set_display_mode(impl->_player, PLAYER_DISPLAY_MODE_FULL_SCREEN); + } + } +} + +#if CC_VIDEOPLAYER_DEBUG_DRAW +void VideoPlayer::drawDebugData() +{ + Director* director = Director::getInstance(); + CCASSERT(nullptr != director, "Director is null when seting matrix stack"); + + director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); + director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); + + auto size = getContentSize(); + + Point vertices[4]= + { + Point::ZERO, + Point(size.width, 0), + Point(size.width, size.height), + Point(0, size.height) + }; + + DrawPrimitives::drawPoly(vertices, 4, true); + + director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); +} +#endif + +static void _player_completed_cb(void *user_data) +{ + VideoPlayer* player = (VideoPlayer*)user_data; + player->onPlayEvent((int)VideoPlayer::EventType::COMPLETED); +} + +static void _player_interrupted_cb(player_interrupted_code_e code, void *user_data) +{ + VideoPlayer* player = (VideoPlayer*)user_data; + player->onPlayEvent((int)VideoPlayer::EventType::PAUSED); +} + +static void _player_video_frame_decoded_cb(unsigned char *data, int width, int height, unsigned int size, void *user_data) +{ + VideoPlayer* player = (VideoPlayer*)user_data; + player->onPlayEvent((int)VideoPlayer::EventType::PLAYING); +} + +void VideoPlayer::play() +{ + if (! _videoURL.empty()) + { + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + player_set_sound_type(impl->_player, SOUND_TYPE_MEDIA); + player_set_display(impl->_player, PLAYER_DISPLAY_TYPE_EVAS, GET_DISPLAY(impl->_image)); + + if (_keepAspectRatioEnabled) + { + player_set_display_mode(impl->_player, PLAYER_DISPLAY_MODE_LETTER_BOX); + } + else + { + player_set_display_mode(impl->_player, PLAYER_DISPLAY_MODE_FULL_SCREEN); + } + + player_set_completed_cb(impl->_player, _player_completed_cb, this); + player_set_interrupted_cb(impl->_player, _player_interrupted_cb, this); + + player_prepare(impl->_player); + int ret = player_start(impl->_player); + if (ret == PLAYER_ERROR_NONE) + { + this->onPlayEvent((int)VideoPlayer::EventType::PLAYING); + } + this->setVisible(true); + } +} + +void VideoPlayer::pause() +{ + if (! _videoURL.empty()) + { + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + int ret = player_pause(impl->_player); + if (ret == PLAYER_ERROR_NONE) + { + this->onPlayEvent((int)VideoPlayer::EventType::PAUSED); + } + } +} + +void VideoPlayer::resume() +{ + if (! _videoURL.empty()) + { + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + int ret = player_start(impl->_player); + if (ret == PLAYER_ERROR_NONE) + { + this->onPlayEvent((int)VideoPlayer::EventType::PLAYING); + } + } +} + +void VideoPlayer::stop() +{ + if (! _videoURL.empty()) + { + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + int ret = player_stop(impl->_player); + if (ret == PLAYER_ERROR_NONE) + { + this->onPlayEvent((int)VideoPlayer::EventType::STOPPED); + } + } +} + +void VideoPlayer::seekTo(float sec) +{ + if (! _videoURL.empty()) + { + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + player_set_play_position(impl->_player, sec, false, NULL, NULL); + } +} + +bool VideoPlayer::isPlaying() const +{ + return _isPlaying; +} + +void VideoPlayer::onEnter() +{ + Widget::onEnter(); + if (isVisible()) + { + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + player_set_display_visible(impl->_player, true); + } +} + +void VideoPlayer::onExit() +{ + Widget::onExit(); + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + player_set_display_visible(impl->_player, false); +} + +void VideoPlayer::setVisible(bool visible) +{ + cocos2d::ui::Widget::setVisible(visible); + _VideoPlayerTizen* impl = (_VideoPlayerTizen*)_videoView; + + if (!visible) + { + player_set_display_visible(impl->_player, false); + } + else if(isRunning()) + { + player_set_display_visible(impl->_player, true); + } +} + +void VideoPlayer::addEventListener(const VideoPlayer::ccVideoPlayerCallback& callback) +{ + _eventCallback = callback; +} + +void VideoPlayer::onPlayEvent(int event) +{ + if (event == QUIT_FULLSCREEN) + { + _fullScreenEnabled = false; + } + else + { + VideoPlayer::EventType videoEvent = (VideoPlayer::EventType)event; + if (videoEvent == VideoPlayer::EventType::PLAYING) { + _isPlaying = true; + } else { + _isPlaying = false; + } + + if (_eventCallback) + { + _eventCallback(this,videoEvent); + } + } +} + +cocos2d::ui::Widget* VideoPlayer::createCloneInstance() +{ + return VideoPlayer::create(); +} + +void VideoPlayer::copySpecialProperties(Widget *widget) +{ + VideoPlayer* videoPlayer = dynamic_cast(widget); + if (videoPlayer) + { + _isPlaying = videoPlayer->_isPlaying; + _fullScreenEnabled = videoPlayer->_fullScreenEnabled; + _fullScreenDirty = videoPlayer->_fullScreenDirty; + _videoURL = videoPlayer->_videoURL; + _keepAspectRatioEnabled = videoPlayer->_keepAspectRatioEnabled; + _videoSource = videoPlayer->_videoSource; + _videoPlayerIndex = videoPlayer->_videoPlayerIndex; + _eventCallback = videoPlayer->_eventCallback; + _videoView = videoPlayer->_videoView; + } +} + +#endif diff --git a/cocos/ui/UIVideoPlayer.h b/cocos/ui/UIVideoPlayer.h index 16016fb118de..0aabb26bf4ce 100644 --- a/cocos/ui/UIVideoPlayer.h +++ b/cocos/ui/UIVideoPlayer.h @@ -25,7 +25,7 @@ #ifndef __COCOS2D_UI_VIDEOWEIGTH_H_ #define __COCOS2D_UI_VIDEOWEIGTH_H_ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_PLATFORM_OS_TVOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) && !defined(CC_PLATFORM_OS_TVOS) #include "ui/UIWidget.h" @@ -172,6 +172,8 @@ namespace experimental{ virtual void onPlayEvent(int event); virtual void setVisible(bool visible) override; virtual void draw(Renderer *renderer, const Mat4& transform, uint32_t flags) override; + virtual void onEnter() override; + virtual void onExit() override; protected: virtual cocos2d::ui::Widget* createCloneInstance() override; diff --git a/cocos/ui/UIWebView-inl.h b/cocos/ui/UIWebView-inl.h index 3c265e7d1023..fc7e33e860e3 100644 --- a/cocos/ui/UIWebView-inl.h +++ b/cocos/ui/UIWebView-inl.h @@ -1,18 +1,18 @@ /**************************************************************************** Copyright (c) 2014-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 @@ -28,11 +28,12 @@ #include "platform/CCGLView.h" #include "base/CCDirector.h" #include "platform/CCFileUtils.h" +#include "ui/UIWebViewImpl-tizen.h" NS_CC_BEGIN namespace experimental{ namespace ui{ - + WebView::WebView() : _impl(new WebViewImpl(this)), _onJSCallback(nullptr), @@ -41,12 +42,12 @@ namespace experimental{ _onDidFailLoading(nullptr) { } - + WebView::~WebView() { CC_SAFE_DELETE(_impl); } - + WebView *WebView::create() { auto webView = new(std::nothrow) WebView(); @@ -58,12 +59,12 @@ namespace experimental{ CC_SAFE_DELETE(webView); return nullptr; } - + void WebView::setJavascriptInterfaceScheme(const std::string &scheme) { _impl->setJavascriptInterfaceScheme(scheme); } - + void WebView::loadData(const cocos2d::Data &data, const std::string &MIMEType, const std::string &encoding, @@ -71,72 +72,95 @@ namespace experimental{ { _impl->loadData(data, MIMEType, encoding, baseURL); } - + void WebView::loadHTMLString(const std::string &string, const std::string &baseURL) { _impl->loadHTMLString(string, baseURL); } - + void WebView::loadURL(const std::string &url) { _impl->loadURL(url); } - + void WebView::loadFile(const std::string &fileName) { _impl->loadFile(fileName); } - + void WebView::stopLoading() { _impl->stopLoading(); } - + void WebView::reload() { _impl->reload(); } - + bool WebView::canGoBack() { return _impl->canGoBack(); } - + bool WebView::canGoForward() { return _impl->canGoForward(); } - + void WebView::goBack() { _impl->goBack(); } - + void WebView::goForward() { _impl->goForward(); } - + void WebView::evaluateJS(const std::string &js) { _impl->evaluateJS(js); } - + void WebView::setScalesPageToFit(bool const scalesPageToFit) { _impl->setScalesPageToFit(scalesPageToFit); } - + void WebView::draw(cocos2d::Renderer *renderer, cocos2d::Mat4 const &transform, uint32_t flags) { cocos2d::ui::Widget::draw(renderer, transform, flags); _impl->draw(renderer, transform, flags); } - + void WebView::setVisible(bool visible) { Node::setVisible(visible); - _impl->setVisible(visible); + if (!visible || isRunning()) + { + _impl->setVisible(visible); + } + } + + void WebView::onEnter() + { + Widget::onEnter(); + if(isVisible()) + { + _impl->setVisible(true); + } + } + + void WebView::onExit() + { + Widget::onExit(); + _impl->setVisible(false); + } + + void WebView::setBounces(bool bounces) + { + _impl->setBounces(bounces); } cocos2d::ui::Widget* WebView::createCloneInstance() @@ -156,47 +180,47 @@ namespace experimental{ this->_onJSCallback = webView->_onJSCallback; } } - + void WebView::setOnDidFailLoading(const ccWebViewCallback &callback) { _onDidFailLoading = callback; } - + void WebView::setOnDidFinishLoading(const ccWebViewCallback &callback) { _onDidFinishLoading = callback; } - + void WebView::setOnShouldStartLoading(const std::function &callback) { _onShouldStartLoading = callback; } - + void WebView::setOnJSCallback(const ccWebViewCallback &callback) { _onJSCallback = callback; } - + std::function WebView::getOnShouldStartLoading()const { return _onShouldStartLoading; } - + WebView::ccWebViewCallback WebView::getOnDidFailLoading()const { return _onDidFailLoading; } - + WebView::ccWebViewCallback WebView::getOnDidFinishLoading()const { return _onDidFinishLoading; } - + WebView::ccWebViewCallback WebView::getOnJSCallback()const { return _onJSCallback; } - + } // namespace ui } // namespace experimental } //namespace cocos2d diff --git a/cocos/ui/UIWebView.cpp b/cocos/ui/UIWebView.cpp index 62657952844a..af795785e058 100644 --- a/cocos/ui/UIWebView.cpp +++ b/cocos/ui/UIWebView.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) #include "ui/UIWebViewImpl-android.h" #include "ui/UIWebView-inl.h" diff --git a/cocos/ui/UIWebView.h b/cocos/ui/UIWebView.h index 50b7d67b61a4..42c422823f4b 100644 --- a/cocos/ui/UIWebView.h +++ b/cocos/ui/UIWebView.h @@ -27,7 +27,8 @@ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_PLATFORM_OS_TVOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) && !defined(CC_PLATFORM_OS_TVOS) + #include "ui/UIWidget.h" @@ -197,12 +198,19 @@ class CC_GUI_DLL WebView : public cocos2d::ui::Widget { */ ccWebViewCallback getOnJSCallback()const; + /** + * Set whether the webview bounces at end of scroll of WebView. + */ + void setBounces(bool bounce); + virtual void draw(cocos2d::Renderer *renderer, cocos2d::Mat4 const &transform, uint32_t flags) override; /** * Toggle visibility of WebView. */ virtual void setVisible(bool visible) override; + virtual void onEnter() override; + virtual void onExit() override; protected: virtual cocos2d::ui::Widget* createCloneInstance() override; diff --git a/cocos/ui/UIWebViewImpl-android.cpp b/cocos/ui/UIWebViewImpl-android.cpp index 233d607921ed..ad7c8013618e 100644 --- a/cocos/ui/UIWebViewImpl-android.cpp +++ b/cocos/ui/UIWebViewImpl-android.cpp @@ -281,6 +281,10 @@ namespace cocos2d { void WebViewImpl::setVisible(bool visible) { JniHelper::callStaticVoidMethod(className, "setVisible", _viewTag, visible); } + + void WebViewImpl::setBounces(bool bounces) { + // empty function as this was mainly a fix for iOS + } } // namespace ui } // namespace experimental } //namespace cocos2d diff --git a/cocos/ui/UIWebViewImpl-android.h b/cocos/ui/UIWebViewImpl-android.h index 2617618c7b8c..260d50e92628 100644 --- a/cocos/ui/UIWebViewImpl-android.h +++ b/cocos/ui/UIWebViewImpl-android.h @@ -83,6 +83,8 @@ namespace cocos2d { virtual void setVisible(bool visible); + void setBounces(bool bounces); + static bool shouldStartLoading(const int viewTag, const std::string &url); static void didFinishLoading(const int viewTag, const std::string &url); static void didFailLoading(const int viewTag, const std::string &url); diff --git a/cocos/ui/UIWebViewImpl-ios.h b/cocos/ui/UIWebViewImpl-ios.h index 00a993c1591c..4b25792a19ec 100644 --- a/cocos/ui/UIWebViewImpl-ios.h +++ b/cocos/ui/UIWebViewImpl-ios.h @@ -80,6 +80,8 @@ class WebViewImpl { virtual void setVisible(bool visible); + void setBounces(bool bounces); + private: UIWebViewWrapper *_uiWebViewWrapper; WebView *_webView; diff --git a/cocos/ui/UIWebViewImpl-ios.mm b/cocos/ui/UIWebViewImpl-ios.mm index d912919d3101..39a2a950ff6c 100644 --- a/cocos/ui/UIWebViewImpl-ios.mm +++ b/cocos/ui/UIWebViewImpl-ios.mm @@ -38,7 +38,7 @@ of this software and associated documentation files (the "Software"), to deal static std::string getFixedBaseUrl(const std::string& baseUrl) { std::string fixedBaseUrl; - if (baseUrl.empty() || baseUrl.c_str()[0] != '/') { + if (baseUrl.empty() || baseUrl.at(0) != '/') { fixedBaseUrl = [[[NSBundle mainBundle] resourcePath] UTF8String]; fixedBaseUrl += "/"; fixedBaseUrl += baseUrl; @@ -52,7 +52,7 @@ of this software and associated documentation files (the "Software"), to deal fixedBaseUrl.replace(pos, 1, "%20"); } - if (fixedBaseUrl.c_str()[fixedBaseUrl.length() - 1] != '/') { + if (fixedBaseUrl.at(fixedBaseUrl.length() - 1) != '/') { fixedBaseUrl += "/"; } @@ -72,6 +72,8 @@ + (instancetype)webViewWrapper; - (void)setVisible:(bool)visible; +- (void)setBounces:(bool)bounces; + - (void)setFrameWithX:(float)x y:(float)y width:(float)width height:(float)height; - (void)setJavascriptInterfaceScheme:(const std::string &)scheme; @@ -146,6 +148,10 @@ - (void)setVisible:(bool)visible { self.uiWebView.hidden = !visible; } +- (void)setBounces:(bool)bounces { + self.uiWebView.scrollView.bounces = bounces; +} + - (void)setFrameWithX:(float)x y:(float)y width:(float)width height:(float)height { if (!self.uiWebView) {[self setupWebView];} CGRect newFrame = CGRectMake(x, y, width, height); @@ -342,6 +348,10 @@ - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { [_uiWebViewWrapper evaluateJS:js]; } +void WebViewImpl::setBounces(bool bounces) { + [_uiWebViewWrapper setBounces:bounces]; +} + void WebViewImpl::setScalesPageToFit(const bool scalesPageToFit) { [_uiWebViewWrapper setScalesPageToFit:scalesPageToFit]; } diff --git a/cocos/ui/UIWebViewImpl-tizen.cpp b/cocos/ui/UIWebViewImpl-tizen.cpp new file mode 100644 index 000000000000..e730af2c7deb --- /dev/null +++ b/cocos/ui/UIWebViewImpl-tizen.cpp @@ -0,0 +1,166 @@ +/**************************************************************************** + 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. + ****************************************************************************/ + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) + +#include "ui/UIWebViewImpl-tizen.h" + +#include +#include +#include + +#include "platform/tizen/CCApplication-tizen.h" +#include "ui/UIWebView.h" +#include "platform/CCGLView.h" +#include "base/CCDirector.h" +#include "platform/CCFileUtils.h" +#include "EWebKit.h" + +void JScallback(Evas_Object* o, const char* result_value, void* user_data) +{ +} + +namespace cocos2d { + namespace experimental { + namespace ui{ + + WebViewImpl::WebViewImpl(WebView *webView) : _webView(webView) { + Application* app = Application::getInstance(); + Evas *evas = evas_object_evas_get(app->_win); + _ewkView = ewk_view_add(evas); + } + + WebViewImpl::~WebViewImpl() { + evas_object_del(_ewkView); + } + + void WebViewImpl::loadData(const Data &data, const std::string &MIMEType, const std::string &encoding, const std::string &baseURL) { + const char* contents = nullptr; + size_t contents_size = 0; + char* mime_type = (char*)MIMEType.c_str(); + char* encode = (char*)encoding.c_str(); + char* base_uri = (char*)baseURL.c_str(); + ewk_view_contents_set(_ewkView, contents, contents_size, mime_type, encode, base_uri); + } + + void WebViewImpl::loadHTMLString(const std::string &string, const std::string &baseURL) { + + const char* contents = string.c_str(); + size_t contents_size = string.length(); + char* mime_type = (char*)baseURL.c_str(); + char* encoding = nullptr; + char* base_uri = nullptr;//(char*)baseURL.c_str(); + ewk_view_contents_set(_ewkView, contents, contents_size, mime_type, encoding, base_uri); + } + + void WebViewImpl::loadURL(const std::string &url) { + + const char* urlchar = url.c_str(); + ewk_view_url_set(_ewkView, urlchar); + } + + void WebViewImpl::loadFile(const std::string &fileName) { + auto fileUtiles = FileUtils::getInstance(); + auto fileFullPath = fileUtiles->fullPathForFilename(fileName); + auto contentsString = fileUtiles->getStringFromFile(fileFullPath); + loadHTMLString(contentsString, "text/html"); + } + + void WebViewImpl::stopLoading() { + ewk_view_stop(_ewkView); + } + + void WebViewImpl::reload() { + ewk_view_reload(_ewkView); + } + + bool WebViewImpl::canGoBack() { + return ewk_view_back_possible(_ewkView); + } + + bool WebViewImpl::canGoForward() { + return ewk_view_forward_possible(_ewkView); + } + + void WebViewImpl::goBack() { + ewk_view_back(_ewkView); + } + + void WebViewImpl::goForward() { + ewk_view_forward(_ewkView); + } + + void WebViewImpl::setJavascriptInterfaceScheme(const std::string &scheme) { + } + + void WebViewImpl::evaluateJS(const std::string &js) { + const char* script = js.c_str(); + Eina_Bool ret = ewk_view_script_execute(_ewkView, script, JScallback, this); + } + + void WebViewImpl::setScalesPageToFit(const bool scalesPageToFit) { + } + + void WebViewImpl::draw(cocos2d::Renderer *renderer, cocos2d::Mat4 const &transform, int flags) { + if (flags & cocos2d::Node::FLAGS_TRANSFORM_DIRTY) { + auto directorInstance = cocos2d::Director::getInstance(); + auto glView = directorInstance->getOpenGLView(); + auto frameSize = glView->getFrameSize(); + + auto winSize = directorInstance->getWinSize(); + + auto leftBottom = this->_webView->convertToWorldSpace(cocos2d::Point::ZERO); + auto rightTop = this->_webView->convertToWorldSpace(cocos2d::Point(this->_webView->getContentSize().width,this->_webView->getContentSize().height)); + + auto uiLeft = frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX(); + auto uiTop = frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY(); + + Evas_Coord width = (rightTop.x - leftBottom.x) * glView->getScaleX(); + Evas_Coord height = (rightTop.y - leftBottom.y) * glView->getScaleY(); + + evas_object_resize(_ewkView, width, height); + evas_object_move(_ewkView, uiLeft, uiTop); + evas_object_show(_ewkView); + } + } + + void WebViewImpl::setVisible(bool visible) { + if (visible) + { + evas_object_show(_ewkView); + } + else + { + evas_object_hide(_ewkView); + } + } + + void WebViewImpl::setBounces(bool bounces) { + // empty function as this was mainly a fix for iOS + } + } // namespace ui + } // namespace experimental +} //namespace cocos2d + +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) diff --git a/cocos/ui/UIWebViewImpl-tizen.h b/cocos/ui/UIWebViewImpl-tizen.h new file mode 100644 index 000000000000..ae16e050baf8 --- /dev/null +++ b/cocos/ui/UIWebViewImpl-tizen.h @@ -0,0 +1,101 @@ +/**************************************************************************** + 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 __COCOS2D__UI__WEBVIEWIMPL_TIZEN_H_ +#define __COCOS2D__UI__WEBVIEWIMPL_TIZEN_H_ + +#include "platform/CCPlatformConfig.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) + +#include +#include "Evas.h" + +namespace cocos2d { + class Data; + class Renderer; + class Mat4; + + namespace experimental { + namespace ui{ + class WebView; + } + } +} + +namespace cocos2d { + namespace experimental { + namespace ui{ + + class WebViewImpl { + public: + WebViewImpl(cocos2d::experimental::ui::WebView *webView); + + virtual ~WebViewImpl(); + + void setJavascriptInterfaceScheme(const std::string &scheme); + + void loadData(const cocos2d::Data &data, const std::string &MIMEType, const std::string &encoding, const std::string &baseURL); + + void loadHTMLString(const std::string &string, const std::string &baseURL); + + void loadURL(const std::string &url); + + void loadFile(const std::string &fileName); + + void stopLoading(); + + void reload(); + + bool canGoBack(); + + bool canGoForward(); + + void goBack(); + + void goForward(); + + void evaluateJS(const std::string &js); + + void setScalesPageToFit(const bool scalesPageToFit); + + virtual void draw(cocos2d::Renderer *renderer, cocos2d::Mat4 const &transform, int flags); + + virtual void setVisible(bool visible); + + void setBounces(bool bounces); + + Evas_Object* _ewkWin;; + Evas_Object* _ewkView; + private: + WebView *_webView; + }; + + } // namespace ui + } // namespace experimental +} //cocos2d + +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) + +#endif /* __COCOS2D__UI__WEBVIEWIMPL_TIZEN_H_ */ diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index eebd4386dc06..8fea5876bb4a 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -2,8 +2,7 @@ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* -- [Cocos2d-x 3.10 Release Notes](#cocos2d-x- -- -release-notes) +- [Cocos2d-x 3.11 Release Notes](#cocos2d-x-311-release-notes) - [Misc Information](#misc-information) - [Requirements](#requirements) - [Runtime Requirements](#runtime-requirements) @@ -15,18 +14,18 @@ - [Windows](#windows) - [Linux](#linux) - [How to start a new game](#how-to-start-a-new-game) -- [v3.10](#v310) - - [Highlights features, improvements and API updates of v3.10](#highlights-features-improvements-and-api-updates-of-v310) - - [The main features in detail of Cocos2d-x v3.10:](#the-main-features-in-detail-of-cocos2d-x-v310) - - [UI System](#ui-system) - - [AudioEngine](#audioengine) - - [Others](#others) +- [v3.11](#v311) + - [Highlights features](#highlights-features) + - [The main features in detail of Cocos2d-x v3.11](#the-main-features-in-detail-of-cocos2d-x-v311) + - [New memory model in JSB](#new-memory-model-in-jsb) + - [OpenSSL](#openssl) + - [Cocos2d-x JSB program debugging](#cocos2d-x-jsb-program-debugging) + - [New WebGL renderer](#new-webgl-renderer) - [Other changes](#other-changes) - - [NEW APIS](#new-apis) -# Cocos2d-x 3.10 Release Notes # +# Cocos2d-x 3.11 Release Notes # # Misc Information @@ -52,7 +51,7 @@ * ndk-r10c for Android * Visual Studio 2013 or newer for Windows (win32) * Visual Studio 2013 update4 or newer for Windows 8.1 universal Apps -* Visual Studio 2015 RC or newer and Windows 10.0 (build 10074 or higher) for Windows 10.0 UWP Apps +* Visual Studio 2015 or newer and Windows 10.0 (build 10074 or higher) for Windows 10.0 UWP Apps ## How to run tests @@ -81,16 +80,17 @@ cocos run -p android -m release ``` ### Mac OSX & iOS +You can run the samples by: -* Enter `cocos2d-x/build` folder, open `cocos2d_test.xcodeproj` -* Select `cpp-tests`, `lua-tests`, `js-tests` for `iOS` or `OS X` target in scheme toolbar -* Click `run` button +* Open __cocos2d-x/build__ folder, open __cocos2d_test.xcodeproj__ +* Select `cpp-tests`, `lua-tests`, `js-tests` for __iOS__ or __OS X__ target in scheme toolbar +* Click __run__ button ### Android - -You can run the samples... +You can run the samples by either using the command-line or Eclipse: **Using command line:** +Perform the following steps: $ cd cocos2d-x $ ./setup.py @@ -101,302 +101,124 @@ You can run the samples... Then click item on Android device to run tests. Available value of `-p` is the API level, cocos2d-x supports from level 10. **Using Eclipse:** +Perform the following steps: $ cd cocos2d-x $ ./setup.py $ cd build $ ./android-build.py cpp-empty-test -p 10 -Then +Next: -* Import cocos2d-x Android project into Eclipse, the path used to import is `cocos/2d/platform/android` -* Import `cpp-empty-test` Android project into Eclipse, the path used to import is `tests/cpp-empty-test/proj.android` +* Import cocos2d-x Android project into Eclipse, the path used to import is __cocos/2d/platform/android__ +* Import `cpp-empty-test` Android project into Eclipse, the path used to import is __tests/cpp-empty-test/proj.android__ * Build `cpp-empty-test` Android project and run ### Windows +You can run the samples by: -* For win32 project, enter `cocos2d-x/build`, and open `cocos2d-win32.sln` -* For win 8.1 project, enter `cocos2d-x/build`, and open `cocos2d-win8.1-universal.sln` -* For win 10 project, enter `cocos2d-x/build`, and open `cocos2d-win10.sln` +* For win32 project, enter __cocos2d-x/build__, and open __cocos2d-win32.sln__ +* For win 8.1 project, enter __cocos2d-x/build__, and open __cocos2d-win8.1-universal.sln__ +* For win 10 project, enter __cocos2d-x/build__, and open __cocos2d-win10.sln__ * Select running target * Click run button ### Linux +You can run the samples by: $ cd cocos2d-x/build $ ./install-deps-linux.sh $ cd ../.. -Then +Next: $ mkdir build $ cd build $ cmake ../cocos2d-x $ make -j4 -Run +Then run: $ cd bin/cpp-empty-test $ ./cpp-empty-test ## How to start a new game - -Use Cocos Console to create a new game: +Use the __cocos__ console app to create a new game: ``` cocos new -l cpp|js|lua MyNewGame ``` -# v3.10 - -## Highlights features, improvements and API updates of v3.10 - -We are happy to announce the release of Cocos2d-x v3.10. Following are the highlighted features, improvements and API updates in this version. - -1. Provides a unified setup for both Cocos2d-x and Cocos. This allows you to stay up to date with the latest Cocos2d-x releases. This includes using precompiled binaries and source code, in a single place. As always the source code is available from [GitHub](https://github.com/cocos2d/cocos2d-x) but, there is no longer a `.zip` file available containing the source code. -2. New __Cocos Launcher__ tool! __Cocos Launcher__ allows: - * One step to create a new project with the engine, by using precompiled libraries or source code. - * Easy integration with SDKBOX for 3rd party services: Facebook, IAP and many more. - * Developers to provide feedback and get support, directly within __Cocos Launcher__, making it simple to contact the engine team for help.  -3. UI System: - * Reimplemented `Scale9Sprite` to improve performance and reduce memory consumption. - * Changed `PageView` to derive from `ListView`. `PageView` can add any widget as a child. - * Added three new *overflow types* to `Label`: **CLAMP**,**SHRINK**, **RESIZE_HEIGHT**. - * Fixed a bug in `ClippingNode` that corrects its behavior when being set as a child. -4. Improved **JavaScript Bindings**: follows [SpiderMonkey GC best practices](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/GC_Rooting_Guide) making it more robust. - -## The main features in detail of Cocos2d-x v3.10: - -### UI System - -1. Reimplemented `Scale9Sprite` and improve the scale9sprite performance and reduce memory consumption. - - Reimplemented ui::Scale9Sprite, now the Slice sprite uses 16 vertices and 54 indices instead of the old 9 sprites way, The memory consumption is much lower than the previous implementation, and it is also more efficient. - - In SIMPLE mode, the 4 borders are all 0 and the whole sprite will scale horizontally and vertically. In this mode only 1 quad is used for rendering, for example: - - auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png"); - //When setting to SIMPLE, only 4 vertexes is used to rendering. - blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE); - - In SLICE mode, it will use 18 triangles to rendering the slice 9 sprite. If the 4 borders are 0, there still be 18 triangles computed. So choose your RenderingType wisely, for example: - - auto sprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png"); - //When setting to SLICE, 16 vertexes will be used to rendering. - sprite->setRenderingType(Scale9Sprite::RenderingType::SLICE); - -2. Changed `PageView` to derived from ListView, PageView can add any type of widget as child. - - PageView was derived from Layout and it implemented the features of scrolling and item arrangement from scratch. But the features are already there in ListView. So remove those duplicated implementations from PageView and make it inherit from ListView. - - By consequence, PageView becomes simpler and easier to maintain because it considers only paging implementation. for example: - - // Create the page view - Size size(240, 130); - PageView* pageView = PageView::create(); - pageView->setDirection(PageView::Direction::HORIZONTAL); - pageView->setContentSize(size); - Size backgroundSize = background->getContentSize(); - //"removeAllPages" is changed to "removeAllItems" - pageView->removeAllItems(); - pageView->setIndicatorEnabled(true); - - int pageCount = 4; - for (int i = 0; i < pageCount; ++i) - { - Layout* layout = Layout::create(); - layout->setContentSize(size); - - ImageView* imageView = ImageView::create("cocosui/scrollviewbg.png"); - imageView->setScale9Enabled(true); - imageView->setContentSize(size); - imageView->setPosition(Vec2(layout->getContentSize().width / 2.0f, layout->getContentSize().height / 2.0f)); - layout->addChild(imageView); - - Text* label = Text::create(StringUtils::format("page %d",(i+1)), "fonts/Marker Felt.ttf", 30); - label->setColor(Color3B(192, 192, 192)); - label->setPosition(Vec2(layout->getContentSize().width / 2.0f, layout->getContentSize().height / 2.0f)); - layout->addChild(label); - //"insertPage" is changed to "insertCustomItem" - pageView->insertCustomItem(layout, i); - } - //"removePageAtIndex" is changed to "removeItem" - pageView->removeItem(0); - //"scrollToPage" is changed to "scrollToItem" - pageView->scrollToItem(pageCount - 2); - - More detail usage please refer to: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp. - - -3. Added three overflow type to new label: CLAMP, SHRINK, RESIZE_HEIGHT. - - Overflow type is used to control label overflow result, In SHRINK mode, the font size will change dynamically to adapt the content size. In CLAMP mode, when label content goes out of the bounding box, it will be clipped, In RESIZE_HEIGHT mode, you can only change the width of label and the height is changed automatically. For example: - - //Change the label's Overflow type - label->setOverflow(Label::Overflow::RESIZE_HEIGHT); - - More detail usage please refer to: tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp. - - Limitations: - - - currently only TTF and BMFont support all the valid Overflow type. Char Map font supports all the Overflow type except for SHRINK, because we can't measure its font size. System font only support Overflow::Normal and Overflow::RESIZE_HEIGHT. - -## Other changes -[NEW] RichText supported new line element. - -[NEW] UIText::clone supports clone the text effect. - -[NEW] UI: Added methods to query label effect state. - -[REFINE] IOS: Added virtual keyword for some render related function. - -[REFINE] UI: Fixed boring deprecated warning in HttpRequest. - -[REFINE] Network: Fixed Downloader bug on iOS & Android platform. - -[REFINE] Studio: Fixed deprecation warning in SkeletonRenderer. - -[REFINE] JS: Added js test case for fix, improve template. - -[REFINE] Network: Permit http access to cocos2d-x.org in test projects on iOS. - -[REFINE] Network: Crash when removing a remotely downloaded image from texture -cache in js-binding. - -[REFINE] Win10: WinRT project update version to v3.10. - -[REFINE] Console: Added quiet option for Cocos Toolkit. - -[REFINE] JS: New GC model for js-binding. - -[REFINE] Doc: Fixed typos in documentation and comments. +# v3.11 -[REFINE] UI: Updated controlButton size calculate with new Scale9Sprite logic. +## Highlights features -[REFINE] Win10: Added missing _USRJSSTATIC preprocessor define for ARM builds. +* upgrade Chipmunk to v7.0.1 +* use new memory model in JSB, don't have to invoke `retain/release` in JS, it is disabled by default +* upgrade Curl to v7.48 +* upgrade OpenSSL to 1.0.2g +* can use VSCode and new Firefox to debug cocos2d-x JSB programs +* refactor WebGL renderer -[REFINE] JS: Added ccvector_to / ccmap_to converted to new js-binding API. +## The main features in detail of Cocos2d-x v3.11 -[REFINE] UI: Slider misprint fix. +### New memory model in JSB -[FIX] Core: Fixed premultiplyAlpha for mipmaps and compressed textures. +With new memory model, you don't have to care about object lifecycle. Which means you don't have to invoke `retain/release` in JS any more. -[FIX] UI: Fixed Scale9sprite rendering error when content size smaller than the sum of leftInset and rightInset. +Though we have finished many tests about this new memory model, we can't make sure it is too perfect to enable it by default. But you are appreciated if you can enable it to have a try. If you want to enable it, you should change the value of `CC_ENABLE_GC_FOR_NATIVE_OBJECTS` to 1 in `base/ccConfig.h` like this: -[FIX] Win32: Fixed EditBox crash when removing an EditBox in a scheduler. - -[FIX] Android: Fixed cannot add view to mFrameLayout when extends Cocos2dxActivity. - -[FIX] 2D: Fixed actionNode set at wrong position bug. - -[FIX] 3D: Fixed the movement of PUParticle lags one frame. - -[FIX] UI: Fixed the wront argument of setPlaceholderFontName in EditBox. - -[FIX] UI: Fixed EditBox editBoxEditingDidEnd may use the original text after change the text of EditBox in user script. - -[FIX] Audio: Fixed `FinishCallback` never be called in Windows. - -[FIX] UI: Fixed Layout stencil clipping nested with Clipping Node rendering issue. - -[FIX] UI: Keyboard doesn't hide when click the screen outside of EditBox on iOS platform. - -[FIX] UI: Fixed a fatal bug in EditBox implement on Windows platform. - -[FIX] UI: Fixed edit box setPlaceholderFontName and scale font size issue. - -[FIX] Core: Fixed memory leak when initWithImage() failed. - -[FIX] Network: CCDownloader on iOS is broken in v3.9 js-binding. +```c++ +#ifdef CC_ENABLE_SCRIPT_BINDING + #ifndef CC_ENABLE_GC_FOR_NATIVE_OBJECTS + #define CC_ENABLE_GC_FOR_NATIVE_OBJECTS 1 // change to 1 + #endif +#endif +``` -[FIX] JS: Bindings fixes for Menu, Sprite and Label. +### OpenSSL +Cocos2d-x has upgraded __OpenSSL__ to version __1.0.2g__. -[FIX] Studio: Removed weak reference in ActionNode. +Beginning __July 11, 2016__, Google Play will block publishing of any new apps or updates that use older versions of __OpenSSL__. It is important that you update the use of __OpenSSL__ in your projects. More detail information can refer to [this ticket](http://discuss.cocos2d-x.org/t/openssl-problem-again/28270). -[FIX] UI: shouldStartLoading method should return value to js in js-binding. +If you use v2.x or use older versions of v3.x, you can just update __CURL__ and __OpenSSL__. +To do this: -[FIX] UI: Fixed scrollview render error. +* modify __Cocos2d-x root/external/config.json__ to update the dependency version. For v3.x the dependency version is `v3-deps-92`, and for v2.x it is `v2-deps-5` +* execute the __download-deps.py__ script in your __Cocos2d-x root__. -[FIX] JS: Fixed win32 js project crash issue. +```sh +(jtsm @ 15 ~) $ cd cocos2d-x -[FIX] UI: Button touch doesn't work with scale9 enabled. +(jtsm @ 15 ~/cocos2d-x) $ ./download-deps.py -[FIX] JS: Fixed evalString doesn't return result issue. +======================================================= +==> Prepare to download external libraries! +==> Ready to download 'v3-deps-92.zip' from 'https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/archive/v3-deps-92.zip' +==> WARNING: Couldnt grab the file size from remote, use 'zip_file_size' section in '/Users/jtsm/Chukong-Inc/cocos2d-x/external/config.json' +==> Start to download, please wait ... +==> Downloading finished! +==> Extracting files, please wait ... +==> Extraction done! ==> Copying files... +==> Cleaning... +``` +Feel free to post on our forums if you run into difficulty. -[FIX] JS: Fixed ComponentJS proxy management issue in JSB. +### Cocos2d-x JSB program debugging -[FIX] Android: Fixed include in cocos network module. +In previous version, can not use Firefox 30+ to debug cocos2d-x JSB programs. This limit is fixed since v3.11. And web console feature is added too. [This documentation](http://www.cocos2d-x.org/wiki/Javascript_Remote_Debugging) shows how to use Firefox to debug cocos2d-x JSB programs(this is a little difference from current usage). -[FIX] Network: Fixed web socket crash. +Of course you can use [VSCode](https://code.visualstudio.com/) to debug cocos2d-x JSB programs too. You can read about how to use VSCode to debug cocos2d-x JSB programs [here](http://discuss.cocos2d-x.org/t/use-vscode-to-debug-cocos2d-x-jsb-programs/27588). -[FIX] UI: Fixed TextField missing default password style text setting. +### New WebGL renderer -[TEST] S9SpriteTest: Scale9Sprite fade actions with cascade opacity. +In v3.11, we have refactored the WebGL renderer in web engine, here is the detailed changes: -[TEST] Web: Removed default focus block from UIFocusTestVertical. +1. Activate WebGL on Android by default. +2. Add sprite auto batching in WebGL. +3. Shared rendering buffer for Sprites. -[TEST] Lua: Fixed pageViewTest Horizontal scroll won't work in Lua-test. +Compare with old version, the draw calls in your game should be significantly reduced if the textures is well managed. This improves also the CPU usage and memory usage. The above is just a first step of WebGL renderer upgrade, we will continue to investigate in this direction in the future versions. +## Other changes You can also take a look at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG). - -## NEW APIS - -1. RichText - - Added RichElementNewLine class to create new RichText Element. - - For more information: [https://github.com/cocos2d/cocos2d-x/pull/14033](https://github.com/cocos2d/cocos2d-x/pull/14033 "https://github.com/cocos2d/cocos2d-x/pull/14033") - -2. PageViewIndicator - - Added PageViewIndicator class to create PageViewIndicator. - - For more information: [https://github.com/cocos2d/cocos2d-x/blob/v3/cocos/ui/UIPageViewIndicator.h](https://github.com/cocos2d/cocos2d-x/blob/v3/cocos/ui/UIPageViewIndicator.h "https://github.com/cocos2d/cocos2d-x/blob/v3/cocos/ui/UIPageViewIndicator.h") - -3. PageView - - Changed PageView to derived from ListView. - For more information: [https://github.com/cocos2d/cocos2d-x/pull/14252](https://github.com/cocos2d/cocos2d-x/pull/14252 "https://github.com/cocos2d/cocos2d-x/pull/14252") - -4. ApplicationProtocol - - Added the API getVersion. - - -5. PolygonInfo - - Added the API setTriangles. - -6. Scale9Sprite - - Added setRenderingType, getRenderingType. - -9. FontFNT - - Added setFontSize, getOriginalFontSize. - -10. Label - - Added setBMFontSize, getBMFontSize, enableWrap, isWrapEnabled, setOverflow, getOverflow, initWithTTF, isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor. - -11. AudioEngineImpl - - Added AudioEngineImpl to implement FMOD. - -12. Lua Module - - Added luaval_to_node, node_to_luaval. - -13. JS Module - - Added js_cocos2dx_ComponentJS_create - -14. ui::Text - - Added isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor. - -15. UITextTest_Clone - - Added UITextTest_Clone class. - \ No newline at end of file diff --git a/docs/RELEASE_NOTES_CN.md b/docs/RELEASE_NOTES_CN.md new file mode 100644 index 000000000000..ee135b043d50 --- /dev/null +++ b/docs/RELEASE_NOTES_CN.md @@ -0,0 +1,72 @@ +# v3.11 + +## 新特性 + +* Chipmunk升级到v7.0.1 +* JSB使用新的内存模型,在JS脚本不需要关心对象的生命周期,该特性默认关闭 +* CURL升级到v7.48 +* OpenSSL升级到v1.0.2g +* 可以使用VSCode或者新版本的Firefox调试JSB程序 +* 全面升级 WebGL 渲染器 + +## 主要特性的详细介绍 + +### JSB的新内存模型 + +使用新的内存模型后,开发者不需要关心对象的声明周期。这就意味着不需要在JS代码里手动调用`retain/release`函数。 + +不过该内存模型默认是关闭的。虽然我们已经做了很多的测试,目前没有发现任何问题,但是保险起见,你需要手动开启该功能,开启的方法是在`base/ccConfig.h`里把`CC_ENABLE_GC_FOR_NATIVE`的值改为1: + +```c++ +#ifdef CC_ENABLE_SCRIPT_BINDING + #ifndef CC_ENABLE_GC_FOR_NATIVE_OBJECTS + #define CC_ENABLE_GC_FOR_NATIVE_OBJECTS 1 // change to 1 + #endif +#endif +``` + +### OpenSSL +Cocos2d-x已经把__OpenSSL__升级到__1.0.2.g__。 + +从__2016年7月11__日开始,Google Play将不再接受使用低版本的__OpenSSL__的新应用程序或者应用程序更新。更新程序中使用的__OpenSSL__版本变得十分重要。更详细的信息可以参考[这个帖子](http://discuss.cocos2d-x.org/t/openssl-problem-again/28270)。 + +如果你使用的是v2.x或者低版本的v3.x引擎,那么你可以只更新__CURL__和__OpenSSL__,具体步骤如下: + +* 修改__Cocos2d-x root/external/config.json__文件中的`version`字段。如果是v3.x的话,那么`version`字段的值改为`v3-dpes-92`,如果是v2.x的话,那么值是`v2-deps-5` +* 在Cocos2d-x根目录下执行__download-deps.py__脚本 + +```sh +(jtsm @ 15 ~) $ cd cocos2d-x + +(jtsm @ 15 ~/cocos2d-x) $ ./download-deps.py + +======================================================= +==> Prepare to download external libraries! +==> Ready to download 'v3-deps-92.zip' from 'https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/archive/v3-deps-92.zip' +==> WARNING: Couldnt grab the file size from remote, use 'zip_file_size' section in '/Users/jtsm/Chukong-Inc/cocos2d-x/external/config.json' +==> Start to download, please wait ... +==> Downloading finished! +==> Extracting files, please wait ... +==> Extraction done! ==> Copying files... +==> Cleaning... +``` +有任何问题可以在引擎的[中文论坛](http://forum.cocos.com/)上发帖反馈。 + +### Cocos2d-x JSB程序调试 + +v3.11版本之前,不能使用Firefox 30+版本来调试cocos2d-x JSB程序。这个版本修复了该问题,同时支持了web console功能。如果你不了解如何使用Firefox调试cocos2d-x JSB程序,可以参考[这篇文档](This documentation](http://www.cocos2d-x.org/wiki/Javascript_Remote_Debugging)。 + +当然你也可以使用[VSCode](https://code.visualstudio.com/)来调试,具体的使用方法参考[这篇文档](http://discuss.cocos2d-x.org/t/use-vscode-to-debug-cocos2d-x-jsb-programs/27588)。 + +### 全面升级 WebGL 渲染器 + +在v3.11中,为了提升性能,我们重构了WebGL渲染器,下面是几项重要的改进: + +1. 在 Android 浏览器上默认开启 WebGL(支持的话) +2. WebGL 模式下自动批处理 Sprite +3. Sprite 共享全局的渲染数据缓存,并减少 GL 函数调用 + +在这些优化后,与旧版本相比,合并贴图后的游戏中draw call数量将得到显著的降低。不仅如此,v3.11中的CPU使用率和内存使用也都得到了降低。在我们的bunnymark测试中,v3.11相比之前的版本有4倍以上的渲染性能提升。当然,这是我们对WebGL渲染器做的第一步升级,在后续版本中,WebGL渲染器还将得到持续优化。 + +## 其他改动 +更完整的改动列表可以阅读[full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG)。 diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.cpp b/extensions/GUI/CCControlExtension/CCControlUtils.cpp index f2c868d20c20..97c69a553e60 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.cpp +++ b/extensions/GUI/CCControlExtension/CCControlUtils.cpp @@ -92,7 +92,7 @@ RGBA ControlUtils::RGBfromHSV(HSV value) if (value.s <= 0.0) // < is bogus, just shuts up warnings { - if (isnan(value.h)) // value.h == NAN + if (std::isnan(value.h)) // value.h == NAN { out.r = value.v; out.g = value.v; diff --git a/extensions/Particle3D/PU/CCPUMaterialManager.cpp b/extensions/Particle3D/PU/CCPUMaterialManager.cpp index 8f0adeb92c69..2fb33bbea773 100644 --- a/extensions/Particle3D/PU/CCPUMaterialManager.cpp +++ b/extensions/Particle3D/PU/CCPUMaterialManager.cpp @@ -36,7 +36,7 @@ #include #elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) #include -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) #include #include #include @@ -161,7 +161,7 @@ bool PUMaterialCache::loadMaterialsFromSearchPaths( const std::string &fileFolde #elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) ftw(fileFolder.c_str(), iterPath, 500); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) DIR *d; //dir handle struct dirent *file; //readdir struct stat statbuf; diff --git a/extensions/Particle3D/PU/CCPURibbonTrail.cpp b/extensions/Particle3D/PU/CCPURibbonTrail.cpp index 8127a768a283..66188f3506a0 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrail.cpp +++ b/extensions/Particle3D/PU/CCPURibbonTrail.cpp @@ -58,7 +58,7 @@ void PURibbonTrail::addNode(Node* n) { if (_nodeList.size() == _chainCount) { - CCAssert(false, " cannot monitor any more nodes, chain count exceeded"); + CCASSERT(false, " cannot monitor any more nodes, chain count exceeded"); } //if (n->getListener()) @@ -87,7 +87,7 @@ size_t PURibbonTrail::getChainIndexForNode(const Node* n) NodeToChainSegmentMap::const_iterator i = _nodeToSegMap.find(n); if (i == _nodeToSegMap.end()) { - CCAssert(false, "This node is not being tracked"); + CCASSERT(false, "This node is not being tracked"); } return i->second; } @@ -130,7 +130,7 @@ void PURibbonTrail::setMaxChainElements(size_t maxElements) //----------------------------------------------------------------------- void PURibbonTrail::setNumberOfChains(size_t numChains) { - CCAssert(numChains >= _nodeList.size(), "Can't shrink the number of chains less than number of tracking nodes"); + CCASSERT(numChains >= _nodeList.size(), "Can't shrink the number of chains less than number of tracking nodes"); size_t oldChains = getNumberOfChains(); @@ -181,7 +181,7 @@ void PURibbonTrail::setInitialColour(size_t chainIndex, const Vec4& col) //----------------------------------------------------------------------- void PURibbonTrail::setInitialColour(size_t chainIndex, float r, float g, float b, float a) { - CCAssert(chainIndex < _chainCount, "chainIndex out of bounds"); + CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); _initialColor[chainIndex].x = r; _initialColor[chainIndex].y = g; _initialColor[chainIndex].z = b; @@ -190,19 +190,19 @@ void PURibbonTrail::setInitialColour(size_t chainIndex, float r, float g, float //----------------------------------------------------------------------- const Vec4& PURibbonTrail::getInitialColour(size_t chainIndex) const { - CCAssert(chainIndex < _chainCount, "chainIndex out of bounds"); + CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); return _initialColor[chainIndex]; } //----------------------------------------------------------------------- void PURibbonTrail::setInitialWidth(size_t chainIndex, float width) { - CCAssert(chainIndex < _chainCount, "chainIndex out of bounds"); + CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); _initialWidth[chainIndex] = width; } //----------------------------------------------------------------------- float PURibbonTrail::getInitialWidth(size_t chainIndex) const { - CCAssert(chainIndex < _chainCount, "chainIndex out of bounds"); + CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); return _initialWidth[chainIndex]; } //----------------------------------------------------------------------- @@ -214,7 +214,7 @@ void PURibbonTrail::setColourChange(size_t chainIndex, const Vec4& valuePerSecon //----------------------------------------------------------------------- void PURibbonTrail::setColourChange(size_t chainIndex, float r, float g, float b, float a) { - CCAssert(chainIndex < _chainCount, "chainIndex out of bounds"); + CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); _deltaColor[chainIndex].x = r; _deltaColor[chainIndex].y = g; _deltaColor[chainIndex].z = b; @@ -226,20 +226,20 @@ void PURibbonTrail::setColourChange(size_t chainIndex, float r, float g, float b //----------------------------------------------------------------------- const Vec4& PURibbonTrail::getColourChange(size_t chainIndex) const { - CCAssert(chainIndex < _chainCount, "chainIndex out of bounds"); + CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); return _deltaColor[chainIndex]; } //----------------------------------------------------------------------- void PURibbonTrail::setWidthChange(size_t chainIndex, float widthDeltaPerSecond) { - CCAssert(chainIndex < _chainCount, "chainIndex out of bounds"); + CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); _deltaWidth[chainIndex] = widthDeltaPerSecond; manageController(); } //----------------------------------------------------------------------- float PURibbonTrail::getWidthChange(size_t chainIndex) const { - CCAssert(chainIndex < _chainCount, "chainIndex out of bounds"); + CCASSERT(chainIndex < _chainCount, "chainIndex out of bounds"); return _deltaWidth[chainIndex]; } diff --git a/extensions/assets-manager/AssetsManagerEx.cpp b/extensions/assets-manager/AssetsManagerEx.cpp index a78e324de9b3..557d9ceb0556 100644 --- a/extensions/assets-manager/AssetsManagerEx.cpp +++ b/extensions/assets-manager/AssetsManagerEx.cpp @@ -494,7 +494,13 @@ void AssetsManagerEx::downloadManifest() if (_updateState != State::PREDOWNLOAD_MANIFEST) return; - std::string manifestUrl = _localManifest->getManifestFileUrl(); + std::string manifestUrl; + if (_remoteManifest->isVersionLoaded()) { + manifestUrl = _remoteManifest->getManifestFileUrl(); + } else { + manifestUrl = _localManifest->getManifestFileUrl(); + } + if (manifestUrl.size() > 0) { _updateState = State::DOWNLOADING_MANIFEST; @@ -658,8 +664,8 @@ void AssetsManagerEx::updateSucceed() _compressedFiles.clear(); std::function mainThread = [this](void* param) { - AsyncData* asyncData = (AsyncData*)param; - if (asyncData->errorCompressedFile.empty()) + auto asyncDataInner = reinterpret_cast(param); + if (asyncDataInner->errorCompressedFile.empty()) { // 5. Set update state _updateState = State::UP_TO_DATE; @@ -669,10 +675,10 @@ void AssetsManagerEx::updateSucceed() else { _updateState = State::FAIL_TO_UPDATE; - dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_DECOMPRESS, "", "Unable to decompress file " + asyncData->errorCompressedFile); + dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_DECOMPRESS, "", "Unable to decompress file " + asyncDataInner->errorCompressedFile); } - delete asyncData; + delete asyncDataInner; }; AsyncTaskPool::getInstance()->enqueue(AsyncTaskPool::TaskType::TASK_OTHER, mainThread, (void*)asyncData, [this, asyncData]() { // Decompress all compressed files @@ -807,6 +813,7 @@ void AssetsManagerEx::updateAssets(const DownloadUnits& assets) _updateState = State::UPDATING; _downloadUnits.clear(); _downloadUnits = assets; + _totalWaitToDownload = _totalToDownload = (int)_downloadUnits.size(); this->batchDownload(); } else if (size == 0 && _totalWaitToDownload == 0) @@ -856,6 +863,11 @@ void AssetsManagerEx::onError(const network::DownloadTask& task, _failedUnits.emplace(unit.customId, unit); } dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_UPDATING, task.identifier, errorStr, errorCode, errorCodeInternal); + + if (_totalWaitToDownload <= 0) + { + this->onDownloadUnitsFinished(); + } } } @@ -961,21 +973,7 @@ void AssetsManagerEx::onSuccess(const std::string &srcUrl, const std::string &st if (_totalWaitToDownload <= 0) { - // Finished with error check - if (_failedUnits.size() > 0) - { - // Save current download manifest information for resuming - _tempManifest->saveToFile(_tempManifestPath); - - decompressDownloadedZip(); - - _updateState = State::FAIL_TO_UPDATE; - dispatchUpdateEvent(EventAssetsManagerEx::EventCode::UPDATE_FAILED); - } - else - { - updateSucceed(); - } + this->onDownloadUnitsFinished(); } } } @@ -995,4 +993,23 @@ void AssetsManagerEx::batchDownload() } } +void AssetsManagerEx::onDownloadUnitsFinished() +{ + // Finished with error check + if (_failedUnits.size() > 0) + { + // Save current download manifest information for resuming + _tempManifest->saveToFile(_tempManifestPath); + + decompressDownloadedZip(); + + _updateState = State::FAIL_TO_UPDATE; + dispatchUpdateEvent(EventAssetsManagerEx::EventCode::UPDATE_FAILED); + } + else + { + updateSucceed(); + } +} + NS_CC_EXT_END diff --git a/extensions/assets-manager/AssetsManagerEx.h b/extensions/assets-manager/AssetsManagerEx.h index e7fa32291f24..ec8b17e80d0b 100644 --- a/extensions/assets-manager/AssetsManagerEx.h +++ b/extensions/assets-manager/AssetsManagerEx.h @@ -189,6 +189,9 @@ class CC_EX_DLL AssetsManagerEx : public Ref private: void batchDownload(); + + // Called when one DownloadUnits finished + void onDownloadUnitsFinished(); //! The event of the current AssetsManagerEx in event dispatcher std::string _eventName; diff --git a/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp b/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp index 20c034876c79..210dd9c48c75 100644 --- a/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp +++ b/extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp @@ -25,7 +25,7 @@ #include "CCEventListenerAssetsManagerEx.h" #include "CCEventAssetsManagerEx.h" #include "AssetsManagerEx.h" -#include "cocos2d.h" +#include "deprecated/CCString.h" NS_CC_EXT_BEGIN @@ -95,4 +95,4 @@ bool EventListenerAssetsManagerEx::checkAvailable() return ret; } -NS_CC_EXT_END \ No newline at end of file +NS_CC_EXT_END diff --git a/extensions/assets-manager/Manifest.cpp b/extensions/assets-manager/Manifest.cpp index d3070fcee932..95f070689b52 100644 --- a/extensions/assets-manager/Manifest.cpp +++ b/extensions/assets-manager/Manifest.cpp @@ -161,11 +161,12 @@ std::unordered_map Manifest::genDiff(const Man { std::unordered_map diff_map; const std::unordered_map &bAssets = b->getAssets(); + std::unordered_map::const_iterator valueIt, it; for (it = _assets.begin(); it != _assets.end(); ++it) { - auto &key = it->first; - auto &valueA = it->second; + const auto &key = it->first; + const auto &valueA = it->second; // Deleted valueIt = bAssets.find(key); @@ -189,8 +190,8 @@ std::unordered_map Manifest::genDiff(const Man for (it = bAssets.begin(); it != bAssets.end(); ++it) { - auto &key = it->first; - auto &valueB = it->second; + const auto &key = it->first; + const auto &valueB = it->second; // Added valueIt = _assets.find(key); diff --git a/external/config.json b/external/config.json index 852833ab5ac6..9fce3c6efc67 100644 --- a/external/config.json +++ b/external/config.json @@ -1,6 +1,6 @@ { - "version":"v3-deps-88", - "zip_file_size":"128300879", + "version":"v3-deps-96", + "zip_file_size":"128440074", "repo_name":"cocos2d-x-3rd-party-libs-bin", "repo_parent":"https://github.com/cocos2d/", "move_dirs":{ diff --git a/licenses/LICENSE_com.android.vending.expansion.zipfile.txt b/licenses/LICENSE_com.android.vending.expansion.zipfile.txt new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/licenses/LICENSE_com.android.vending.expansion.zipfile.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index c1d7a540bc75..cf8882890296 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -13,6 +13,10 @@ "build/cocos2d_libs.xcodeproj/project.pbxproj", "build/cocos2d_tests.xcodeproj/project.pbxproj", "build/install-deps-linux.sh", + "build/tizen/.cproject", + "build/tizen/.exportMap", + "build/tizen/.project", + "build/tizen/.tproject", "build/win32-msvc-2013-x86.cmd", "cmake/AndroidNdkGdb.cmake", "cmake/AndroidNdkModules.cmake", @@ -311,6 +315,9 @@ "cocos/audio/openal/OpenALDecoder.cpp", "cocos/audio/openal/OpenALDecoder.h", "cocos/audio/openal/SimpleAudioEngineOpenAL.cpp", + "cocos/audio/tizen/AudioEngine-tizen.cpp", + "cocos/audio/tizen/AudioEngine-tizen.h", + "cocos/audio/tizen/SimpleAudioEngineTizen.cpp", "cocos/audio/win32/AudioCache.cpp", "cocos/audio/win32/AudioCache.h", "cocos/audio/win32/AudioEngine-win32.cpp", @@ -948,6 +955,7 @@ "cocos/platform/android/java/build.xml", "cocos/platform/android/java/libs/", "cocos/platform/android/java/libs/android-async-http-1.4.8.jar", + "cocos/platform/android/java/libs/com.android.vending.expansion.zipfile.jar", "cocos/platform/android/java/lint.xml", "cocos/platform/android/java/proguard-project.txt", "cocos/platform/android/java/project.properties", @@ -1038,6 +1046,18 @@ "cocos/platform/mac/CCPlatformDefine-mac.h", "cocos/platform/mac/CCStdC-mac.h", "cocos/platform/mac/cocos2d-prefix.pch", + "cocos/platform/tizen/CCApplication-tizen.cpp", + "cocos/platform/tizen/CCApplication-tizen.h", + "cocos/platform/tizen/CCCommon-tizen.cpp", + "cocos/platform/tizen/CCDevice-tizen.cpp", + "cocos/platform/tizen/CCFileUtils-tizen.cpp", + "cocos/platform/tizen/CCFileUtils-tizen.h", + "cocos/platform/tizen/CCGL-tizen.h", + "cocos/platform/tizen/CCGLViewImpl-tizen.cpp", + "cocos/platform/tizen/CCGLViewImpl-tizen.h", + "cocos/platform/tizen/CCPlatformDefine-tizen.h", + "cocos/platform/tizen/CCStdC-tizen.cpp", + "cocos/platform/tizen/CCStdC-tizen.h", "cocos/platform/win32/CCApplication-win32.cpp", "cocos/platform/win32/CCApplication-win32.h", "cocos/platform/win32/CCCommon-win32.cpp", @@ -1240,6 +1260,8 @@ "cocos/ui/UIEditBox/UIEditBoxImpl-mac.h", "cocos/ui/UIEditBox/UIEditBoxImpl-mac.mm", "cocos/ui/UIEditBox/UIEditBoxImpl-stub.cpp", + "cocos/ui/UIEditBox/UIEditBoxImpl-tizen.cpp", + "cocos/ui/UIEditBox/UIEditBoxImpl-tizen.h", "cocos/ui/UIEditBox/UIEditBoxImpl-win32.cpp", "cocos/ui/UIEditBox/UIEditBoxImpl-win32.h", "cocos/ui/UIEditBox/UIEditBoxImpl-winrt.cpp", @@ -1306,6 +1328,7 @@ "cocos/ui/UIVBox.h", "cocos/ui/UIVideoPlayer-android.cpp", "cocos/ui/UIVideoPlayer-ios.mm", + "cocos/ui/UIVideoPlayer-tizen.cpp", "cocos/ui/UIVideoPlayer.h", "cocos/ui/UIWebView-inl.h", "cocos/ui/UIWebView.cpp", @@ -1315,6 +1338,8 @@ "cocos/ui/UIWebViewImpl-android.h", "cocos/ui/UIWebViewImpl-ios.h", "cocos/ui/UIWebViewImpl-ios.mm", + "cocos/ui/UIWebViewImpl-tizen.cpp", + "cocos/ui/UIWebViewImpl-tizen.h", "cocos/ui/UIWidget.cpp", "cocos/ui/UIWidget.h", "cocos/ui/proj.win32/libui.vcxproj", @@ -1325,6 +1350,7 @@ "docs/MainPageWhiteBook.h", "docs/RELEASE_ENGINEERING.md", "docs/RELEASE_NOTES.md", + "docs/RELEASE_NOTES_CN.md", "docs/cocos2dx_portrait.png", "docs/doxygen.config", "docs/doxygen_white_book.config", @@ -2332,6 +2358,8 @@ "external/chipmunk/prebuilt/ios/libchipmunk.a", "external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a", "external/chipmunk/prebuilt/mac/libchipmunk.a", + "external/chipmunk/prebuilt/tizen/arm/libchipmunk.a", + "external/chipmunk/prebuilt/tizen/x86/libchipmunk.a", "external/chipmunk/prebuilt/win10/arm/chipmunk.lib", "external/chipmunk/prebuilt/win10/win32/chipmunk.lib", "external/chipmunk/prebuilt/win32/debug-lib/libchipmunk-2015.lib", @@ -2354,6 +2382,7 @@ "external/curl/include/android/curl/multi.h", "external/curl/include/android/curl/stdcheaders.h", "external/curl/include/android/curl/typecheck-gcc.h", + "external/curl/include/android/curl/types.h", "external/curl/include/ios/curl/curl.h", "external/curl/include/ios/curl/curlbuild-32.h", "external/curl/include/ios/curl/curlbuild-64.h", @@ -2956,6 +2985,9 @@ "external/jpeg/include/mac/jconfig.h", "external/jpeg/include/mac/jmorecfg.h", "external/jpeg/include/mac/jpeglib.h", + "external/jpeg/include/tizen/jconfig.h", + "external/jpeg/include/tizen/jmorecfg.h", + "external/jpeg/include/tizen/jpeglib.h", "external/jpeg/include/win32/jconfig.h", "external/jpeg/include/win32/jmorecfg.h", "external/jpeg/include/win32/jpeglib.h", @@ -2967,6 +2999,8 @@ "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/tizen/arm/libjpeg.a", + "external/jpeg/prebuilt/tizen/x86/libjpeg.a", "external/jpeg/prebuilt/win32/libjpeg-2015.lib", "external/jpeg/prebuilt/win32/libjpeg.lib", "external/json/allocators.h", @@ -3018,6 +3052,9 @@ "external/png/include/mac/png.h", "external/png/include/mac/pngconf.h", "external/png/include/mac/pnglibconf.h", + "external/png/include/tizen/png.h", + "external/png/include/tizen/pngconf.h", + "external/png/include/tizen/pnglibconf.h", "external/png/include/win32/png.h", "external/png/include/win32/pngconf.h", "external/png/include/win32/pnglibconf.h", @@ -3027,6 +3064,8 @@ "external/png/prebuilt/android/x86/libpng.a", "external/png/prebuilt/ios/libpng.a", "external/png/prebuilt/mac/libpng.a", + "external/png/prebuilt/tizen/arm/libpng.a", + "external/png/prebuilt/tizen/x86/libpng.a", "external/png/prebuilt/win32/libpng-2015.lib", "external/png/prebuilt/win32/libpng.lib", "external/poly2tri/common/shapes.cc", @@ -3145,6 +3184,10 @@ "external/tiff/include/mac/tiffconf.h", "external/tiff/include/mac/tiffio.h", "external/tiff/include/mac/tiffvers.h", + "external/tiff/include/tizen/tiff.h", + "external/tiff/include/tizen/tiffconf.h", + "external/tiff/include/tizen/tiffio.h", + "external/tiff/include/tizen/tiffvers.h", "external/tiff/include/win32/tiff.h", "external/tiff/include/win32/tiffconf.h", "external/tiff/include/win32/tiffio.h", @@ -3157,6 +3200,8 @@ "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/tizen/arm/libtiff.a", + "external/tiff/prebuilt/tizen/x86/libtiff.a", "external/tiff/prebuilt/win32/libtiff-2015.lib", "external/tiff/prebuilt/win32/libtiff.dll", "external/tiff/prebuilt/win32/libtiff.lib", @@ -3185,6 +3230,9 @@ "external/webp/include/mac/decode.h", "external/webp/include/mac/encode.h", "external/webp/include/mac/types.h", + "external/webp/include/tizen/decode.h", + "external/webp/include/tizen/encode.h", + "external/webp/include/tizen/types.h", "external/webp/include/win32/decode.h", "external/webp/include/win32/encode.h", "external/webp/include/win32/types.h", @@ -3196,6 +3244,8 @@ "external/webp/prebuilt/linux/32-bit/libwebp.a", "external/webp/prebuilt/linux/64-bit/libwebp.a", "external/webp/prebuilt/mac/libwebp.a", + "external/webp/prebuilt/tizen/arm/libwebp.a", + "external/webp/prebuilt/tizen/x86/libwebp.a", "external/webp/prebuilt/win32/libwebp.lib", "external/websockets/include/android/libwebsockets.h", "external/websockets/include/android/lws_config.h", @@ -3205,8 +3255,11 @@ "external/websockets/include/linux/lws_config.h", "external/websockets/include/mac/libwebsockets.h", "external/websockets/include/mac/lws_config.h", + "external/websockets/include/tizen/libwebsockets.h", + "external/websockets/include/tizen/lws_config.h", "external/websockets/include/win10/libwebsockets.h", "external/websockets/include/win10/lws_config.h", + "external/websockets/include/win10/private-libwebsockets.h", "external/websockets/include/win32/libwebsockets.h", "external/websockets/include/win32/lws_config.h", "external/websockets/include/win32/win32helpers/getopt.h", @@ -3215,13 +3268,9 @@ "external/websockets/include/winrt_8.1/libwebsockets.h", "external/websockets/include/winrt_8.1/lws_config.h", "external/websockets/include/winrt_8.1/private-libwebsockets.h", - "external/websockets/include/winrt_8.1/win32helpers/getopt.h", - "external/websockets/include/winrt_8.1/win32helpers/gettimeofday.h", "external/websockets/include/wp_8.1/libwebsockets.h", "external/websockets/include/wp_8.1/lws_config.h", "external/websockets/include/wp_8.1/private-libwebsockets.h", - "external/websockets/include/wp_8.1/win32helpers/getopt.h", - "external/websockets/include/wp_8.1/win32helpers/gettimeofday.h", "external/websockets/prebuilt/android/Android.mk", "external/websockets/prebuilt/android/armeabi-v7a/libwebsockets.a", "external/websockets/prebuilt/android/armeabi/libwebsockets.a", @@ -3230,6 +3279,8 @@ "external/websockets/prebuilt/linux/32-bit/libwebsockets.a", "external/websockets/prebuilt/linux/64-bit/libwebsockets.a", "external/websockets/prebuilt/mac/libwebsockets.a", + "external/websockets/prebuilt/tizen/arm/libwebsockets.a", + "external/websockets/prebuilt/tizen/x86/libwebsockets.a", "external/websockets/prebuilt/win10/arm/libwebsockets.lib", "external/websockets/prebuilt/win10/win32/libwebsockets.lib", "external/websockets/prebuilt/win32/websockets.lib", @@ -3278,8 +3329,10 @@ "external/win10-specific/zlib/include/zlib.h", "external/win10-specific/zlib/prebuilt/arm/zlib.dll", "external/win10-specific/zlib/prebuilt/arm/zlib.lib", + "external/win10-specific/zlib/prebuilt/arm/zlibstatic.lib", "external/win10-specific/zlib/prebuilt/win32/zlib.dll", "external/win10-specific/zlib/prebuilt/win32/zlib.lib", + "external/win10-specific/zlib/prebuilt/win32/zlibstatic.lib", "external/win32-specific/MP3Decoder/include/mpg123.h", "external/win32-specific/MP3Decoder/prebuilt/libmpg123.dll", "external/win32-specific/MP3Decoder/prebuilt/libmpg123.lib", @@ -3314,34 +3367,6 @@ "external/win32-specific/zlib/include/zlib.h", "external/win32-specific/zlib/prebuilt/libzlib.lib", "external/win32-specific/zlib/prebuilt/zlib1.dll", - "external/winrt-specific/angle/angle.bat", - "external/winrt-specific/angle/include/EGL/egl.h", - "external/winrt-specific/angle/include/EGL/eglext.h", - "external/winrt-specific/angle/include/EGL/eglplatform.h", - "external/winrt-specific/angle/include/GLES2/gl2.h", - "external/winrt-specific/angle/include/GLES2/gl2ext.h", - "external/winrt-specific/angle/include/GLES2/gl2platform.h", - "external/winrt-specific/angle/include/GLSLANG/ShaderLang.h", - "external/winrt-specific/angle/include/KHR/khrplatform.h", - "external/winrt-specific/angle/include/esUtil.h", - "external/winrt-specific/angle/include/winrtangle.h", - "external/winrt-specific/angle/prebuilt/ARM/esUtil.lib", - "external/winrt-specific/angle/prebuilt/ARM/libEGL.dll", - "external/winrt-specific/angle/prebuilt/ARM/libEGL.lib", - "external/winrt-specific/angle/prebuilt/ARM/libGLESv2.dll", - "external/winrt-specific/angle/prebuilt/ARM/libGLESv2.lib", - "external/winrt-specific/angle/prebuilt/Win32/esUtil.lib", - "external/winrt-specific/angle/prebuilt/Win32/libEGL.dll", - "external/winrt-specific/angle/prebuilt/Win32/libEGL.lib", - "external/winrt-specific/angle/prebuilt/Win32/libGLESv2.dll", - "external/winrt-specific/angle/prebuilt/Win32/libGLESv2.lib", - "external/winrt-specific/zlib/include/README.txt", - "external/winrt-specific/zlib/include/zconf.h", - "external/winrt-specific/zlib/include/zlib.h", - "external/winrt-specific/zlib/include/zlib.vcxproj", - "external/winrt-specific/zlib/include/zlib.vcxproj.filters", - "external/winrt-specific/zlib/prebuilt/ARM/zlib.lib", - "external/winrt-specific/zlib/prebuilt/Win32/zlib.lib", "external/winrt_8.1-specific/OggDecoder/include/ogg/ogg.h", "external/winrt_8.1-specific/OggDecoder/include/ogg/os_types.h", "external/winrt_8.1-specific/OggDecoder/include/vorbis/codec.h", @@ -3381,8 +3406,12 @@ "external/winrt_8.1-specific/angle/prebuilt/win32/libGLESv2.lib", "external/winrt_8.1-specific/zlib/include/zconf.h", "external/winrt_8.1-specific/zlib/include/zlib.h", + "external/winrt_8.1-specific/zlib/prebuilt/arm/zlib.dll", "external/winrt_8.1-specific/zlib/prebuilt/arm/zlib.lib", + "external/winrt_8.1-specific/zlib/prebuilt/arm/zlibstatic.lib", + "external/winrt_8.1-specific/zlib/prebuilt/win32/zlib.dll", "external/winrt_8.1-specific/zlib/prebuilt/win32/zlib.lib", + "external/winrt_8.1-specific/zlib/prebuilt/win32/zlibstatic.lib", "external/wp_8.1-specific/OggDecoder/include/ogg/ogg.h", "external/wp_8.1-specific/OggDecoder/include/ogg/os_types.h", "external/wp_8.1-specific/OggDecoder/include/vorbis/codec.h", @@ -3422,8 +3451,12 @@ "external/wp_8.1-specific/angle/prebuilt/win32/libGLESv2.lib", "external/wp_8.1-specific/zlib/include/zconf.h", "external/wp_8.1-specific/zlib/include/zlib.h", + "external/wp_8.1-specific/zlib/prebuilt/arm/zlib.dll", "external/wp_8.1-specific/zlib/prebuilt/arm/zlib.lib", + "external/wp_8.1-specific/zlib/prebuilt/arm/zlibstatic.lib", + "external/wp_8.1-specific/zlib/prebuilt/win32/zlib.dll", "external/wp_8.1-specific/zlib/prebuilt/win32/zlib.lib", + "external/wp_8.1-specific/zlib/prebuilt/win32/zlibstatic.lib", "external/xxhash/CMakeLists.txt", "external/xxhash/xxhash.c", "external/xxhash/xxhash.h", @@ -3450,6 +3483,7 @@ "licenses/LICENSE_cocos2d-iphone.txt", "licenses/LICENSE_cocos2d-x.txt", "licenses/LICENSE_cocosdenshion.txt", + "licenses/LICENSE_com.android.vending.expansion.zipfile.txt", "licenses/LICENSE_curl.txt", "licenses/LICENSE_js.txt", "licenses/LICENSE_jsoncpp.txt", @@ -7045,6 +7079,9 @@ "cocos/scripting/lua-bindings/manual/video/lua_cocos2dx_experimental_video_manual.hpp", "cocos/scripting/lua-bindings/proj.android/Android.mk", "cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj", + "cocos/scripting/lua-bindings/proj.tizen/.cproject", + "cocos/scripting/lua-bindings/proj.tizen/.project", + "cocos/scripting/lua-bindings/proj.tizen/.tproject", "cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj", "cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters", "cocos/scripting/lua-bindings/script/3d/3dConstants.lua", @@ -7295,9 +7332,8 @@ "tools/bindings-generator/targets/spidermonkey/templates/sfunction_overloaded.c", "tools/bindings-generator/test/simple_test/simple_class.cpp", "tools/bindings-generator/test/simple_test/simple_class.h", - "tools/bindings-generator/test/test.bat", "tools/bindings-generator/test/test.ini", - "tools/bindings-generator/test/test.sh", + "tools/bindings-generator/test/test.py", "tools/bindings-generator/test/user.cfg.sample", "tools/bindings-generator/test/userconf.ini.sample", "tools/bindings-generator/tools/win32/", diff --git a/templates/cpp-template-default/Classes/AppDelegate.cpp b/templates/cpp-template-default/Classes/AppDelegate.cpp index f86118e788fc..eaa57d94e025 100644 --- a/templates/cpp-template-default/Classes/AppDelegate.cpp +++ b/templates/cpp-template-default/Classes/AppDelegate.cpp @@ -8,26 +8,25 @@ static cocos2d::Size smallResolutionSize = cocos2d::Size(480, 320); static cocos2d::Size mediumResolutionSize = cocos2d::Size(1024, 768); static cocos2d::Size largeResolutionSize = cocos2d::Size(2048, 1536); -AppDelegate::AppDelegate() { - +AppDelegate::AppDelegate() +{ } AppDelegate::~AppDelegate() { } -//if you want a different context,just modify the value of glContextAttrs -//it will takes effect on all platforms +// if you want a different context, modify the value of glContextAttrs +// it will affect all platforms void AppDelegate::initGLContextAttrs() { - //set OpenGL context attributions,now can only set six attributions: - //red,green,blue,alpha,depth,stencil + // set OpenGL context attributes: red,green,blue,alpha,depth,stencil GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8}; GLView::setGLContextAttrs(glContextAttrs); } -// If you want to use packages manager to install more packages, +// if you want to use the package manager to install more packages, // don't modify or remove this function static int register_all_packages() { @@ -83,11 +82,11 @@ bool AppDelegate::applicationDidFinishLaunching() { return true; } -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too +// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked. void AppDelegate::applicationDidEnterBackground() { Director::getInstance()->stopAnimation(); - // if you use SimpleAudioEngine, it must be pause + // if you use SimpleAudioEngine, it must be paused // SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); } diff --git a/templates/cpp-template-default/Classes/AppDelegate.h b/templates/cpp-template-default/Classes/AppDelegate.h index 625506cc0d1e..562ccbd96129 100644 --- a/templates/cpp-template-default/Classes/AppDelegate.h +++ b/templates/cpp-template-default/Classes/AppDelegate.h @@ -6,7 +6,7 @@ /** @brief The cocos2d Application. -The reason for implement as private inheritance is to hide some interface call by Director. +Private inheritance here hides part of interface from Director. */ class AppDelegate : private cocos2d::Application { @@ -24,13 +24,13 @@ class AppDelegate : private cocos2d::Application virtual bool applicationDidFinishLaunching(); /** - @brief The function be called when the application enter background + @brief Called when the application moves to the background @param the pointer of the application */ virtual void applicationDidEnterBackground(); /** - @brief The function be called when the application enter foreground + @brief Called when the application reenters the foreground @param the pointer of the application */ virtual void applicationWillEnterForeground(); diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.cpp b/templates/cpp-template-default/Classes/HelloWorldScene.cpp index a36d0ffc2ac8..1f9b3b8ff4f1 100644 --- a/templates/cpp-template-default/Classes/HelloWorldScene.cpp +++ b/templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -79,9 +79,17 @@ bool HelloWorld::init() void HelloWorld::menuCloseCallback(Ref* pSender) { + //Close the cocos2d-x game scene and quit the application Director::getInstance()->end(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) exit(0); #endif + + /*To navigate back to native iOS screen(if present) without quitting the application ,do not use Director::getInstance()->end() and exit(0) as given above,instead trigger a custom event created in RootViewController.mm as below*/ + + //EventCustom customEndEvent("game_scene_close_event"); + //_eventDispatcher->dispatchEvent(&customEndEvent); + + } diff --git a/templates/cpp-template-default/cocos-project-template.json b/templates/cpp-template-default/cocos-project-template.json index e5e3104fa380..12e64b517ac6 100644 --- a/templates/cpp-template-default/cocos-project-template.json +++ b/templates/cpp-template-default/cocos-project-template.json @@ -23,7 +23,8 @@ "proj.win10/PROJECT_NAME.sln", "proj.win10/App/PROJECT_NAME.vcxproj", "proj.win10/App/PROJECT_NAME.vcxproj.filters", - "proj.win10/App/PROJECT_NAME_TemporaryKey.pfx" + "proj.win10/App/PROJECT_NAME_TemporaryKey.pfx", + "proj.tizen/shared/res/PROJECT_NAME.png" ] }, "project_replace_project_name":{ @@ -57,7 +58,9 @@ "proj.win10/App/PROJECT_NAME.vcxproj", "proj.win10/App/PROJECT_NAME.vcxproj.filters", "proj.win10/App/Package.appxmanifest", - "CMakeLists.txt" + "CMakeLists.txt", + "proj.tizen/.project", + "proj.tizen/tizen-manifest.xml" ] }, "project_replace_package_name":{ @@ -65,7 +68,8 @@ "files":[ "proj.android/AndroidManifest.xml", "proj.android-studio/app/build.gradle", - "proj.android-studio/app/AndroidManifest.xml" + "proj.android-studio/app/AndroidManifest.xml", + "proj.tizen/tizen-manifest.xml" ] }, "project_replace_mac_bundleid": { diff --git a/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml b/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml index 2acf5adcf7fb..f8a8d00f4f07 100644 --- a/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml +++ b/templates/cpp-template-default/proj.android-studio/app/AndroidManifest.xml @@ -6,6 +6,7 @@ diff --git a/templates/cpp-template-default/proj.android/build_native.py b/templates/cpp-template-default/proj.android/build_native.py deleted file mode 100755 index 4c4026544a4d..000000000000 --- a/templates/cpp-template-default/proj.android/build_native.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/python -# build_native.py -# Build native codes -# -# Please use cocos console instead - - -import sys -import os, os.path -import shutil -from optparse import OptionParser - -def build(build_mode): - - - current_dir = os.path.dirname(os.path.realpath(__file__)) - cocos_root = os.path.join(current_dir, "../cocos2d") - - app_android_root = os.path.join(current_dir, "../") - - if build_mode is None: - build_mode = 'debug' - elif build_mode != 'release': - build_mode = 'debug' - - command = 'cocos compile -p android -s %s -m %s' % (app_android_root, build_mode) - if os.system(command) != 0: - raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") - -# -------------- main -------------- -if __name__ == '__main__': - - parser = OptionParser() - parser.add_option("-n", "--ndk", dest="ndk_build_param", help='it is not used', action="append") - parser.add_option("-p", "--platform", dest="android_platform", - help='it is not used') - parser.add_option("-b", "--build", dest="build_mode", - help='the build mode for java project,debug[default] or release.Get more information,please refer to http://developer.android.com/tools/building/building-cmdline.html') - (opts, args) = parser.parse_args() - - print "Please use cocos console instead.\n" - - build(opts.build_mode) diff --git a/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj b/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj index 1d1ec0875ba3..fc077016104c 100644 --- a/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj +++ b/templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj @@ -554,6 +554,7 @@ "$(_COCOS_LIB_IOS_END)", ); SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(_COCOS_HEADER_IOS_BEGIN) $(_COCOS_HEADER_IOS_END)"; VALID_ARCHS = "arm64 armv7"; @@ -584,6 +585,7 @@ "$(_COCOS_LIB_IOS_END)", ); SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(_COCOS_HEADER_IOS_BEGIN) $(_COCOS_HEADER_IOS_END)"; VALID_ARCHS = "arm64 armv7"; diff --git a/templates/cpp-template-default/proj.ios_mac/ios/AppController.mm b/templates/cpp-template-default/proj.ios_mac/ios/AppController.mm index 7c2dcfd8e52e..e01f8d561a08 100644 --- a/templates/cpp-template-default/proj.ios_mac/ios/AppController.mm +++ b/templates/cpp-template-default/proj.ios_mac/ios/AppController.mm @@ -23,7 +23,6 @@ of this software and associated documentation files (the "Software"), to deal ****************************************************************************/ #import "AppController.h" -#import "platform/ios/CCEAGLView-ios.h" #import "cocos2d.h" #import "AppDelegate.h" #import "RootViewController.h" @@ -40,31 +39,16 @@ @implementation AppController - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - cocos2d::Application *app = cocos2d::Application::getInstance(); - app->initGLContextAttrs(); - cocos2d::GLViewImpl::convertAttrs(); - + // 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]]; - // Init the CCEAGLView - CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: (NSString*)cocos2d::GLViewImpl::_pixelFormat - depthFormat: cocos2d::GLViewImpl::_depthFormat - preserveBackbuffer: NO - sharegroup: nil - multiSampling: NO - numberOfSamples: 0 ]; - - // Enable or disable multiple touches - [eaglView setMultipleTouchEnabled:NO]; - - // Use RootViewController manage CCEAGLView - _viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; + // Use RootViewController to manage CCEAGLView + _viewController = [[RootViewController alloc]init]; _viewController.wantsFullScreenLayout = YES; - _viewController.view = eaglView; + // Set RootViewController to window if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) @@ -82,11 +66,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [[UIApplication sharedApplication] setStatusBarHidden:true]; - // IMPORTANT: Setting the GLView should be done after creating the RootViewController - cocos2d::GLView *glview = cocos2d::GLViewImpl::createWithEAGLView(eaglView); - cocos2d::Director::getInstance()->setOpenGLView(glview); - - app->run(); return YES; } @@ -142,10 +121,14 @@ Free up as much memory as possible by purging cached data objects that can be re } +#if __has_feature(objc_arc) +#else - (void)dealloc { [window release]; + [_viewController release]; [super dealloc]; } +#endif @end diff --git a/templates/cpp-template-default/proj.ios_mac/ios/RootViewController.mm b/templates/cpp-template-default/proj.ios_mac/ios/RootViewController.mm index c4989af5fa8c..516a996a0ab5 100644 --- a/templates/cpp-template-default/proj.ios_mac/ios/RootViewController.mm +++ b/templates/cpp-template-default/proj.ios_mac/ios/RootViewController.mm @@ -27,6 +27,15 @@ of this software and associated documentation files (the "Software"), to deal #import "cocos2d.h" #import "platform/ios/CCEAGLView-ios.h" +@interface RootViewController() + + +@property(strong,nonatomic) CCEAGLView *eaglView; + +//dismisses the game scene and moves to native iOS screen + +//-(void)closeGameScene; +@end @implementation RootViewController /* @@ -45,13 +54,63 @@ - (void)loadView { } */ -/* + // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; + + cocos2d::Application *app = cocos2d::Application::getInstance(); + + //initialize the GLView attributes + app->initGLContextAttrs(); + cocos2d::GLViewImpl::convertAttrs(); + + //initialize the CCEAGLView + self.eaglView = [CCEAGLView viewWithFrame: [UIScreen mainScreen].bounds + pixelFormat: (NSString*)cocos2d::GLViewImpl::_pixelFormat + depthFormat: cocos2d::GLViewImpl::_depthFormat + preserveBackbuffer: NO + sharegroup: nil + multiSampling: NO + numberOfSamples: 0 ]; + + // Enable or disable multiple touches + [self.eaglView setMultipleTouchEnabled:NO]; + + /*Use the RootViewController to manage the CCEAGLView*/ + + //insert EAGLView as subview of RootViewController + [self.view insertSubview:self.eaglView atIndex:0]; + + //Create a custom event listener to listen to the custom event triggered by HelloWorldScene.cpp and add the event listener to the Director to close the game scene and move to native iOS screen(if present) without quitting the application + /* + cocos2d::EventListenerCustom *_listener = cocos2d::EventListenerCustom::create("game_scene_close_event", [=](cocos2d::EventCustom *gameCustomEvent){ + + printf("game_scene_close_event\n"); + + [self closeGameScene]; + + + }); + + cocos2d::Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_listener, 1); + + */ + + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + + cocos2d::GLView *glview = cocos2d::GLViewImpl::createWithEAGLView(self.eaglView); + + //set the GLView as OpenGLView of the Director + cocos2d::Director::getInstance()->setOpenGLView(glview); + + //run the cocos2d-x game scene + app->run(); + + } -*/ + // Override to allow orientations other than the default portrait orientation. // This method is deprecated on ios6 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { @@ -76,7 +135,7 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceO if (glview) { - CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView(); + CCEAGLView *eaglview = (__bridge CCEAGLView *)glview->getEAGLView(); if (eaglview) { @@ -99,16 +158,25 @@ - (void)didReceiveMemoryWarning { // Release any cached data, images, etc that aren't in use. } +//dismisses the game scene without quitting the application and navigates to native iOS screen + +/* +-(void)closeGameScene{ + + cocos2d::Director::getInstance()->end(); + + [self dismissViewControllerAnimated:YES completion:nil]; +} +*/ +- (void)viewDidDisappear:(BOOL)animated{ + + //manually release the CCEAGLView when closing the RootViewController + self.eaglView = nil; +} - (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/cpp-template-default/proj.ios_mac/ios/main.m b/templates/cpp-template-default/proj.ios_mac/ios/main.m index 8daa43e017d2..62178533b733 100644 --- a/templates/cpp-template-default/proj.ios_mac/ios/main.m +++ b/templates/cpp-template-default/proj.ios_mac/ios/main.m @@ -1,9 +1,7 @@ #import int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); - [pool release]; - return retVal; + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, @"AppController"); + } } diff --git a/templates/cpp-template-default/proj.tizen/.cproject b/templates/cpp-template-default/proj.tizen/.cproject new file mode 100644 index 000000000000..ed828ab30f47 --- /dev/null +++ b/templates/cpp-template-default/proj.tizen/.cproject @@ -0,0 +1,918 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/cpp-template-default/proj.tizen/.exportMap b/templates/cpp-template-default/proj.tizen/.exportMap new file mode 100644 index 000000000000..43e310e053e2 --- /dev/null +++ b/templates/cpp-template-default/proj.tizen/.exportMap @@ -0,0 +1,4 @@ +{ + global: main; + local: *; +}; diff --git a/templates/cpp-template-default/proj.tizen/.gitignore b/templates/cpp-template-default/proj.tizen/.gitignore new file mode 100644 index 000000000000..70a41975ef9b --- /dev/null +++ b/templates/cpp-template-default/proj.tizen/.gitignore @@ -0,0 +1,7 @@ +/SA_Report +/.sign +/crash-info +.checkers +.sdk_delta.info + +/Emulator diff --git a/templates/cpp-template-default/proj.tizen/.project b/templates/cpp-template-default/proj.tizen/.project new file mode 100644 index 000000000000..35b51e29c919 --- /dev/null +++ b/templates/cpp-template-default/proj.tizen/.project @@ -0,0 +1,65 @@ + + + HelloCpp + + + + + + org.tizen.nativecore.apichecker.apicheckerbuilder + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + org.tizen.nativecore.apichecker.core.builder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.tizen.nativecore.apichecker.core.tizenCppNature + org.tizen.nativecore.apichecker.apicheckernature + + + + Classes + 2 + PARENT-1-PROJECT_LOC/Classes + + + + + 1460537028087 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-projectRelativePath-matches-false-false-*/.tpk + + + + 1460537028097 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-projectRelativePath-matches-false-false-*/.tpk + + + + diff --git a/templates/cpp-template-default/proj.tizen/.tproject b/templates/cpp-template-default/proj.tizen/.tproject new file mode 100644 index 000000000000..824eaa1748c9 --- /dev/null +++ b/templates/cpp-template-default/proj.tizen/.tproject @@ -0,0 +1,12 @@ + + + + + mobile-2.4 + + + + + + + diff --git a/templates/cpp-template-default/proj.tizen/copy_resource.sh b/templates/cpp-template-default/proj.tizen/copy_resource.sh new file mode 100755 index 000000000000..9010488aeac9 --- /dev/null +++ b/templates/cpp-template-default/proj.tizen/copy_resource.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +cp -r ../../Resources/* ../res/ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp b/templates/cpp-template-default/proj.tizen/res/.gitkeep similarity index 100% rename from tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp rename to templates/cpp-template-default/proj.tizen/res/.gitkeep diff --git a/templates/cpp-template-default/proj.tizen/shared/res/HelloCpp.png b/templates/cpp-template-default/proj.tizen/shared/res/HelloCpp.png new file mode 100644 index 000000000000..a5b49ccbb199 Binary files /dev/null and b/templates/cpp-template-default/proj.tizen/shared/res/HelloCpp.png differ diff --git a/templates/cpp-template-default/proj.tizen/src/main.cpp b/templates/cpp-template-default/proj.tizen/src/main.cpp new file mode 100644 index 000000000000..e4e664a7206f --- /dev/null +++ b/templates/cpp-template-default/proj.tizen/src/main.cpp @@ -0,0 +1,20 @@ +#include "AppDelegate.h" + +#include +#include +#include +#include +#include + +USING_NS_CC; + +int main(int argc, char **argv) +{ + // create the application instance + AppDelegate app; +#ifdef TIZEN + Application::getInstance()->setMainArgs(argc, argv);//For Tizen 2.4, we need these two arguments. +#endif + Application::getInstance()->setDeviceOrientation(APP_DEVICE_ORIENTATION_90); + return Application::getInstance()->run(); +} diff --git a/templates/cpp-template-default/proj.tizen/tizen-manifest.xml b/templates/cpp-template-default/proj.tizen/tizen-manifest.xml new file mode 100644 index 000000000000..665d9fc3ab22 --- /dev/null +++ b/templates/cpp-template-default/proj.tizen/tizen-manifest.xml @@ -0,0 +1,7 @@ + + + + + HelloCpp.png + + diff --git a/templates/cpp-template-default/proj.win10/App/App.xaml b/templates/cpp-template-default/proj.win10/App/App.xaml index dfdb2af4f113..4851359f9ef2 100644 --- a/templates/cpp-template-default/proj.win10/App/App.xaml +++ b/templates/cpp-template-default/proj.win10/App/App.xaml @@ -5,126 +5,9 @@ xmlns:local="using:CocosAppWinRT" xmlns:localData="using:Shared"> - - - - - HelloCpp - + + + HelloCpp + + diff --git a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.cpp b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.cpp index 7e329b48557c..a46169445cb8 100644 --- a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.cpp +++ b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.cpp @@ -20,7 +20,6 @@ #include "AppDelegate.h" #include "platform/winrt/CCGLViewImpl-winrt.h" #include "platform/CCApplication.h" -#include "cocos2d.h" #include "renderer/CCTextureCache.h" // These are used by the shader compilation methods. diff --git a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.h b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.h index 5da628c459cd..49319358b50c 100644 --- a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.h +++ b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.h @@ -19,7 +19,7 @@ #include -#include "cocos2d.h" + class AppDelegate; diff --git a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml index c8e3e922f97a..b59232a2fa6f 100644 --- a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml +++ b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml @@ -8,21 +8,6 @@ mc:Ignorable="d"> - - - - - - + diff --git a/templates/cpp-template-default/proj.win10/App/HelloCpp.vcxproj b/templates/cpp-template-default/proj.win10/App/HelloCpp.vcxproj index e42546c5f660..85b38afda956 100644 --- a/templates/cpp-template-default/proj.win10/App/HelloCpp.vcxproj +++ b/templates/cpp-template-default/proj.win10/App/HelloCpp.vcxproj @@ -1,4 +1,4 @@ - + {187d3e60-961a-41ee-bc18-c510a431d22e} @@ -125,7 +125,7 @@ HelloCpp_TemporaryKey.pfx - 69E61EED9D75298C20C00383913E70404878E922 + A65425A251E18D5D9AE2DC68E216D4AB8C0B5C18 false @@ -293,4 +293,4 @@ - + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win10/App/HelloCpp_TemporaryKey.pfx b/templates/cpp-template-default/proj.win10/App/HelloCpp_TemporaryKey.pfx index 5c4447a929f0..b1c58aeceb18 100644 Binary files a/templates/cpp-template-default/proj.win10/App/HelloCpp_TemporaryKey.pfx and b/templates/cpp-template-default/proj.win10/App/HelloCpp_TemporaryKey.pfx differ diff --git a/templates/cpp-template-default/proj.win8.1-universal/App.Shared/App.xaml b/templates/cpp-template-default/proj.win8.1-universal/App.Shared/App.xaml index 60186cc73820..4851359f9ef2 100644 --- a/templates/cpp-template-default/proj.win8.1-universal/App.Shared/App.xaml +++ b/templates/cpp-template-default/proj.win8.1-universal/App.Shared/App.xaml @@ -2,128 +2,12 @@ x:Class="CocosAppWinRT.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:CocosAppWinRT"> + xmlns:local="using:CocosAppWinRT" + xmlns:localData="using:Shared"> - - - - - HelloCpp - -
\ No newline at end of file + + + HelloCpp + + + diff --git a/templates/cpp-template-default/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml b/templates/cpp-template-default/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml index 3b6ea858d119..b59232a2fa6f 100644 --- a/templates/cpp-template-default/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml +++ b/templates/cpp-template-default/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml @@ -7,7 +7,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - - + + + 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 cf5b513ee401..92c261161a86 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 @@ -1,4 +1,4 @@ - + @@ -114,7 +114,7 @@ HelloCpp.Windows_TemporaryKey.pfx True x86 - BF581B3BB7204EE28C310DA2AFC1D084BEA81274 + D1342F9E64B60E24773C7E212EA97270DF0B3470
@@ -214,4 +214,4 @@ - + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.win8.1-universal/App.Windows/HelloCpp.Windows_TemporaryKey.pfx b/templates/cpp-template-default/proj.win8.1-universal/App.Windows/HelloCpp.Windows_TemporaryKey.pfx index a5ee8feeb916..9cff791f6911 100644 Binary files a/templates/cpp-template-default/proj.win8.1-universal/App.Windows/HelloCpp.Windows_TemporaryKey.pfx and b/templates/cpp-template-default/proj.win8.1-universal/App.Windows/HelloCpp.Windows_TemporaryKey.pfx differ diff --git a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp index 940376784ec5..caee6b69d088 100644 --- a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -162,7 +162,7 @@ bool AppDelegate::applicationDidFinishLaunching() return true; } -// This function will be called when the app is inactive. When comes a phone call,it's be invoked too +// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked. void AppDelegate::applicationDidEnterBackground() { auto director = Director::getInstance(); diff --git a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.h b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.h index fc614c95af71..d1c0058e44f1 100644 --- a/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.h +++ b/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.h @@ -13,7 +13,7 @@ /** @brief The cocos2d Application. - The reason for implement as private inheritance is to hide some interface call by Director. + Private inheritance here hides part of interface from Director. */ class AppDelegate : private cocos2d::Application { @@ -31,13 +31,13 @@ class AppDelegate : private cocos2d::Application virtual bool applicationDidFinishLaunching(); /** - @brief The function be called when the application enter background + @brief Called when the application moves to the background @param the pointer of the application */ virtual void applicationDidEnterBackground(); /** - @brief The function be called when the application enter foreground + @brief Called when the application reenters the foreground @param the pointer of the application */ virtual void applicationWillEnterForeground(); 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 index 59cb2ffb847d..7c53b4d93c05 100644 --- 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 @@ -6,6 +6,7 @@ diff --git a/templates/js-template-default/frameworks/runtime-src/proj.android/build_native.py b/templates/js-template-default/frameworks/runtime-src/proj.android/build_native.py deleted file mode 100755 index 576b43e3ef3a..000000000000 --- a/templates/js-template-default/frameworks/runtime-src/proj.android/build_native.py +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/python - -''' -build_native.py - -This script will copy resources to assets and build native code with NDK. -''' -import sys -import os, os.path -import shutil -from optparse import OptionParser - -def get_num_of_cpu(): - ''' The build process can be accelerated by running multiple concurrent job processes using the -j-option. - ''' - try: - platform = sys.platform - if platform == 'win32': - if 'NUMBER_OF_PROCESSORS' in os.environ: - return int(os.environ['NUMBER_OF_PROCESSORS']) - else: - return 1 - else: - from numpy.distutils import cpuinfo - return cpuinfo.cpu._getNCPUs() - except Exception: - print "Can't know cpuinfo, use default 1 cpu" - return 1 - -def check_environment_variables(): - ''' Checking the environment NDK_ROOT, which will be used for building - ''' - - try: - NDK_ROOT = os.environ['NDK_ROOT'] - except Exception: - print "NDK_ROOT not defined. Please define NDK_ROOT in your environment" - sys.exit(1) - - return NDK_ROOT - -def select_toolchain_version(ndk_root): - ret_version = "4.8" - - version_file_path = os.path.join(ndk_root, "RELEASE.TXT") - try: - versionFile = open(version_file_path) - lines = versionFile.readlines() - versionFile.close() - - version_num = None - version_char = None - pattern = r'^[a-zA-Z]+(\d+)(\w)' - for line in lines: - str_line = line.lstrip() - match = re.match(pattern, str_line) - if match: - version_num = int(match.group(1)) - version_char = match.group(2) - break - - if version_num is None: - print("Parse NDK version from file %s failed." % version_file_path) - else: - version_char = version_char.lower() - if version_num > 10 or (version_num == 10 and cmp(version_char, 'c') >= 0): - ret_version = "4.9" - - except: - print("Parse NDK version from file %s failed." % version_file_path) - - print("NDK_TOOLCHAIN_VERSION: %s" % ret_version) - if ret_version == "4.8": - print( - "Your application may crash when using c++ 11 regular expression with NDK_TOOLCHAIN_VERSION %s" % ret_version) - - return ret_version - -def do_build(cocos_root, ndk_root, app_android_root, ndk_build_param,sdk_root,build_mode): - - ndk_path = os.path.join(ndk_root, "ndk-build") - ndk_toolchain_version = select_toolchain_version(ndk_root) - - # windows should use ";" to seperate module paths - platform = sys.platform - if platform == 'win32': - ndk_module_path = 'NDK_MODULE_PATH=%s/..;%s;%s/external;%s/cocos NDK_TOOLCHAIN_VERSION=%s' % (cocos_root, cocos_root, cocos_root, cocos_root, ndk_toolchain_version) - else: - ndk_module_path = 'NDK_MODULE_PATH=%s/..:%s:%s/external:%s/cocos NDK_TOOLCHAIN_VERSION=%s' % (cocos_root, cocos_root, cocos_root, cocos_root, ndk_toolchain_version) - - num_of_cpu = get_num_of_cpu() - if ndk_build_param == None: - command = '%s -j%d -C %s NDK_DEBUG=%d %s' % (ndk_path, num_of_cpu, app_android_root, build_mode=='debug', ndk_module_path) - else: - command = '%s -j%d -C %s NDK_DEBUG=%d %s %s' % (ndk_path, num_of_cpu, app_android_root, build_mode=='debug', ndk_build_param, ndk_module_path) - print command - if os.system(command) != 0: - raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") - -def copy_files(src, dst): - - for item in os.listdir(src): - path = os.path.join(src, item) - # Android can not package the file that ends with ".gz" - if not item.startswith('.') and not item.endswith('.gz') and os.path.isfile(path): - shutil.copy(path, dst) - if os.path.isdir(path): - new_dst = os.path.join(dst, item) - os.mkdir(new_dst) - copy_files(path, new_dst) - -def copy_resources(app_android_root): - - # remove app_android_root/assets if it exists - assets_dir = os.path.join(app_android_root, "assets") - if os.path.isdir(assets_dir): - shutil.rmtree(assets_dir) - - # copy resources - os.mkdir(assets_dir) - - assets_res_dir = assets_dir + "/res"; - assets_scripts_dir = assets_dir + "/src"; - assets_jsb_dir = assets_dir + "/script"; - os.mkdir(assets_res_dir); - os.mkdir(assets_scripts_dir); - os.mkdir(assets_jsb_dir); - - - shutil.copy(os.path.join(app_android_root, "../../../main.js"), assets_dir) - shutil.copy(os.path.join(app_android_root, "../../../project.json"), assets_dir) - - resources_dir = os.path.join(app_android_root, "../../../res") - copy_files(resources_dir, assets_res_dir) - - resources_dir = os.path.join(app_android_root, "../../../src") - copy_files(resources_dir, assets_scripts_dir) - - resources_dir = os.path.join(app_android_root, "../../../frameworks/cocos2d-x/cocos/js-bindings/bindings/script") - copy_files(resources_dir, assets_jsb_dir) - -def build(targets,ndk_build_param,build_mode): - - ndk_root = check_environment_variables() - sdk_root = None - - project_root = os.path.dirname(os.path.realpath(__file__)) - cocos_root = os.path.join(project_root, "..", "..", "cocos2d-x") - - print cocos_root - - if build_mode is None: - build_mode = 'debug' - elif build_mode != 'release': - build_mode = 'debug' - - copy_resources(project_root) - do_build(cocos_root, ndk_root, project_root,ndk_build_param,sdk_root,build_mode) - -# -------------- main -------------- -if __name__ == '__main__': - - parser = OptionParser() - parser.add_option("-n", "--ndk", dest="ndk_build_param", - help='Parameter for ndk-build') - parser.add_option("-b", "--build", dest="build_mode", - help='The build mode for NDK project, debug or release') - (opts, args) = parser.parse_args() - - try: - build(args, opts.ndk_build_param,opts.build_mode) - except Exception as e: - print e - sys.exit(1) diff --git a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj index 3efca65d41fc..ed1226b241a9 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj +++ b/templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -897,6 +897,7 @@ LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ""; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/ios $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/auto $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/manual $(SRCROOT)/../../cocos2d-x/cocos"; VALID_ARCHS = "arm64 armv7"; @@ -921,6 +922,7 @@ LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ""; SDKROOT = iphoneos; + STRIP_PNG_TEXT = NO; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../cocos2d-x/external/spidermonkey/include/ios $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/auto $(SRCROOT)/../../cocos2d-x/plugin/jsbindings/manual $(SRCROOT)/../../cocos2d-x/cocos"; VALID_ARCHS = "arm64 armv7"; diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml index c8e3e922f97a..b59232a2fa6f 100644 --- a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml +++ b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Shared/OpenGLESPage.xaml @@ -8,21 +8,6 @@ mc:Ignorable="d"> - - - - - - + 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 f9418a51e8ef..faa1f99c8446 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 @@ -114,7 +114,7 @@ TemporaryKey.pfx True x86 - 7BE2570D98E1798E21D435C4F19076AFEB9AE074 + 78049EAB4980D535620EA948E9C4A302EAA34D2E diff --git a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/TemporaryKey.pfx b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/TemporaryKey.pfx index d81d48f986fe..688c22a57cf8 100644 Binary files a/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/TemporaryKey.pfx and b/templates/js-template-default/frameworks/runtime-src/proj.win8.1-universal/App.Windows/TemporaryKey.pfx differ diff --git a/templates/js-template-default/index.html b/templates/js-template-default/index.html index a049999ace07..9598bb665e58 100644 --- a/templates/js-template-default/index.html +++ b/templates/js-template-default/index.html @@ -4,23 +4,37 @@ Cocos2d-html5 Hello World test - - + + + + + + + + + + + + + + + + - - + + + + + + + + - +