diff --git a/cocos/scripting/js-bindings/CMakeLists.txt b/cocos/scripting/js-bindings/CMakeLists.txt index a233d6cf04..1535202769 100644 --- a/cocos/scripting/js-bindings/CMakeLists.txt +++ b/cocos/scripting/js-bindings/CMakeLists.txt @@ -69,7 +69,6 @@ set(JSBINDING_SRC manual/spine/jsb_cocos2dx_spine_manual.cpp manual/ui/jsb_cocos2dx_ui_manual.cpp manual/3d/jsb_cocos2dx_3d_manual.cpp - manual/experimental/jsb_cocos2dx_experimental_manual.cpp manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp ${cocos_root}/cocos/storage/local-storage/LocalStorage.cpp ) diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 8a6cc64c96..72eda51986 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -5946,9 +5946,14 @@ void js_register_cocos2dx_AutoPolygon(JSContext *cx, JS::HandleObject global) { void register_cocos2dx_js_core(JSContext* cx, JS::HandleObject global) { JS::RootedObject ccObj(cx); + JS::RootedObject jsbObj(cx); JS::RootedValue tmpVal(cx); JS::RootedObject tmpObj(cx); get_or_create_js_obj(cx, global, "cc", &ccObj); + get_or_create_js_obj(cx, global, "jsb", &jsbObj); + + js_register_cocos2dx_PolygonInfo(cx, jsbObj); + js_register_cocos2dx_AutoPolygon(cx, jsbObj); JS_GetProperty(cx, ccObj, "PlistParser", &tmpVal); tmpObj = tmpVal.toObjectOrNull(); diff --git a/cocos/scripting/js-bindings/manual/experimental/jsb_cocos2dx_experimental_manual.cpp b/cocos/scripting/js-bindings/manual/experimental/jsb_cocos2dx_experimental_manual.cpp deleted file mode 100644 index f2ba6b0dbb..0000000000 --- a/cocos/scripting/js-bindings/manual/experimental/jsb_cocos2dx_experimental_manual.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2011 Zynga Inc. - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "jsb_cocos2dx_experimental_manual.h" -#include "cocos2d_specifics.hpp" - - - -bool jsval_to_vector_unsigned_short(JSContext* cx, JS::HandleValue v, std::vector* ret) -{ - JS::RootedObject jsArr(cx); - bool ok = v.isObject() && JS_ValueToObject( cx, v, &jsArr ); - JSB_PRECONDITION3( ok, cx, false, "Error converting value to object"); - JSB_PRECONDITION3( jsArr && JS_IsArrayObject( cx, jsArr), cx, false, "Object must be an array"); - - uint32_t len = 0; - JS_GetArrayLength(cx, jsArr, &len); - ret->reserve(len); - - for (uint32_t i=0; i < len; i++) - { - JS::RootedValue value(cx); - if (JS_GetElement(cx, jsArr, i, &value)) - { - unsigned short index; - ok &= jsval_to_uint16(cx, value, &index); - ret->push_back(index); - } - } - return ok; -} - - - -void register_all_cocos2dx_experimental_manual(JSContext *cx, JS::HandleObject global) -{ - JS::RootedObject ccObj(cx); - get_or_create_js_obj(cx, global, "ccexp", &ccObj); -} \ No newline at end of file diff --git a/cocos/scripting/js-bindings/manual/experimental/jsb_cocos2dx_experimental_manual.h b/cocos/scripting/js-bindings/manual/experimental/jsb_cocos2dx_experimental_manual.h deleted file mode 100644 index d75484d697..0000000000 --- a/cocos/scripting/js-bindings/manual/experimental/jsb_cocos2dx_experimental_manual.h +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2011 Zynga Inc. - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#ifndef __jsb_cococs2dx_experimental_h__ -#define __jsb_cococs2dx_experimental_h__ - - -#include "jsapi.h" - -void register_all_cocos2dx_experimental_manual(JSContext *cx, JS::HandleObject global); - -#endif \ No newline at end of file diff --git a/cocos/scripting/js-bindings/proj.android/Android.mk b/cocos/scripting/js-bindings/proj.android/Android.mk index 0cd74cfb2e..e463c5d3ad 100755 --- a/cocos/scripting/js-bindings/proj.android/Android.mk +++ b/cocos/scripting/js-bindings/proj.android/Android.mk @@ -74,7 +74,6 @@ LOCAL_SRC_FILES := ../auto/jsb_cocos2dx_3d_auto.cpp \ ../manual/network/XMLHTTPRequest.cpp \ ../manual/spine/jsb_cocos2dx_spine_manual.cpp \ ../manual/ui/jsb_cocos2dx_ui_manual.cpp \ - ../manual/experimental/jsb_cocos2dx_experimental_manual.cpp \ ../manual/physics3d/jsb_cocos2dx_physics3d_manual.cpp diff --git a/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj b/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj index ac86f0a236..0d5d366619 100644 --- a/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/js-bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj @@ -154,10 +154,6 @@ 426390051B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426390021B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp */; }; 426390061B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 426390031B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h */; }; 426390071B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 426390031B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h */; }; - 42AD25731AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42AD25711AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.cpp */; }; - 42AD25741AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42AD25711AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.cpp */; }; - 42AD25751AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 42AD25721AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.h */; }; - 42AD25761AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 42AD25721AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.h */; }; 4B22F4AA1B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B22F4A71B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.cpp */; }; 4B22F4AB1B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B22F4A81B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.h */; }; 4B22F4AC1B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B22F4A81B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.h */; }; @@ -281,8 +277,6 @@ 42638FFC1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_physics3d_auto.hpp; sourceTree = ""; }; 426390021B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_physics3d_manual.cpp; sourceTree = ""; }; 426390031B0EC1C6004C53A2 /* jsb_cocos2dx_physics3d_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_cocos2dx_physics3d_manual.h; sourceTree = ""; }; - 42AD25711AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_cocos2dx_experimental_manual.cpp; path = experimental/jsb_cocos2dx_experimental_manual.cpp; sourceTree = ""; }; - 42AD25721AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_cocos2dx_experimental_manual.h; path = experimental/jsb_cocos2dx_experimental_manual.h; sourceTree = ""; }; 4B22F4A71B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_cocos2dx_experimental_webView_manual.cpp; path = experimental/jsb_cocos2dx_experimental_webView_manual.cpp; sourceTree = ""; }; 4B22F4A81B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_cocos2dx_experimental_webView_manual.h; path = experimental/jsb_cocos2dx_experimental_webView_manual.h; sourceTree = ""; }; 4BE089E01ADF965E00D65D4B /* jsb_cocos2dx_experimental_webView_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_experimental_webView_auto.cpp; sourceTree = ""; }; @@ -584,8 +578,6 @@ B38AD5691B1D384A0057DD7F /* jsb_cocos2dx_experimental_video_manual.h */, 4B22F4A71B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.cpp */, 4B22F4A81B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.h */, - 42AD25711AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.cpp */, - 42AD25721AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.h */, ); name = experimental; sourceTree = ""; @@ -643,7 +635,6 @@ 1A119EEF18BDF19200352BAA /* js_bindings_system_functions.h in Headers */, 1A119EDD18BDF19200352BAA /* js_manual_conversions.h in Headers */, 1A119EFD18BDF19200352BAA /* XMLHTTPRequest.h in Headers */, - 42AD25751AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.h in Headers */, 1AB5E63518D05BF30088DAA4 /* jsb_cocos2dx_ui_manual.h in Headers */, 1A119EE318BDF19200352BAA /* jsb_opengl_functions.h in Headers */, 42638FFF1B0EC1B7004C53A2 /* jsb_cocos2dx_physics3d_auto.hpp in Headers */, @@ -684,7 +675,6 @@ 1A119EB618BDF19200352BAA /* js_bindings_chipmunk_manual.h in Headers */, 1A119EFA18BDF19200352BAA /* jsb_websocket.h in Headers */, 1A119E9218BDF19200352BAA /* jsb_cocos2dx_extension_auto.hpp in Headers */, - 42AD25761AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.h in Headers */, 4B22F4AC1B159A7A0044C14E /* jsb_cocos2dx_experimental_webView_manual.h in Headers */, 1A119E8C18BDF19200352BAA /* jsb_cocos2dx_builder_auto.hpp in Headers */, 4BE089E51ADF965E00D65D4B /* jsb_cocos2dx_experimental_webView_auto.hpp in Headers */, @@ -804,7 +794,6 @@ 0541A7501973876100E45470 /* JavaScriptObjCBridge.mm in Sources */, 1A119EB318BDF19200352BAA /* js_bindings_chipmunk_manual.cpp in Sources */, 1A119EE918BDF19200352BAA /* jsb_opengl_registration.cpp in Sources */, - 42AD25731AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.cpp in Sources */, 1A119EF718BDF19200352BAA /* jsb_websocket.cpp in Sources */, 1A119ED318BDF19200352BAA /* js_bindings_core.cpp in Sources */, 1A119EC118BDF19200352BAA /* js_bindings_ccbreader.cpp in Sources */, @@ -867,7 +856,6 @@ 1A119EE618BDF19200352BAA /* jsb_opengl_manual.cpp in Sources */, 1A119F0618BDF19200352BAA /* jsb_cocos2dx_spine_manual.cpp in Sources */, BA623E0F191A195F00761F37 /* jsb_pluginx_manual_protocols.cpp in Sources */, - 42AD25741AFF9E17000176E2 /* jsb_cocos2dx_experimental_manual.cpp in Sources */, BA623E13191A195F00761F37 /* pluginxUTF8.cpp in Sources */, BAEE4D721AC3FFAD003BEB0F /* jsb_cocos2dx_3d_extension_auto.cpp in Sources */, 1A119EB818BDF19200352BAA /* js_bindings_chipmunk_registration.cpp in Sources */, diff --git a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj index 4eb40ed7af..a5bd3de07f 100644 --- a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj +++ b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj @@ -30,7 +30,6 @@ - @@ -72,7 +71,6 @@ - diff --git a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj.filters b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj.filters index c4e49936c6..ff501e6183 100644 --- a/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj.filters +++ b/cocos/scripting/js-bindings/proj.win32/libjscocos2d.vcxproj.filters @@ -146,9 +146,6 @@ auto - - manual\experimental - auto @@ -280,9 +277,6 @@ auto - - manual\experimental - auto diff --git a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems index 409eb85c05..95bde767c9 100644 --- a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems +++ b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems @@ -36,7 +36,6 @@ - @@ -80,7 +79,6 @@ - diff --git a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems.filters b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems.filters index 6824d69c63..41ffdfe1d8 100644 --- a/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems.filters +++ b/cocos/scripting/js-bindings/proj.win8.1-universal/libjscocos2d/libjscocos2d.Shared/libjscocos2d.Shared.vcxitems.filters @@ -125,9 +125,6 @@ auto - - manual\experimental - auto @@ -238,9 +235,6 @@ auto - - manual\experimental - auto diff --git a/tests/js-tests/project/Classes/AppDelegate.cpp b/tests/js-tests/project/Classes/AppDelegate.cpp index 5fef22b781..bb41c01a83 100644 --- a/tests/js-tests/project/Classes/AppDelegate.cpp +++ b/tests/js-tests/project/Classes/AppDelegate.cpp @@ -11,7 +11,6 @@ #include "jsb_cocos2dx_3d_extension_auto.hpp" #include "jsb_cocos2dx_physics3d_auto.hpp" #include "physics3d/jsb_cocos2dx_physics3d_manual.h" -#include "experimental/jsb_cocos2dx_experimental_manual.h" #include "3d/jsb_cocos2dx_3d_manual.h" #include "extension/jsb_cocos2dx_extension_manual.h" #include "cocostudio/jsb_cocos2dx_studio_manual.h" @@ -115,8 +114,6 @@ bool AppDelegate::applicationDidFinishLaunching() sc->addRegisterCallback(register_all_cocos2dx_3d_manual); sc->addRegisterCallback(register_all_cocos2dx_3d_extension); - - sc->addRegisterCallback(register_all_cocos2dx_experimental_manual); sc->addRegisterCallback(register_all_cocos2dx_physics3d); sc->addRegisterCallback(register_all_cocos2dx_physics3d_manual);