mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3_combine_2d
Conflicts: tools/bindings-generator
This commit is contained in:
commit
70b9183ddb
|
@ -840,14 +840,14 @@ bool Label::updateQuads()
|
||||||
_reusedRect.size.height -= clipTop;
|
_reusedRect.size.height -= clipTop;
|
||||||
py -= clipTop;
|
py -= clipTop;
|
||||||
}
|
}
|
||||||
if (py - letterDef.height < _tailoredBottomY)
|
if (py - letterDef.height * _bmfontScale < _tailoredBottomY)
|
||||||
{
|
{
|
||||||
_reusedRect.size.height = (py < _tailoredBottomY) ? 0.f : (py - _tailoredBottomY);
|
_reusedRect.size.height = (py < _tailoredBottomY) ? 0.f : (py - _tailoredBottomY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!_enableWrap){
|
if(!_enableWrap){
|
||||||
auto px = _lettersInfo[ctr].positionX + letterDef.width/2 + _linesOffsetX[_lettersInfo[ctr].lineIndex];
|
auto px = _lettersInfo[ctr].positionX + letterDef.width/2 * _bmfontScale + _linesOffsetX[_lettersInfo[ctr].lineIndex];
|
||||||
if(_labelWidth > 0.f){
|
if(_labelWidth > 0.f){
|
||||||
if (px > _contentSize.width || px < 0) {
|
if (px > _contentSize.width || px < 0) {
|
||||||
if(_overflow == Overflow::CLAMP){
|
if(_overflow == Overflow::CLAMP){
|
||||||
|
|
|
@ -267,7 +267,7 @@ bool Label::isHorizontalClamp()
|
||||||
{
|
{
|
||||||
auto& letterDef = _fontAtlas->_letterDefinitions[_lettersInfo[ctr].utf16Char];
|
auto& letterDef = _fontAtlas->_letterDefinitions[_lettersInfo[ctr].utf16Char];
|
||||||
|
|
||||||
auto px = _lettersInfo[ctr].positionX + letterDef.width/2;
|
auto px = _lettersInfo[ctr].positionX + letterDef.width/2 * _bmfontScale;
|
||||||
if(_labelWidth > 0.f){
|
if(_labelWidth > 0.f){
|
||||||
if (px > _contentSize.width) {
|
if (px > _contentSize.width) {
|
||||||
letterClamp = true;
|
letterClamp = true;
|
||||||
|
|
|
@ -34,6 +34,10 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
// EXPERIMENTAL: Enable this in order to get rid of retain/release
|
||||||
|
// when using the Garbage Collector
|
||||||
|
#define CC_ENABLE_GC_FOR_NATIVE_OBJECTS 0
|
||||||
|
|
||||||
#if CC_REF_LEAK_DETECTION
|
#if CC_REF_LEAK_DETECTION
|
||||||
static void trackRef(Ref* ref);
|
static void trackRef(Ref* ref);
|
||||||
static void untrackRef(Ref* ref);
|
static void untrackRef(Ref* ref);
|
||||||
|
@ -41,12 +45,16 @@ static void untrackRef(Ref* ref);
|
||||||
|
|
||||||
Ref::Ref()
|
Ref::Ref()
|
||||||
: _referenceCount(1) // when the Ref is created, the reference count of it is 1
|
: _referenceCount(1) // when the Ref is created, the reference count of it is 1
|
||||||
|
#if CC_ENABLE_SCRIPT_BINDING
|
||||||
|
, _luaID (0)
|
||||||
|
, _scriptObject(nullptr)
|
||||||
|
, _rooted(false)
|
||||||
|
, _scriptOwned(false)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
#if CC_ENABLE_SCRIPT_BINDING
|
#if CC_ENABLE_SCRIPT_BINDING
|
||||||
static unsigned int uObjectCount = 0;
|
static unsigned int uObjectCount = 0;
|
||||||
_luaID = 0;
|
|
||||||
_ID = ++uObjectCount;
|
_ID = ++uObjectCount;
|
||||||
_scriptObject = nullptr;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CC_REF_LEAK_DETECTION
|
#if CC_REF_LEAK_DETECTION
|
||||||
|
@ -83,6 +91,18 @@ void Ref::retain()
|
||||||
{
|
{
|
||||||
CCASSERT(_referenceCount > 0, "reference count should be greater than 0");
|
CCASSERT(_referenceCount > 0, "reference count should be greater than 0");
|
||||||
++_referenceCount;
|
++_referenceCount;
|
||||||
|
|
||||||
|
#if CC_ENABLE_SCRIPT_BINDING && CC_ENABLE_GC_FOR_NATIVE_OBJECTS
|
||||||
|
if (!_rooted && _scriptOwned)
|
||||||
|
{
|
||||||
|
auto scriptMgr = ScriptEngineManager::getInstance()->getScriptEngine();
|
||||||
|
if (scriptMgr && scriptMgr->getScriptType() == kScriptTypeJavascript)
|
||||||
|
{
|
||||||
|
scriptMgr->rootObject(this);
|
||||||
|
_rooted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // CC_ENABLE_SCRIPT_BINDING
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ref::release()
|
void Ref::release()
|
||||||
|
@ -90,6 +110,18 @@ void Ref::release()
|
||||||
CCASSERT(_referenceCount > 0, "reference count should be greater than 0");
|
CCASSERT(_referenceCount > 0, "reference count should be greater than 0");
|
||||||
--_referenceCount;
|
--_referenceCount;
|
||||||
|
|
||||||
|
#if CC_ENABLE_SCRIPT_BINDING && CC_ENABLE_GC_FOR_NATIVE_OBJECTS
|
||||||
|
if (_scriptOwned && _referenceCount==1 && _rooted)
|
||||||
|
{
|
||||||
|
auto scriptMgr = ScriptEngineManager::getInstance()->getScriptEngine();
|
||||||
|
if (scriptMgr && scriptMgr->getScriptType() == kScriptTypeJavascript)
|
||||||
|
{
|
||||||
|
scriptMgr->unrootObject(this);
|
||||||
|
_rooted = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // CC_ENABLE_SCRIPT_BINDING
|
||||||
|
|
||||||
if (_referenceCount == 0)
|
if (_referenceCount == 0)
|
||||||
{
|
{
|
||||||
#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)
|
#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)
|
||||||
|
|
|
@ -156,6 +156,20 @@ public:
|
||||||
int _luaID;
|
int _luaID;
|
||||||
/// scriptObject, support for swift
|
/// scriptObject, support for swift
|
||||||
void* _scriptObject;
|
void* _scriptObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
When true, it means that the object was already rooted.
|
||||||
|
*/
|
||||||
|
bool _rooted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The life of the object is scrolled by the scripting engine.
|
||||||
|
*
|
||||||
|
* When the object is controlled by the scripting engine
|
||||||
|
* some additional logic is performed, like Rooting/Unrooting
|
||||||
|
* the object when retain/release is called.
|
||||||
|
*/
|
||||||
|
bool _scriptOwned;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Memory leak diagnostic data (only included when CC_REF_LEAK_DETECTION is defined and its value isn't zero)
|
// Memory leak diagnostic data (only included when CC_REF_LEAK_DETECTION is defined and its value isn't zero)
|
||||||
|
|
|
@ -750,6 +750,17 @@ public:
|
||||||
* @js NA
|
* @js NA
|
||||||
*/
|
*/
|
||||||
virtual bool parseConfig(ConfigType type, const std::string& str) = 0;
|
virtual bool parseConfig(ConfigType type, const std::string& str) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/** Root a Reference.
|
||||||
|
It tells the Garbage Collector that the associated Scripting object should not be collected
|
||||||
|
*/
|
||||||
|
virtual void rootObject(Ref* obj) {}
|
||||||
|
|
||||||
|
/** Unroot a Reference.
|
||||||
|
It tells the Garbage Collector that the associated Scripting object can be collected
|
||||||
|
*/
|
||||||
|
virtual void unrootObject(Ref* obj) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Node;
|
class Node;
|
||||||
|
|
|
@ -70,7 +70,7 @@ void SkeletonRenderer::initialize () {
|
||||||
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
|
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
|
||||||
setOpacityModifyRGB(true);
|
setOpacityModifyRGB(true);
|
||||||
|
|
||||||
setGLProgram(ShaderCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
|
setGLProgram(GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkeletonRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsSkeletonData) {
|
void SkeletonRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsSkeletonData) {
|
||||||
|
|
|
@ -432,26 +432,6 @@ BillBoard : function (
|
||||||
*/
|
*/
|
||||||
jsb.Mesh = {
|
jsb.Mesh = {
|
||||||
|
|
||||||
/**
|
|
||||||
* @method setTexture
|
|
||||||
* @param {cc.Texture2D|String} texture2d
|
|
||||||
*/
|
|
||||||
setTexture : function(
|
|
||||||
str
|
|
||||||
)
|
|
||||||
{
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @method getTexture
|
|
||||||
* @return {cc.Texture2D}
|
|
||||||
*/
|
|
||||||
getTexture : function (
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return cc.Texture2D;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method getSkin
|
* @method getSkin
|
||||||
* @return {cc.MeshSkin}
|
* @return {cc.MeshSkin}
|
||||||
|
@ -482,6 +462,16 @@ getVertexSizeInBytes : function (
|
||||||
return 0;
|
return 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method enableCheckTexture
|
||||||
|
* @return {bool}
|
||||||
|
*/
|
||||||
|
enableCheckTexture : function (
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method setMaterial
|
* @method setMaterial
|
||||||
* @param {cc.Material} arg0
|
* @param {cc.Material} arg0
|
||||||
|
@ -660,6 +650,16 @@ meshskin
|
||||||
{
|
{
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method setEnableCheckTexture
|
||||||
|
* @param {bool} arg0
|
||||||
|
*/
|
||||||
|
setEnableCheckTexture : function (
|
||||||
|
bool
|
||||||
|
)
|
||||||
|
{
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method isVisible
|
* @method isVisible
|
||||||
* @return {bool}
|
* @return {bool}
|
||||||
|
|
|
@ -5,30 +5,8 @@
|
||||||
#include "3d/jsb_cocos2dx_3d_manual.h"
|
#include "3d/jsb_cocos2dx_3d_manual.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -189,32 +167,18 @@ bool js_cocos2dx_3d_Animation3D_constructor(JSContext *cx, uint32_t argc, jsval
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Animation3D* cobj = new (std::nothrow) cocos2d::Animation3D();
|
cocos2d::Animation3D* cobj = new (std::nothrow) cocos2d::Animation3D();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Animation3D>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Animation3D> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Animation3D"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Animation3D");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_Animation3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Animation3D)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_Animation3D(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_Animation3D(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Animation3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Animation3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Animation3D_class->name = "Animation3D";
|
jsb_cocos2d_Animation3D_class->name = "Animation3D";
|
||||||
|
@ -225,7 +189,7 @@ void js_register_cocos2dx_3d_Animation3D(JSContext *cx, JS::HandleObject global)
|
||||||
jsb_cocos2d_Animation3D_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Animation3D_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Animation3D_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Animation3D_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Animation3D_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Animation3D_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Animation3D_class->finalize = js_cocos2d_Animation3D_finalize;
|
jsb_cocos2d_Animation3D_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Animation3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Animation3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -724,34 +688,20 @@ bool js_cocos2dx_3d_Animate3D_constructor(JSContext *cx, uint32_t argc, jsval *v
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Animate3D* cobj = new (std::nothrow) cocos2d::Animate3D();
|
cocos2d::Animate3D* cobj = new (std::nothrow) cocos2d::Animate3D();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Animate3D>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Animate3D> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Animate3D"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Animate3D");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_ActionInterval_prototype;
|
extern JSObject *jsb_cocos2d_ActionInterval_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Animate3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Animate3D)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_Animate3D(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_Animate3D(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Animate3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Animate3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Animate3D_class->name = "Animate3D";
|
jsb_cocos2d_Animate3D_class->name = "Animate3D";
|
||||||
|
@ -762,7 +712,7 @@ void js_register_cocos2dx_3d_Animate3D(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Animate3D_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Animate3D_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Animate3D_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Animate3D_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Animate3D_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Animate3D_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Animate3D_class->finalize = js_cocos2d_Animate3D_finalize;
|
jsb_cocos2d_Animate3D_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Animate3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Animate3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -871,34 +821,20 @@ bool js_cocos2dx_3d_TextureCube_constructor(JSContext *cx, uint32_t argc, jsval
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::TextureCube* cobj = new (std::nothrow) cocos2d::TextureCube();
|
cocos2d::TextureCube* cobj = new (std::nothrow) cocos2d::TextureCube();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::TextureCube>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::TextureCube> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::TextureCube"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::TextureCube");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Texture2D_prototype;
|
extern JSObject *jsb_cocos2d_Texture2D_prototype;
|
||||||
|
|
||||||
void js_cocos2d_TextureCube_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (TextureCube)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_TextureCube(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_TextureCube(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_TextureCube_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_TextureCube_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_TextureCube_class->name = "TextureCube";
|
jsb_cocos2d_TextureCube_class->name = "TextureCube";
|
||||||
|
@ -909,7 +845,7 @@ void js_register_cocos2dx_3d_TextureCube(JSContext *cx, JS::HandleObject global)
|
||||||
jsb_cocos2d_TextureCube_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_TextureCube_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_TextureCube_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_TextureCube_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_TextureCube_class->convert = JS_ConvertStub;
|
jsb_cocos2d_TextureCube_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_TextureCube_class->finalize = js_cocos2d_TextureCube_finalize;
|
jsb_cocos2d_TextureCube_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_TextureCube_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_TextureCube_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -984,34 +920,20 @@ bool js_cocos2dx_3d_AttachNode_constructor(JSContext *cx, uint32_t argc, jsval *
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::AttachNode* cobj = new (std::nothrow) cocos2d::AttachNode();
|
cocos2d::AttachNode* cobj = new (std::nothrow) cocos2d::AttachNode();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::AttachNode>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::AttachNode> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::AttachNode"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::AttachNode");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Node_prototype;
|
extern JSObject *jsb_cocos2d_Node_prototype;
|
||||||
|
|
||||||
void js_cocos2d_AttachNode_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (AttachNode)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_AttachNode(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_AttachNode(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_AttachNode_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_AttachNode_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_AttachNode_class->name = "AttachNode";
|
jsb_cocos2d_AttachNode_class->name = "AttachNode";
|
||||||
|
@ -1022,7 +944,7 @@ void js_register_cocos2dx_3d_AttachNode(JSContext *cx, JS::HandleObject global)
|
||||||
jsb_cocos2d_AttachNode_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_AttachNode_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_AttachNode_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_AttachNode_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_AttachNode_class->convert = JS_ConvertStub;
|
jsb_cocos2d_AttachNode_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_AttachNode_class->finalize = js_cocos2d_AttachNode_finalize;
|
jsb_cocos2d_AttachNode_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_AttachNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_AttachNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -1294,34 +1216,20 @@ bool js_cocos2dx_3d_BillBoard_constructor(JSContext *cx, uint32_t argc, jsval *v
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::BillBoard* cobj = new (std::nothrow) cocos2d::BillBoard();
|
cocos2d::BillBoard* cobj = new (std::nothrow) cocos2d::BillBoard();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::BillBoard>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::BillBoard> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::BillBoard"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::BillBoard");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Sprite_prototype;
|
extern JSObject *jsb_cocos2d_Sprite_prototype;
|
||||||
|
|
||||||
void js_cocos2d_BillBoard_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (BillBoard)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_BillBoard(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_BillBoard(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_BillBoard_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_BillBoard_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_BillBoard_class->name = "BillBoard";
|
jsb_cocos2d_BillBoard_class->name = "BillBoard";
|
||||||
|
@ -1332,7 +1240,7 @@ void js_register_cocos2dx_3d_BillBoard(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_BillBoard_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_BillBoard_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_BillBoard_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_BillBoard_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_BillBoard_class->convert = JS_ConvertStub;
|
jsb_cocos2d_BillBoard_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_BillBoard_class->finalize = js_cocos2d_BillBoard_finalize;
|
jsb_cocos2d_BillBoard_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_BillBoard_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_BillBoard_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -1371,75 +1279,6 @@ void js_register_cocos2dx_3d_BillBoard(JSContext *cx, JS::HandleObject global) {
|
||||||
JSClass *jsb_cocos2d_Mesh_class;
|
JSClass *jsb_cocos2d_Mesh_class;
|
||||||
JSObject *jsb_cocos2d_Mesh_prototype;
|
JSObject *jsb_cocos2d_Mesh_prototype;
|
||||||
|
|
||||||
bool js_cocos2dx_3d_Mesh_setTexture(JSContext *cx, uint32_t argc, jsval *vp)
|
|
||||||
{
|
|
||||||
bool ok = true;
|
|
||||||
cocos2d::Mesh* cobj = nullptr;
|
|
||||||
|
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
|
||||||
JS::RootedObject obj(cx);
|
|
||||||
obj.set(args.thisv().toObjectOrNull());
|
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
|
||||||
cobj = (cocos2d::Mesh *)(proxy ? proxy->ptr : nullptr);
|
|
||||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Mesh_setTexture : Invalid Native Object");
|
|
||||||
do {
|
|
||||||
if (argc == 1) {
|
|
||||||
cocos2d::Texture2D* arg0 = nullptr;
|
|
||||||
do {
|
|
||||||
if (args.get(0).isNull()) { arg0 = nullptr; break; }
|
|
||||||
if (!args.get(0).isObject()) { ok = false; break; }
|
|
||||||
js_proxy_t *jsProxy;
|
|
||||||
JS::RootedObject tmpObj(cx, args.get(0).toObjectOrNull());
|
|
||||||
jsProxy = jsb_get_js_proxy(tmpObj);
|
|
||||||
arg0 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL);
|
|
||||||
JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object");
|
|
||||||
} while (0);
|
|
||||||
if (!ok) { ok = true; break; }
|
|
||||||
cobj->setTexture(arg0);
|
|
||||||
args.rval().setUndefined();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} while(0);
|
|
||||||
|
|
||||||
do {
|
|
||||||
if (argc == 1) {
|
|
||||||
std::string arg0;
|
|
||||||
ok &= jsval_to_std_string(cx, args.get(0), &arg0);
|
|
||||||
if (!ok) { ok = true; break; }
|
|
||||||
cobj->setTexture(arg0);
|
|
||||||
args.rval().setUndefined();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} while(0);
|
|
||||||
|
|
||||||
JS_ReportError(cx, "js_cocos2dx_3d_Mesh_setTexture : wrong number of arguments");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bool js_cocos2dx_3d_Mesh_getTexture(JSContext *cx, uint32_t argc, jsval *vp)
|
|
||||||
{
|
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
|
||||||
cocos2d::Mesh* cobj = (cocos2d::Mesh *)(proxy ? proxy->ptr : NULL);
|
|
||||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Mesh_getTexture : Invalid Native Object");
|
|
||||||
if (argc == 0) {
|
|
||||||
cocos2d::Texture2D* ret = cobj->getTexture();
|
|
||||||
jsval jsret = JSVAL_NULL;
|
|
||||||
do {
|
|
||||||
if (ret) {
|
|
||||||
js_proxy_t *jsProxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);
|
|
||||||
jsret = OBJECT_TO_JSVAL(jsProxy->obj);
|
|
||||||
} else {
|
|
||||||
jsret = JSVAL_NULL;
|
|
||||||
}
|
|
||||||
} while (0);
|
|
||||||
args.rval().set(jsret);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "js_cocos2dx_3d_Mesh_getTexture : wrong number of arguments: %d, was expecting %d", argc, 0);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bool js_cocos2dx_3d_Mesh_getSkin(JSContext *cx, uint32_t argc, jsval *vp)
|
bool js_cocos2dx_3d_Mesh_getSkin(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
|
@ -1508,6 +1347,24 @@ bool js_cocos2dx_3d_Mesh_getVertexSizeInBytes(JSContext *cx, uint32_t argc, jsva
|
||||||
JS_ReportError(cx, "js_cocos2dx_3d_Mesh_getVertexSizeInBytes : wrong number of arguments: %d, was expecting %d", argc, 0);
|
JS_ReportError(cx, "js_cocos2dx_3d_Mesh_getVertexSizeInBytes : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
bool js_cocos2dx_3d_Mesh_enableCheckTexture(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::Mesh* cobj = (cocos2d::Mesh *)(proxy ? proxy->ptr : NULL);
|
||||||
|
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Mesh_enableCheckTexture : Invalid Native Object");
|
||||||
|
if (argc == 0) {
|
||||||
|
bool ret = cobj->enableCheckTexture();
|
||||||
|
jsval jsret = JSVAL_NULL;
|
||||||
|
jsret = BOOLEAN_TO_JSVAL(ret);
|
||||||
|
args.rval().set(jsret);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
JS_ReportError(cx, "js_cocos2dx_3d_Mesh_enableCheckTexture : wrong number of arguments: %d, was expecting %d", argc, 0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
bool js_cocos2dx_3d_Mesh_setMaterial(JSContext *cx, uint32_t argc, jsval *vp)
|
bool js_cocos2dx_3d_Mesh_setMaterial(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
|
@ -1882,6 +1739,26 @@ bool js_cocos2dx_3d_Mesh_setSkin(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS_ReportError(cx, "js_cocos2dx_3d_Mesh_setSkin : wrong number of arguments: %d, was expecting %d", argc, 1);
|
JS_ReportError(cx, "js_cocos2dx_3d_Mesh_setSkin : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
bool js_cocos2dx_3d_Mesh_setEnableCheckTexture(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::Mesh* cobj = (cocos2d::Mesh *)(proxy ? proxy->ptr : NULL);
|
||||||
|
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Mesh_setEnableCheckTexture : Invalid Native Object");
|
||||||
|
if (argc == 1) {
|
||||||
|
bool arg0;
|
||||||
|
arg0 = JS::ToBoolean(args.get(0));
|
||||||
|
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Mesh_setEnableCheckTexture : Error processing arguments");
|
||||||
|
cobj->setEnableCheckTexture(arg0);
|
||||||
|
args.rval().setUndefined();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
JS_ReportError(cx, "js_cocos2dx_3d_Mesh_setEnableCheckTexture : wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
bool js_cocos2dx_3d_Mesh_isVisible(JSContext *cx, uint32_t argc, jsval *vp)
|
bool js_cocos2dx_3d_Mesh_isVisible(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
|
@ -1971,32 +1848,18 @@ bool js_cocos2dx_3d_Mesh_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Mesh* cobj = new (std::nothrow) cocos2d::Mesh();
|
cocos2d::Mesh* cobj = new (std::nothrow) cocos2d::Mesh();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Mesh>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Mesh> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Mesh"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Mesh");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_Mesh_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Mesh)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_Mesh(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_Mesh(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Mesh_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Mesh_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Mesh_class->name = "Mesh";
|
jsb_cocos2d_Mesh_class->name = "Mesh";
|
||||||
|
@ -2007,7 +1870,7 @@ void js_register_cocos2dx_3d_Mesh(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Mesh_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Mesh_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Mesh_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Mesh_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Mesh_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Mesh_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Mesh_class->finalize = js_cocos2d_Mesh_finalize;
|
jsb_cocos2d_Mesh_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Mesh_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Mesh_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -2016,11 +1879,10 @@ void js_register_cocos2dx_3d_Mesh(JSContext *cx, JS::HandleObject global) {
|
||||||
};
|
};
|
||||||
|
|
||||||
static JSFunctionSpec funcs[] = {
|
static JSFunctionSpec funcs[] = {
|
||||||
JS_FN("setTexture", js_cocos2dx_3d_Mesh_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
|
||||||
JS_FN("getTexture", js_cocos2dx_3d_Mesh_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
|
||||||
JS_FN("getSkin", js_cocos2dx_3d_Mesh_getSkin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getSkin", js_cocos2dx_3d_Mesh_getSkin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getMaterial", js_cocos2dx_3d_Mesh_getMaterial, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getMaterial", js_cocos2dx_3d_Mesh_getMaterial, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getVertexSizeInBytes", js_cocos2dx_3d_Mesh_getVertexSizeInBytes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getVertexSizeInBytes", js_cocos2dx_3d_Mesh_getVertexSizeInBytes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
|
JS_FN("enableCheckTexture", js_cocos2dx_3d_Mesh_enableCheckTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("setMaterial", js_cocos2dx_3d_Mesh_setMaterial, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("setMaterial", js_cocos2dx_3d_Mesh_setMaterial, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getName", js_cocos2dx_3d_Mesh_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getName", js_cocos2dx_3d_Mesh_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getIndexFormat", js_cocos2dx_3d_Mesh_getIndexFormat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getIndexFormat", js_cocos2dx_3d_Mesh_getIndexFormat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
|
@ -2039,6 +1901,7 @@ void js_register_cocos2dx_3d_Mesh(JSContext *cx, JS::HandleObject global) {
|
||||||
JS_FN("setForce2DQueue", js_cocos2dx_3d_Mesh_setForce2DQueue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("setForce2DQueue", js_cocos2dx_3d_Mesh_setForce2DQueue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getPrimitiveType", js_cocos2dx_3d_Mesh_getPrimitiveType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getPrimitiveType", js_cocos2dx_3d_Mesh_getPrimitiveType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("setSkin", js_cocos2dx_3d_Mesh_setSkin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("setSkin", js_cocos2dx_3d_Mesh_setSkin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
|
JS_FN("setEnableCheckTexture", js_cocos2dx_3d_Mesh_setEnableCheckTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("isVisible", js_cocos2dx_3d_Mesh_isVisible, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("isVisible", js_cocos2dx_3d_Mesh_isVisible, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("getIndexBuffer", js_cocos2dx_3d_Mesh_getIndexBuffer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("getIndexBuffer", js_cocos2dx_3d_Mesh_getIndexBuffer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
JS_FN("setGLProgramState", js_cocos2dx_3d_Mesh_setGLProgramState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
JS_FN("setGLProgramState", js_cocos2dx_3d_Mesh_setGLProgramState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
|
||||||
|
@ -2284,32 +2147,18 @@ bool js_cocos2dx_3d_Skeleton3D_constructor(JSContext *cx, uint32_t argc, jsval *
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Skeleton3D* cobj = new (std::nothrow) cocos2d::Skeleton3D();
|
cocos2d::Skeleton3D* cobj = new (std::nothrow) cocos2d::Skeleton3D();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Skeleton3D>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Skeleton3D> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Skeleton3D"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Skeleton3D");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_Skeleton3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Skeleton3D)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_Skeleton3D(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_Skeleton3D(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Skeleton3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Skeleton3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Skeleton3D_class->name = "Skeleton3D";
|
jsb_cocos2d_Skeleton3D_class->name = "Skeleton3D";
|
||||||
|
@ -2320,7 +2169,7 @@ void js_register_cocos2dx_3d_Skeleton3D(JSContext *cx, JS::HandleObject global)
|
||||||
jsb_cocos2d_Skeleton3D_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Skeleton3D_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Skeleton3D_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Skeleton3D_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Skeleton3D_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Skeleton3D_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Skeleton3D_class->finalize = js_cocos2d_Skeleton3D_finalize;
|
jsb_cocos2d_Skeleton3D_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Skeleton3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Skeleton3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -2501,34 +2350,20 @@ bool js_cocos2dx_3d_Skybox_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Skybox* cobj = new (std::nothrow) cocos2d::Skybox();
|
cocos2d::Skybox* cobj = new (std::nothrow) cocos2d::Skybox();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Skybox>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Skybox> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Skybox"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Skybox");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Node_prototype;
|
extern JSObject *jsb_cocos2d_Node_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Skybox_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Skybox)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_Skybox(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_Skybox(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Skybox_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Skybox_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Skybox_class->name = "Skybox";
|
jsb_cocos2d_Skybox_class->name = "Skybox";
|
||||||
|
@ -2539,7 +2374,7 @@ void js_register_cocos2dx_3d_Skybox(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Skybox_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Skybox_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Skybox_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Skybox_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Skybox_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Skybox_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Skybox_class->finalize = js_cocos2d_Skybox_finalize;
|
jsb_cocos2d_Skybox_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Skybox_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Skybox_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -3480,37 +3315,23 @@ bool js_cocos2dx_3d_Sprite3D_constructor(JSContext *cx, uint32_t argc, jsval *vp
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Sprite3D* cobj = new (std::nothrow) cocos2d::Sprite3D();
|
cocos2d::Sprite3D* cobj = new (std::nothrow) cocos2d::Sprite3D();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Sprite3D>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Sprite3D> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Sprite3D"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Sprite3D");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_3d_Sprite3D_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_3d_Sprite3D_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::Sprite3D *nobj = new (std::nothrow) cocos2d::Sprite3D();
|
cocos2d::Sprite3D *nobj = new (std::nothrow) cocos2d::Sprite3D();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::Sprite3D");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Sprite3D");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -3518,11 +3339,9 @@ bool js_cocos2dx_3d_Sprite3D_constructor(JSContext *cx, uint32_t argc, jsval *vp
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Node_prototype;
|
extern JSObject *jsb_cocos2d_Node_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Sprite3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Sprite3D)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_3d_Sprite3D(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_Sprite3D(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Sprite3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Sprite3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -3534,7 +3353,7 @@ void js_register_cocos2dx_3d_Sprite3D(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Sprite3D_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Sprite3D_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Sprite3D_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Sprite3D_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Sprite3D_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Sprite3D_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Sprite3D_class->finalize = js_cocos2d_Sprite3D_finalize;
|
jsb_cocos2d_Sprite3D_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Sprite3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Sprite3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -3675,9 +3494,6 @@ bool js_cocos2dx_3d_Sprite3DCache_getInstance(JSContext *cx, uint32_t argc, jsva
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void js_cocos2d_Sprite3DCache_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Sprite3DCache)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_Sprite3DCache(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_Sprite3DCache(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Sprite3DCache_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Sprite3DCache_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Sprite3DCache_class->name = "Sprite3DCache";
|
jsb_cocos2d_Sprite3DCache_class->name = "Sprite3DCache";
|
||||||
|
@ -3688,7 +3504,7 @@ void js_register_cocos2dx_3d_Sprite3DCache(JSContext *cx, JS::HandleObject globa
|
||||||
jsb_cocos2d_Sprite3DCache_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Sprite3DCache_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Sprite3DCache_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Sprite3DCache_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Sprite3DCache_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Sprite3DCache_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Sprite3DCache_class->finalize = js_cocos2d_Sprite3DCache_finalize;
|
jsb_cocos2d_Sprite3DCache_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Sprite3DCache_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Sprite3DCache_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -4305,34 +4121,20 @@ bool js_cocos2dx_3d_Terrain_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Terrain* cobj = new (std::nothrow) cocos2d::Terrain();
|
cocos2d::Terrain* cobj = new (std::nothrow) cocos2d::Terrain();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Terrain>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Terrain> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Terrain"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Terrain");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Node_prototype;
|
extern JSObject *jsb_cocos2d_Node_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Terrain_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Terrain)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_Terrain(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_Terrain(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Terrain_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Terrain_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Terrain_class->name = "Terrain";
|
jsb_cocos2d_Terrain_class->name = "Terrain";
|
||||||
|
@ -4343,7 +4145,7 @@ void js_register_cocos2dx_3d_Terrain(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Terrain_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Terrain_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Terrain_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Terrain_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Terrain_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Terrain_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Terrain_class->finalize = js_cocos2d_Terrain_finalize;
|
jsb_cocos2d_Terrain_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Terrain_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Terrain_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -4654,25 +4456,22 @@ bool js_cocos2dx_3d_Bundle3D_constructor(JSContext *cx, uint32_t argc, jsval *vp
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Bundle3D* cobj = new (std::nothrow) cocos2d::Bundle3D();
|
cocos2d::Bundle3D* cobj = new (std::nothrow) cocos2d::Bundle3D();
|
||||||
TypeTest<cocos2d::Bundle3D> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Bundle3D>(cobj);
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
// link the native object with the javascript object
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
JS::RootedObject jsobj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
js_proxy_t* p = jsb_new_proxy(cobj, jsobj);
|
||||||
// link the native object with the javascript object
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Bundle3D");
|
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Bundle3D");
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void js_cocos2d_Bundle3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
void js_cocos2d_Bundle3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Bundle3D)", obj);
|
CCLOGINFO("jsbindings: finalizing JS object %p (Bundle3D)", obj);
|
||||||
js_proxy_t* nproxy;
|
js_proxy_t* nproxy;
|
||||||
|
@ -4688,7 +4487,8 @@ void js_cocos2d_Bundle3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
||||||
jsb_remove_proxy(nproxy, jsproxy);
|
jsb_remove_proxy(nproxy, jsproxy);
|
||||||
delete nobj;
|
delete nobj;
|
||||||
}
|
}
|
||||||
else jsb_remove_proxy(nullptr, jsproxy);
|
else
|
||||||
|
jsb_remove_proxy(nullptr, jsproxy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void js_register_cocos2dx_3d_Bundle3D(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_Bundle3D(JSContext *cx, JS::HandleObject global) {
|
||||||
|
|
|
@ -85,11 +85,10 @@ bool js_cocos2dx_3d_Mesh_constructor(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
void js_cocos2dx_3d_Mesh_finalize(JSContext *cx, JSObject *obj);
|
void js_cocos2dx_3d_Mesh_finalize(JSContext *cx, JSObject *obj);
|
||||||
void js_register_cocos2dx_3d_Mesh(JSContext *cx, JS::HandleObject global);
|
void js_register_cocos2dx_3d_Mesh(JSContext *cx, JS::HandleObject global);
|
||||||
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
|
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
|
||||||
bool js_cocos2dx_3d_Mesh_setTexture(JSContext *cx, uint32_t argc, jsval *vp);
|
|
||||||
bool js_cocos2dx_3d_Mesh_getTexture(JSContext *cx, uint32_t argc, jsval *vp);
|
|
||||||
bool js_cocos2dx_3d_Mesh_getSkin(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_getSkin(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_getMaterial(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_getMaterial(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_getVertexSizeInBytes(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_getVertexSizeInBytes(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
|
bool js_cocos2dx_3d_Mesh_enableCheckTexture(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_setMaterial(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_setMaterial(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_getName(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_getName(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_getIndexFormat(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_getIndexFormat(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
|
@ -108,6 +107,7 @@ bool js_cocos2dx_3d_Mesh_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_setForce2DQueue(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_setForce2DQueue(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_getPrimitiveType(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_getPrimitiveType(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_setSkin(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_setSkin(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
|
bool js_cocos2dx_3d_Mesh_setEnableCheckTexture(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_isVisible(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_isVisible(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_getIndexBuffer(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_getIndexBuffer(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
bool js_cocos2dx_3d_Mesh_setGLProgramState(JSContext *cx, uint32_t argc, jsval *vp);
|
bool js_cocos2dx_3d_Mesh_setGLProgramState(JSContext *cx, uint32_t argc, jsval *vp);
|
||||||
|
|
|
@ -3,30 +3,8 @@
|
||||||
#include "cocos-ext.h"
|
#include "cocos-ext.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -301,34 +279,20 @@ bool js_cocos2dx_3d_extension_ParticleSystem3D_constructor(JSContext *cx, uint32
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::ParticleSystem3D* cobj = new (std::nothrow) cocos2d::ParticleSystem3D();
|
cocos2d::ParticleSystem3D* cobj = new (std::nothrow) cocos2d::ParticleSystem3D();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::ParticleSystem3D>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::ParticleSystem3D> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::ParticleSystem3D"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::ParticleSystem3D");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Node_prototype;
|
extern JSObject *jsb_cocos2d_Node_prototype;
|
||||||
|
|
||||||
void js_cocos2d_ParticleSystem3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ParticleSystem3D)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_extension_ParticleSystem3D(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_extension_ParticleSystem3D(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_ParticleSystem3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_ParticleSystem3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_ParticleSystem3D_class->name = "ParticleSystem3D";
|
jsb_cocos2d_ParticleSystem3D_class->name = "ParticleSystem3D";
|
||||||
|
@ -339,7 +303,7 @@ void js_register_cocos2dx_3d_extension_ParticleSystem3D(JSContext *cx, JS::Handl
|
||||||
jsb_cocos2d_ParticleSystem3D_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_ParticleSystem3D_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_ParticleSystem3D_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_ParticleSystem3D_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_ParticleSystem3D_class->convert = JS_ConvertStub;
|
jsb_cocos2d_ParticleSystem3D_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_ParticleSystem3D_class->finalize = js_cocos2d_ParticleSystem3D_finalize;
|
jsb_cocos2d_ParticleSystem3D_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_ParticleSystem3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_ParticleSystem3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -1122,34 +1086,20 @@ bool js_cocos2dx_3d_extension_PUParticleSystem3D_constructor(JSContext *cx, uint
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::PUParticleSystem3D* cobj = new (std::nothrow) cocos2d::PUParticleSystem3D();
|
cocos2d::PUParticleSystem3D* cobj = new (std::nothrow) cocos2d::PUParticleSystem3D();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::PUParticleSystem3D>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::PUParticleSystem3D> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::PUParticleSystem3D"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::PUParticleSystem3D");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_ParticleSystem3D_prototype;
|
extern JSObject *jsb_cocos2d_ParticleSystem3D_prototype;
|
||||||
|
|
||||||
void js_cocos2d_PUParticleSystem3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (PUParticleSystem3D)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_3d_extension_PUParticleSystem3D(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_3d_extension_PUParticleSystem3D(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_PUParticleSystem3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_PUParticleSystem3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_PUParticleSystem3D_class->name = "PUParticleSystem3D";
|
jsb_cocos2d_PUParticleSystem3D_class->name = "PUParticleSystem3D";
|
||||||
|
@ -1160,7 +1110,7 @@ void js_register_cocos2dx_3d_extension_PUParticleSystem3D(JSContext *cx, JS::Han
|
||||||
jsb_cocos2d_PUParticleSystem3D_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_PUParticleSystem3D_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_PUParticleSystem3D_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_PUParticleSystem3D_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_PUParticleSystem3D_class->convert = JS_ConvertStub;
|
jsb_cocos2d_PUParticleSystem3D_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_PUParticleSystem3D_class->finalize = js_cocos2d_PUParticleSystem3D_finalize;
|
jsb_cocos2d_PUParticleSystem3D_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_PUParticleSystem3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_PUParticleSystem3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
|
|
@ -4,30 +4,8 @@
|
||||||
#include "AudioEngine.h"
|
#include "AudioEngine.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -131,25 +109,22 @@ bool js_cocos2dx_audioengine_AudioProfile_constructor(JSContext *cx, uint32_t ar
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::experimental::AudioProfile* cobj = new (std::nothrow) cocos2d::experimental::AudioProfile();
|
cocos2d::experimental::AudioProfile* cobj = new (std::nothrow) cocos2d::experimental::AudioProfile();
|
||||||
TypeTest<cocos2d::experimental::AudioProfile> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::experimental::AudioProfile>(cobj);
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
// link the native object with the javascript object
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
JS::RootedObject jsobj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
js_proxy_t* p = jsb_new_proxy(cobj, jsobj);
|
||||||
// link the native object with the javascript object
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::experimental::AudioProfile");
|
AddNamedObjectRoot(cx, &p->obj, "cocos2d::experimental::AudioProfile");
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void js_cocos2d_experimental_AudioProfile_finalize(JSFreeOp *fop, JSObject *obj) {
|
void js_cocos2d_experimental_AudioProfile_finalize(JSFreeOp *fop, JSObject *obj) {
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (AudioProfile)", obj);
|
CCLOGINFO("jsbindings: finalizing JS object %p (AudioProfile)", obj);
|
||||||
js_proxy_t* nproxy;
|
js_proxy_t* nproxy;
|
||||||
|
@ -165,7 +140,8 @@ void js_cocos2d_experimental_AudioProfile_finalize(JSFreeOp *fop, JSObject *obj)
|
||||||
jsb_remove_proxy(nproxy, jsproxy);
|
jsb_remove_proxy(nproxy, jsproxy);
|
||||||
delete nobj;
|
delete nobj;
|
||||||
}
|
}
|
||||||
else jsb_remove_proxy(nullptr, jsproxy);
|
else
|
||||||
|
jsb_remove_proxy(nullptr, jsproxy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void js_register_cocos2dx_audioengine_AudioProfile(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_audioengine_AudioProfile(JSContext *cx, JS::HandleObject global) {
|
||||||
|
@ -759,9 +735,6 @@ bool js_cocos2dx_audioengine_AudioEngine_getProfile(JSContext *cx, uint32_t argc
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_experimental_AudioEngine_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (AudioEngine)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_audioengine_AudioEngine(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_audioengine_AudioEngine(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_experimental_AudioEngine_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_experimental_AudioEngine_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_experimental_AudioEngine_class->name = "AudioEngine";
|
jsb_cocos2d_experimental_AudioEngine_class->name = "AudioEngine";
|
||||||
|
@ -772,7 +745,7 @@ void js_register_cocos2dx_audioengine_AudioEngine(JSContext *cx, JS::HandleObjec
|
||||||
jsb_cocos2d_experimental_AudioEngine_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_experimental_AudioEngine_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_experimental_AudioEngine_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_experimental_AudioEngine_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_experimental_AudioEngine_class->convert = JS_ConvertStub;
|
jsb_cocos2d_experimental_AudioEngine_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_experimental_AudioEngine_class->finalize = js_cocos2d_experimental_AudioEngine_finalize;
|
jsb_cocos2d_experimental_AudioEngine_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_experimental_AudioEngine_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_experimental_AudioEngine_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,30 +3,8 @@
|
||||||
#include "CocosBuilder.h"
|
#include "CocosBuilder.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -910,32 +888,18 @@ bool js_cocos2dx_builder_CCBAnimationManager_constructor(JSContext *cx, uint32_t
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocosbuilder::CCBAnimationManager* cobj = new (std::nothrow) cocosbuilder::CCBAnimationManager();
|
cocosbuilder::CCBAnimationManager* cobj = new (std::nothrow) cocosbuilder::CCBAnimationManager();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocosbuilder::CCBAnimationManager>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocosbuilder::CCBAnimationManager> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocosbuilder::CCBAnimationManager"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocosbuilder::CCBAnimationManager");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocosbuilder_CCBAnimationManager_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (CCBAnimationManager)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_builder_CCBAnimationManager(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_builder_CCBAnimationManager(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocosbuilder_CCBAnimationManager_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocosbuilder_CCBAnimationManager_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocosbuilder_CCBAnimationManager_class->name = "BuilderAnimationManager";
|
jsb_cocosbuilder_CCBAnimationManager_class->name = "BuilderAnimationManager";
|
||||||
|
@ -946,7 +910,7 @@ void js_register_cocos2dx_builder_CCBAnimationManager(JSContext *cx, JS::HandleO
|
||||||
jsb_cocosbuilder_CCBAnimationManager_class->enumerate = JS_EnumerateStub;
|
jsb_cocosbuilder_CCBAnimationManager_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocosbuilder_CCBAnimationManager_class->resolve = JS_ResolveStub;
|
jsb_cocosbuilder_CCBAnimationManager_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocosbuilder_CCBAnimationManager_class->convert = JS_ConvertStub;
|
jsb_cocosbuilder_CCBAnimationManager_class->convert = JS_ConvertStub;
|
||||||
jsb_cocosbuilder_CCBAnimationManager_class->finalize = js_cocosbuilder_CCBAnimationManager_finalize;
|
jsb_cocosbuilder_CCBAnimationManager_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocosbuilder_CCBAnimationManager_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocosbuilder_CCBAnimationManager_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -1435,25 +1399,14 @@ bool js_cocos2dx_builder_CCBReader_constructor(JSContext *cx, uint32_t argc, jsv
|
||||||
} while (0);
|
} while (0);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0);
|
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<cocosbuilder::CCBReader> t;
|
js_type_class_t *typeClass = js_get_type_from_native<cocosbuilder::CCBReader>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocosbuilder::CCBReader");
|
jsb_ref_init(cx, &p->obj, cobj, "cocosbuilder::CCBReader");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1471,25 +1424,14 @@ bool js_cocos2dx_builder_CCBReader_constructor(JSContext *cx, uint32_t argc, jsv
|
||||||
} while (0);
|
} while (0);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0);
|
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<cocosbuilder::CCBReader> t;
|
js_type_class_t *typeClass = js_get_type_from_native<cocosbuilder::CCBReader>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocosbuilder::CCBReader");
|
jsb_ref_init(cx, &p->obj, cobj, "cocosbuilder::CCBReader");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1518,25 +1460,14 @@ bool js_cocos2dx_builder_CCBReader_constructor(JSContext *cx, uint32_t argc, jsv
|
||||||
} while (0);
|
} while (0);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0, arg1);
|
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<cocosbuilder::CCBReader> t;
|
js_type_class_t *typeClass = js_get_type_from_native<cocosbuilder::CCBReader>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocosbuilder::CCBReader");
|
jsb_ref_init(cx, &p->obj, cobj, "cocosbuilder::CCBReader");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1576,25 +1507,14 @@ bool js_cocos2dx_builder_CCBReader_constructor(JSContext *cx, uint32_t argc, jsv
|
||||||
} while (0);
|
} while (0);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0, arg1, arg2);
|
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0, arg1, arg2);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<cocosbuilder::CCBReader> t;
|
js_type_class_t *typeClass = js_get_type_from_native<cocosbuilder::CCBReader>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocosbuilder::CCBReader");
|
jsb_ref_init(cx, &p->obj, cobj, "cocosbuilder::CCBReader");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1645,50 +1565,28 @@ bool js_cocos2dx_builder_CCBReader_constructor(JSContext *cx, uint32_t argc, jsv
|
||||||
} while (0);
|
} while (0);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0, arg1, arg2, arg3);
|
cobj = new (std::nothrow) cocosbuilder::CCBReader(arg0, arg1, arg2, arg3);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<cocosbuilder::CCBReader> t;
|
js_type_class_t *typeClass = js_get_type_from_native<cocosbuilder::CCBReader>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocosbuilder::CCBReader");
|
jsb_ref_init(cx, &p->obj, cobj, "cocosbuilder::CCBReader");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
cobj = new (std::nothrow) cocosbuilder::CCBReader();
|
cobj = new (std::nothrow) cocosbuilder::CCBReader();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<cocosbuilder::CCBReader> t;
|
js_type_class_t *typeClass = js_get_type_from_native<cocosbuilder::CCBReader>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocosbuilder::CCBReader");
|
jsb_ref_init(cx, &p->obj, cobj, "cocosbuilder::CCBReader");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1704,9 +1602,6 @@ bool js_cocos2dx_builder_CCBReader_constructor(JSContext *cx, uint32_t argc, jsv
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void js_cocosbuilder_CCBReader_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (CCBReader)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_builder_CCBReader(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_builder_CCBReader(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocosbuilder_CCBReader_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocosbuilder_CCBReader_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocosbuilder_CCBReader_class->name = "_Reader";
|
jsb_cocosbuilder_CCBReader_class->name = "_Reader";
|
||||||
|
@ -1717,7 +1612,7 @@ void js_register_cocos2dx_builder_CCBReader(JSContext *cx, JS::HandleObject glob
|
||||||
jsb_cocosbuilder_CCBReader_class->enumerate = JS_EnumerateStub;
|
jsb_cocosbuilder_CCBReader_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocosbuilder_CCBReader_class->resolve = JS_ResolveStub;
|
jsb_cocosbuilder_CCBReader_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocosbuilder_CCBReader_class->convert = JS_ConvertStub;
|
jsb_cocosbuilder_CCBReader_class->convert = JS_ConvertStub;
|
||||||
jsb_cocosbuilder_CCBReader_class->finalize = js_cocosbuilder_CCBReader_finalize;
|
jsb_cocosbuilder_CCBReader_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocosbuilder_CCBReader_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocosbuilder_CCBReader_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
|
|
@ -4,30 +4,8 @@
|
||||||
#include "UIVideoPlayer.h"
|
#include "UIVideoPlayer.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -313,34 +291,20 @@ bool js_cocos2dx_experimental_video_VideoPlayer_constructor(JSContext *cx, uint3
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::experimental::ui::VideoPlayer* cobj = new (std::nothrow) cocos2d::experimental::ui::VideoPlayer();
|
cocos2d::experimental::ui::VideoPlayer* cobj = new (std::nothrow) cocos2d::experimental::ui::VideoPlayer();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::experimental::ui::VideoPlayer>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::experimental::ui::VideoPlayer> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::experimental::ui::VideoPlayer"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::experimental::ui::VideoPlayer");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_ui_Widget_prototype;
|
extern JSObject *jsb_cocos2d_ui_Widget_prototype;
|
||||||
|
|
||||||
void js_cocos2d_experimental_ui_VideoPlayer_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (VideoPlayer)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_experimental_video_VideoPlayer(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_experimental_video_VideoPlayer(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_experimental_ui_VideoPlayer_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_experimental_ui_VideoPlayer_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_experimental_ui_VideoPlayer_class->name = "VideoPlayer";
|
jsb_cocos2d_experimental_ui_VideoPlayer_class->name = "VideoPlayer";
|
||||||
|
@ -351,7 +315,7 @@ void js_register_cocos2dx_experimental_video_VideoPlayer(JSContext *cx, JS::Hand
|
||||||
jsb_cocos2d_experimental_ui_VideoPlayer_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_experimental_ui_VideoPlayer_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_experimental_ui_VideoPlayer_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_experimental_ui_VideoPlayer_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_experimental_ui_VideoPlayer_class->convert = JS_ConvertStub;
|
jsb_cocos2d_experimental_ui_VideoPlayer_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_experimental_ui_VideoPlayer_class->finalize = js_cocos2d_experimental_ui_VideoPlayer_finalize;
|
jsb_cocos2d_experimental_ui_VideoPlayer_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_experimental_ui_VideoPlayer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_experimental_ui_VideoPlayer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
|
|
@ -4,30 +4,8 @@
|
||||||
#include "UIWebView.h"
|
#include "UIWebView.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -373,34 +351,20 @@ bool js_cocos2dx_experimental_webView_WebView_constructor(JSContext *cx, uint32_
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::experimental::ui::WebView* cobj = new (std::nothrow) cocos2d::experimental::ui::WebView();
|
cocos2d::experimental::ui::WebView* cobj = new (std::nothrow) cocos2d::experimental::ui::WebView();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::experimental::ui::WebView>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::experimental::ui::WebView> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::experimental::ui::WebView"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::experimental::ui::WebView");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_ui_Widget_prototype;
|
extern JSObject *jsb_cocos2d_ui_Widget_prototype;
|
||||||
|
|
||||||
void js_cocos2d_experimental_ui_WebView_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (WebView)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_experimental_webView_WebView(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_experimental_webView_WebView(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_experimental_ui_WebView_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_experimental_ui_WebView_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_experimental_ui_WebView_class->name = "WebView";
|
jsb_cocos2d_experimental_ui_WebView_class->name = "WebView";
|
||||||
|
@ -411,7 +375,7 @@ void js_register_cocos2dx_experimental_webView_WebView(JSContext *cx, JS::Handle
|
||||||
jsb_cocos2d_experimental_ui_WebView_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_experimental_ui_WebView_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_experimental_ui_WebView_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_experimental_ui_WebView_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_experimental_ui_WebView_class->convert = JS_ConvertStub;
|
jsb_cocos2d_experimental_ui_WebView_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_experimental_ui_WebView_class->finalize = js_cocos2d_experimental_ui_WebView_finalize;
|
jsb_cocos2d_experimental_ui_WebView_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_experimental_ui_WebView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_experimental_ui_WebView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
|
|
@ -3,30 +3,8 @@
|
||||||
#include "cocos-ext.h"
|
#include "cocos-ext.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -316,34 +294,20 @@ bool js_cocos2dx_extension_Control_constructor(JSContext *cx, uint32_t argc, jsv
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::Control* cobj = new (std::nothrow) cocos2d::extension::Control();
|
cocos2d::extension::Control* cobj = new (std::nothrow) cocos2d::extension::Control();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::Control>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::Control> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::Control"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::Control");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Layer_prototype;
|
extern JSObject *jsb_cocos2d_Layer_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_Control_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Control)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_extension_Control(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_Control(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_Control_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_Control_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_extension_Control_class->name = "Control";
|
jsb_cocos2d_extension_Control_class->name = "Control";
|
||||||
|
@ -354,7 +318,7 @@ void js_register_cocos2dx_extension_Control(JSContext *cx, JS::HandleObject glob
|
||||||
jsb_cocos2d_extension_Control_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_Control_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_Control_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_Control_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_Control_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_Control_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_Control_class->finalize = js_cocos2d_extension_Control_finalize;
|
jsb_cocos2d_extension_Control_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_Control_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_Control_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -1412,37 +1376,23 @@ bool js_cocos2dx_extension_ControlButton_constructor(JSContext *cx, uint32_t arg
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::ControlButton* cobj = new (std::nothrow) cocos2d::extension::ControlButton();
|
cocos2d::extension::ControlButton* cobj = new (std::nothrow) cocos2d::extension::ControlButton();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::ControlButton>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::ControlButton> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::ControlButton"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlButton");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_extension_ControlButton_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_extension_ControlButton_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::extension::ControlButton *nobj = new (std::nothrow) cocos2d::extension::ControlButton();
|
cocos2d::extension::ControlButton *nobj = new (std::nothrow) cocos2d::extension::ControlButton();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::extension::ControlButton");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlButton");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -1450,11 +1400,9 @@ bool js_cocos2dx_extension_ControlButton_constructor(JSContext *cx, uint32_t arg
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_ControlButton_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ControlButton)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_extension_ControlButton(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_ControlButton(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_ControlButton_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_ControlButton_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -1466,7 +1414,7 @@ void js_register_cocos2dx_extension_ControlButton(JSContext *cx, JS::HandleObjec
|
||||||
jsb_cocos2d_extension_ControlButton_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_ControlButton_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_ControlButton_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_ControlButton_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_ControlButton_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_ControlButton_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_ControlButton_class->finalize = js_cocos2d_extension_ControlButton_finalize;
|
jsb_cocos2d_extension_ControlButton_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_ControlButton_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_ControlButton_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -1814,34 +1762,20 @@ bool js_cocos2dx_extension_ControlHuePicker_constructor(JSContext *cx, uint32_t
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::ControlHuePicker* cobj = new (std::nothrow) cocos2d::extension::ControlHuePicker();
|
cocos2d::extension::ControlHuePicker* cobj = new (std::nothrow) cocos2d::extension::ControlHuePicker();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::ControlHuePicker>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::ControlHuePicker> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::ControlHuePicker"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlHuePicker");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_ControlHuePicker_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ControlHuePicker)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_extension_ControlHuePicker(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_ControlHuePicker(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_ControlHuePicker_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_ControlHuePicker_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_extension_ControlHuePicker_class->name = "ControlHuePicker";
|
jsb_cocos2d_extension_ControlHuePicker_class->name = "ControlHuePicker";
|
||||||
|
@ -1852,7 +1786,7 @@ void js_register_cocos2dx_extension_ControlHuePicker(JSContext *cx, JS::HandleOb
|
||||||
jsb_cocos2d_extension_ControlHuePicker_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_ControlHuePicker_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_ControlHuePicker_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_ControlHuePicker_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_ControlHuePicker_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_ControlHuePicker_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_ControlHuePicker_class->finalize = js_cocos2d_extension_ControlHuePicker_finalize;
|
jsb_cocos2d_extension_ControlHuePicker_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_ControlHuePicker_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_ControlHuePicker_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -2124,34 +2058,20 @@ bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor(JSConte
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::ControlSaturationBrightnessPicker* cobj = new (std::nothrow) cocos2d::extension::ControlSaturationBrightnessPicker();
|
cocos2d::extension::ControlSaturationBrightnessPicker* cobj = new (std::nothrow) cocos2d::extension::ControlSaturationBrightnessPicker();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::ControlSaturationBrightnessPicker>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::ControlSaturationBrightnessPicker> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::ControlSaturationBrightnessPicker"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlSaturationBrightnessPicker");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_ControlSaturationBrightnessPicker_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ControlSaturationBrightnessPicker)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_extension_ControlSaturationBrightnessPicker(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_ControlSaturationBrightnessPicker(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->name = "ControlSaturationBrightnessPicker";
|
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->name = "ControlSaturationBrightnessPicker";
|
||||||
|
@ -2162,7 +2082,7 @@ void js_register_cocos2dx_extension_ControlSaturationBrightnessPicker(JSContext
|
||||||
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->finalize = js_cocos2d_extension_ControlSaturationBrightnessPicker_finalize;
|
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -2451,37 +2371,23 @@ bool js_cocos2dx_extension_ControlColourPicker_constructor(JSContext *cx, uint32
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::ControlColourPicker* cobj = new (std::nothrow) cocos2d::extension::ControlColourPicker();
|
cocos2d::extension::ControlColourPicker* cobj = new (std::nothrow) cocos2d::extension::ControlColourPicker();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::ControlColourPicker>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::ControlColourPicker> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::ControlColourPicker"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlColourPicker");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_extension_ControlColourPicker_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_extension_ControlColourPicker_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::extension::ControlColourPicker *nobj = new (std::nothrow) cocos2d::extension::ControlColourPicker();
|
cocos2d::extension::ControlColourPicker *nobj = new (std::nothrow) cocos2d::extension::ControlColourPicker();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::extension::ControlColourPicker");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlColourPicker");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -2489,11 +2395,9 @@ bool js_cocos2dx_extension_ControlColourPicker_constructor(JSContext *cx, uint32
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_ControlColourPicker_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ControlColourPicker)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_extension_ControlColourPicker(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_ControlColourPicker(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_ControlColourPicker_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_ControlColourPicker_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -2505,7 +2409,7 @@ void js_register_cocos2dx_extension_ControlColourPicker(JSContext *cx, JS::Handl
|
||||||
jsb_cocos2d_extension_ControlColourPicker_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_ControlColourPicker_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_ControlColourPicker_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_ControlColourPicker_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_ControlColourPicker_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_ControlColourPicker_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_ControlColourPicker_class->finalize = js_cocos2d_extension_ControlColourPicker_finalize;
|
jsb_cocos2d_extension_ControlColourPicker_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_ControlColourPicker_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_ControlColourPicker_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -3005,37 +2909,23 @@ bool js_cocos2dx_extension_ControlPotentiometer_constructor(JSContext *cx, uint3
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::ControlPotentiometer* cobj = new (std::nothrow) cocos2d::extension::ControlPotentiometer();
|
cocos2d::extension::ControlPotentiometer* cobj = new (std::nothrow) cocos2d::extension::ControlPotentiometer();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::ControlPotentiometer>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::ControlPotentiometer> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::ControlPotentiometer"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlPotentiometer");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_extension_ControlPotentiometer_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_extension_ControlPotentiometer_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::extension::ControlPotentiometer *nobj = new (std::nothrow) cocos2d::extension::ControlPotentiometer();
|
cocos2d::extension::ControlPotentiometer *nobj = new (std::nothrow) cocos2d::extension::ControlPotentiometer();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::extension::ControlPotentiometer");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlPotentiometer");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -3043,11 +2933,9 @@ bool js_cocos2dx_extension_ControlPotentiometer_constructor(JSContext *cx, uint3
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_ControlPotentiometer_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ControlPotentiometer)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_extension_ControlPotentiometer(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_ControlPotentiometer(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_ControlPotentiometer_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_ControlPotentiometer_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -3059,7 +2947,7 @@ void js_register_cocos2dx_extension_ControlPotentiometer(JSContext *cx, JS::Hand
|
||||||
jsb_cocos2d_extension_ControlPotentiometer_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_ControlPotentiometer_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_ControlPotentiometer_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_ControlPotentiometer_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_ControlPotentiometer_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_ControlPotentiometer_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_ControlPotentiometer_class->finalize = js_cocos2d_extension_ControlPotentiometer_finalize;
|
jsb_cocos2d_extension_ControlPotentiometer_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_ControlPotentiometer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_ControlPotentiometer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -3836,37 +3724,23 @@ bool js_cocos2dx_extension_ControlSlider_constructor(JSContext *cx, uint32_t arg
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::ControlSlider* cobj = new (std::nothrow) cocos2d::extension::ControlSlider();
|
cocos2d::extension::ControlSlider* cobj = new (std::nothrow) cocos2d::extension::ControlSlider();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::ControlSlider>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::ControlSlider> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::ControlSlider"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlSlider");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_extension_ControlSlider_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_extension_ControlSlider_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::extension::ControlSlider *nobj = new (std::nothrow) cocos2d::extension::ControlSlider();
|
cocos2d::extension::ControlSlider *nobj = new (std::nothrow) cocos2d::extension::ControlSlider();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::extension::ControlSlider");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlSlider");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -3874,11 +3748,9 @@ bool js_cocos2dx_extension_ControlSlider_constructor(JSContext *cx, uint32_t arg
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_ControlSlider_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ControlSlider)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_extension_ControlSlider(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_ControlSlider(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_ControlSlider_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_ControlSlider_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -3890,7 +3762,7 @@ void js_register_cocos2dx_extension_ControlSlider(JSContext *cx, JS::HandleObjec
|
||||||
jsb_cocos2d_extension_ControlSlider_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_ControlSlider_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_ControlSlider_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_ControlSlider_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_ControlSlider_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_ControlSlider_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_ControlSlider_class->finalize = js_cocos2d_extension_ControlSlider_finalize;
|
jsb_cocos2d_extension_ControlSlider_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_ControlSlider_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_ControlSlider_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -4458,37 +4330,23 @@ bool js_cocos2dx_extension_ControlStepper_constructor(JSContext *cx, uint32_t ar
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::ControlStepper* cobj = new (std::nothrow) cocos2d::extension::ControlStepper();
|
cocos2d::extension::ControlStepper* cobj = new (std::nothrow) cocos2d::extension::ControlStepper();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::ControlStepper>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::ControlStepper> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::ControlStepper"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlStepper");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_extension_ControlStepper_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_extension_ControlStepper_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::extension::ControlStepper *nobj = new (std::nothrow) cocos2d::extension::ControlStepper();
|
cocos2d::extension::ControlStepper *nobj = new (std::nothrow) cocos2d::extension::ControlStepper();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::extension::ControlStepper");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlStepper");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -4496,11 +4354,9 @@ bool js_cocos2dx_extension_ControlStepper_constructor(JSContext *cx, uint32_t ar
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_ControlStepper_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ControlStepper)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_extension_ControlStepper(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_ControlStepper(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_ControlStepper_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_ControlStepper_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -4512,7 +4368,7 @@ void js_register_cocos2dx_extension_ControlStepper(JSContext *cx, JS::HandleObje
|
||||||
jsb_cocos2d_extension_ControlStepper_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_ControlStepper_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_ControlStepper_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_ControlStepper_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_ControlStepper_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_ControlStepper_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_ControlStepper_class->finalize = js_cocos2d_extension_ControlStepper_finalize;
|
jsb_cocos2d_extension_ControlStepper_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_ControlStepper_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_ControlStepper_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -4972,37 +4828,23 @@ bool js_cocos2dx_extension_ControlSwitch_constructor(JSContext *cx, uint32_t arg
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::ControlSwitch* cobj = new (std::nothrow) cocos2d::extension::ControlSwitch();
|
cocos2d::extension::ControlSwitch* cobj = new (std::nothrow) cocos2d::extension::ControlSwitch();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::ControlSwitch>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::ControlSwitch> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::ControlSwitch"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlSwitch");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_extension_ControlSwitch_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_extension_ControlSwitch_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::extension::ControlSwitch *nobj = new (std::nothrow) cocos2d::extension::ControlSwitch();
|
cocos2d::extension::ControlSwitch *nobj = new (std::nothrow) cocos2d::extension::ControlSwitch();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::extension::ControlSwitch");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ControlSwitch");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -5010,11 +4852,9 @@ bool js_cocos2dx_extension_ControlSwitch_constructor(JSContext *cx, uint32_t arg
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
extern JSObject *jsb_cocos2d_extension_Control_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_ControlSwitch_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ControlSwitch)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_extension_ControlSwitch(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_ControlSwitch(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_ControlSwitch_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_ControlSwitch_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -5026,7 +4866,7 @@ void js_register_cocos2dx_extension_ControlSwitch(JSContext *cx, JS::HandleObjec
|
||||||
jsb_cocos2d_extension_ControlSwitch_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_ControlSwitch_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_ControlSwitch_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_ControlSwitch_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_ControlSwitch_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_ControlSwitch_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_ControlSwitch_class->finalize = js_cocos2d_extension_ControlSwitch_finalize;
|
jsb_cocos2d_extension_ControlSwitch_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_ControlSwitch_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_ControlSwitch_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -5835,37 +5675,23 @@ bool js_cocos2dx_extension_ScrollView_constructor(JSContext *cx, uint32_t argc,
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::ScrollView* cobj = new (std::nothrow) cocos2d::extension::ScrollView();
|
cocos2d::extension::ScrollView* cobj = new (std::nothrow) cocos2d::extension::ScrollView();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::ScrollView>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::ScrollView> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::ScrollView"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ScrollView");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_extension_ScrollView_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_extension_ScrollView_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::extension::ScrollView *nobj = new (std::nothrow) cocos2d::extension::ScrollView();
|
cocos2d::extension::ScrollView *nobj = new (std::nothrow) cocos2d::extension::ScrollView();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::extension::ScrollView");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::ScrollView");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -5873,11 +5699,9 @@ bool js_cocos2dx_extension_ScrollView_constructor(JSContext *cx, uint32_t argc,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Layer_prototype;
|
extern JSObject *jsb_cocos2d_Layer_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_ScrollView_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (ScrollView)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_extension_ScrollView(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_ScrollView(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_ScrollView_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_ScrollView_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -5889,7 +5713,7 @@ void js_register_cocos2dx_extension_ScrollView(JSContext *cx, JS::HandleObject g
|
||||||
jsb_cocos2d_extension_ScrollView_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_ScrollView_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_ScrollView_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_ScrollView_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_ScrollView_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_ScrollView_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_ScrollView_class->finalize = js_cocos2d_extension_ScrollView_finalize;
|
jsb_cocos2d_extension_ScrollView_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_ScrollView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_ScrollView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -6038,37 +5862,23 @@ bool js_cocos2dx_extension_TableViewCell_constructor(JSContext *cx, uint32_t arg
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::TableViewCell* cobj = new (std::nothrow) cocos2d::extension::TableViewCell();
|
cocos2d::extension::TableViewCell* cobj = new (std::nothrow) cocos2d::extension::TableViewCell();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::TableViewCell>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::TableViewCell> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::TableViewCell"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::TableViewCell");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_extension_TableViewCell_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_extension_TableViewCell_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::extension::TableViewCell *nobj = new (std::nothrow) cocos2d::extension::TableViewCell();
|
cocos2d::extension::TableViewCell *nobj = new (std::nothrow) cocos2d::extension::TableViewCell();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::extension::TableViewCell");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::TableViewCell");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -6076,11 +5886,9 @@ bool js_cocos2dx_extension_TableViewCell_constructor(JSContext *cx, uint32_t arg
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Node_prototype;
|
extern JSObject *jsb_cocos2d_Node_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_TableViewCell_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (TableViewCell)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_extension_TableViewCell(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_TableViewCell(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_TableViewCell_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_TableViewCell_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -6092,7 +5900,7 @@ void js_register_cocos2dx_extension_TableViewCell(JSContext *cx, JS::HandleObjec
|
||||||
jsb_cocos2d_extension_TableViewCell_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_TableViewCell_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_TableViewCell_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_TableViewCell_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_TableViewCell_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_TableViewCell_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_TableViewCell_class->finalize = js_cocos2d_extension_TableViewCell_finalize;
|
jsb_cocos2d_extension_TableViewCell_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_TableViewCell_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_TableViewCell_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -6420,37 +6228,23 @@ bool js_cocos2dx_extension_TableView_constructor(JSContext *cx, uint32_t argc, j
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::TableView* cobj = new (std::nothrow) cocos2d::extension::TableView();
|
cocos2d::extension::TableView* cobj = new (std::nothrow) cocos2d::extension::TableView();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::TableView>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::TableView> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::TableView"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::TableView");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}static bool js_cocos2dx_extension_TableView_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
}
|
||||||
|
static bool js_cocos2dx_extension_TableView_ctor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
||||||
cocos2d::extension::TableView *nobj = new (std::nothrow) cocos2d::extension::TableView();
|
cocos2d::extension::TableView *nobj = new (std::nothrow) cocos2d::extension::TableView();
|
||||||
if (nobj) {
|
auto newproxy = jsb_new_proxy(nobj, obj);
|
||||||
nobj->autorelease();
|
jsb_ref_init(cx, &newproxy->obj, nobj, "cocos2d::extension::TableView");
|
||||||
}
|
|
||||||
js_proxy_t* p = jsb_new_proxy(nobj, obj);
|
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::TableView");
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
if (JS_HasProperty(cx, obj, "_ctor", &isFound) && isFound)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
||||||
|
@ -6458,11 +6252,9 @@ bool js_cocos2dx_extension_TableView_constructor(JSContext *cx, uint32_t argc, j
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_extension_ScrollView_prototype;
|
extern JSObject *jsb_cocos2d_extension_ScrollView_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_TableView_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (TableView)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_extension_TableView(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_TableView(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_TableView_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_TableView_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -6474,7 +6266,7 @@ void js_register_cocos2dx_extension_TableView(JSContext *cx, JS::HandleObject gl
|
||||||
jsb_cocos2d_extension_TableView_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_TableView_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_TableView_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_TableView_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_TableView_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_TableView_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_TableView_class->finalize = js_cocos2d_extension_TableView_finalize;
|
jsb_cocos2d_extension_TableView_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_TableView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_TableView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -6692,34 +6484,20 @@ bool js_cocos2dx_extension_EventAssetsManagerEx_constructor(JSContext *cx, uint3
|
||||||
ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2);
|
ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2);
|
||||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_EventAssetsManagerEx_constructor : Error processing arguments");
|
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_EventAssetsManagerEx_constructor : Error processing arguments");
|
||||||
cocos2d::extension::EventAssetsManagerEx* cobj = new (std::nothrow) cocos2d::extension::EventAssetsManagerEx(arg0, arg1, arg2);
|
cocos2d::extension::EventAssetsManagerEx* cobj = new (std::nothrow) cocos2d::extension::EventAssetsManagerEx(arg0, arg1, arg2);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::EventAssetsManagerEx>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::EventAssetsManagerEx> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::EventAssetsManagerEx"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::EventAssetsManagerEx");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_EventCustom_prototype;
|
extern JSObject *jsb_cocos2d_EventCustom_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_EventAssetsManagerEx_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (EventAssetsManagerEx)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_extension_EventAssetsManagerEx(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_EventAssetsManagerEx(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_EventAssetsManagerEx_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_EventAssetsManagerEx_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_extension_EventAssetsManagerEx_class->name = "EventAssetsManager";
|
jsb_cocos2d_extension_EventAssetsManagerEx_class->name = "EventAssetsManager";
|
||||||
|
@ -6730,7 +6508,7 @@ void js_register_cocos2dx_extension_EventAssetsManagerEx(JSContext *cx, JS::Hand
|
||||||
jsb_cocos2d_extension_EventAssetsManagerEx_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_EventAssetsManagerEx_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_EventAssetsManagerEx_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_EventAssetsManagerEx_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_EventAssetsManagerEx_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_EventAssetsManagerEx_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_EventAssetsManagerEx_class->finalize = js_cocos2d_extension_EventAssetsManagerEx_finalize;
|
jsb_cocos2d_extension_EventAssetsManagerEx_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_EventAssetsManagerEx_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_EventAssetsManagerEx_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -6898,9 +6676,6 @@ bool js_cocos2dx_extension_Manifest_getSearchPaths(JSContext *cx, uint32_t argc,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_extension_Manifest_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Manifest)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_extension_Manifest(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_Manifest(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_Manifest_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_Manifest_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_extension_Manifest_class->name = "Manifest";
|
jsb_cocos2d_extension_Manifest_class->name = "Manifest";
|
||||||
|
@ -6911,7 +6686,7 @@ void js_register_cocos2dx_extension_Manifest(JSContext *cx, JS::HandleObject glo
|
||||||
jsb_cocos2d_extension_Manifest_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_Manifest_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_Manifest_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_Manifest_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_Manifest_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_Manifest_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_Manifest_class->finalize = js_cocos2d_extension_Manifest_finalize;
|
jsb_cocos2d_extension_Manifest_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_Manifest_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_Manifest_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -7121,32 +6896,18 @@ bool js_cocos2dx_extension_AssetsManagerEx_constructor(JSContext *cx, uint32_t a
|
||||||
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
||||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_AssetsManagerEx_constructor : Error processing arguments");
|
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_AssetsManagerEx_constructor : Error processing arguments");
|
||||||
cocos2d::extension::AssetsManagerEx* cobj = new (std::nothrow) cocos2d::extension::AssetsManagerEx(arg0, arg1);
|
cocos2d::extension::AssetsManagerEx* cobj = new (std::nothrow) cocos2d::extension::AssetsManagerEx(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::AssetsManagerEx>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::AssetsManagerEx> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::AssetsManagerEx"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::AssetsManagerEx");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_extension_AssetsManagerEx_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (AssetsManagerEx)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_extension_AssetsManagerEx(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_AssetsManagerEx(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_AssetsManagerEx_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_AssetsManagerEx_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_extension_AssetsManagerEx_class->name = "AssetsManager";
|
jsb_cocos2d_extension_AssetsManagerEx_class->name = "AssetsManager";
|
||||||
|
@ -7157,7 +6918,7 @@ void js_register_cocos2dx_extension_AssetsManagerEx(JSContext *cx, JS::HandleObj
|
||||||
jsb_cocos2d_extension_AssetsManagerEx_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_AssetsManagerEx_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_AssetsManagerEx_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_AssetsManagerEx_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_AssetsManagerEx_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_AssetsManagerEx_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_AssetsManagerEx_class->finalize = js_cocos2d_extension_AssetsManagerEx_finalize;
|
jsb_cocos2d_extension_AssetsManagerEx_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_AssetsManagerEx_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_AssetsManagerEx_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -7329,34 +7090,20 @@ bool js_cocos2dx_extension_EventListenerAssetsManagerEx_constructor(JSContext *c
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::extension::EventListenerAssetsManagerEx* cobj = new (std::nothrow) cocos2d::extension::EventListenerAssetsManagerEx();
|
cocos2d::extension::EventListenerAssetsManagerEx* cobj = new (std::nothrow) cocos2d::extension::EventListenerAssetsManagerEx();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::extension::EventListenerAssetsManagerEx>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::extension::EventListenerAssetsManagerEx> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::extension::EventListenerAssetsManagerEx"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::extension::EventListenerAssetsManagerEx");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_EventListenerCustom_prototype;
|
extern JSObject *jsb_cocos2d_EventListenerCustom_prototype;
|
||||||
|
|
||||||
void js_cocos2d_extension_EventListenerAssetsManagerEx_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (EventListenerAssetsManagerEx)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_extension_EventListenerAssetsManagerEx(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_extension_EventListenerAssetsManagerEx(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->name = "EventListenerAssetsManager";
|
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->name = "EventListenerAssetsManager";
|
||||||
|
@ -7367,7 +7114,7 @@ void js_register_cocos2dx_extension_EventListenerAssetsManagerEx(JSContext *cx,
|
||||||
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->convert = JS_ConvertStub;
|
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->finalize = js_cocos2d_extension_EventListenerAssetsManagerEx_finalize;
|
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_extension_EventListenerAssetsManagerEx_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
|
|
@ -5,30 +5,8 @@
|
||||||
#include "navmesh/jsb_cocos2dx_navmesh_conversions.h"
|
#include "navmesh/jsb_cocos2dx_navmesh_conversions.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -584,34 +562,20 @@ bool js_cocos2dx_navmesh_NavMeshAgent_constructor(JSContext *cx, uint32_t argc,
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::NavMeshAgent* cobj = new (std::nothrow) cocos2d::NavMeshAgent();
|
cocos2d::NavMeshAgent* cobj = new (std::nothrow) cocos2d::NavMeshAgent();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::NavMeshAgent>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::NavMeshAgent> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::NavMeshAgent"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::NavMeshAgent");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Component_prototype;
|
extern JSObject *jsb_cocos2d_Component_prototype;
|
||||||
|
|
||||||
void js_cocos2d_NavMeshAgent_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (NavMeshAgent)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_navmesh_NavMeshAgent(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_navmesh_NavMeshAgent(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_NavMeshAgent_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_NavMeshAgent_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_NavMeshAgent_class->name = "NavMeshAgent";
|
jsb_cocos2d_NavMeshAgent_class->name = "NavMeshAgent";
|
||||||
|
@ -622,7 +586,7 @@ void js_register_cocos2dx_navmesh_NavMeshAgent(JSContext *cx, JS::HandleObject g
|
||||||
jsb_cocos2d_NavMeshAgent_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_NavMeshAgent_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_NavMeshAgent_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_NavMeshAgent_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_NavMeshAgent_class->convert = JS_ConvertStub;
|
jsb_cocos2d_NavMeshAgent_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_NavMeshAgent_class->finalize = js_cocos2d_NavMeshAgent_finalize;
|
jsb_cocos2d_NavMeshAgent_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_NavMeshAgent_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_NavMeshAgent_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -862,34 +826,20 @@ bool js_cocos2dx_navmesh_NavMeshObstacle_constructor(JSContext *cx, uint32_t arg
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::NavMeshObstacle* cobj = new (std::nothrow) cocos2d::NavMeshObstacle();
|
cocos2d::NavMeshObstacle* cobj = new (std::nothrow) cocos2d::NavMeshObstacle();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::NavMeshObstacle>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::NavMeshObstacle> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::NavMeshObstacle"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::NavMeshObstacle");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Component_prototype;
|
extern JSObject *jsb_cocos2d_Component_prototype;
|
||||||
|
|
||||||
void js_cocos2d_NavMeshObstacle_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (NavMeshObstacle)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_navmesh_NavMeshObstacle(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_navmesh_NavMeshObstacle(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_NavMeshObstacle_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_NavMeshObstacle_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_NavMeshObstacle_class->name = "NavMeshObstacle";
|
jsb_cocos2d_NavMeshObstacle_class->name = "NavMeshObstacle";
|
||||||
|
@ -900,7 +850,7 @@ void js_register_cocos2dx_navmesh_NavMeshObstacle(JSContext *cx, JS::HandleObjec
|
||||||
jsb_cocos2d_NavMeshObstacle_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_NavMeshObstacle_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_NavMeshObstacle_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_NavMeshObstacle_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_NavMeshObstacle_class->convert = JS_ConvertStub;
|
jsb_cocos2d_NavMeshObstacle_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_NavMeshObstacle_class->finalize = js_cocos2d_NavMeshObstacle_finalize;
|
jsb_cocos2d_NavMeshObstacle_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_NavMeshObstacle_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_NavMeshObstacle_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -1174,32 +1124,18 @@ bool js_cocos2dx_navmesh_NavMesh_constructor(JSContext *cx, uint32_t argc, jsval
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::NavMesh* cobj = new (std::nothrow) cocos2d::NavMesh();
|
cocos2d::NavMesh* cobj = new (std::nothrow) cocos2d::NavMesh();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::NavMesh>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::NavMesh> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::NavMesh"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::NavMesh");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_NavMesh_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (NavMesh)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_navmesh_NavMesh(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_navmesh_NavMesh(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_NavMesh_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_NavMesh_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_NavMesh_class->name = "NavMesh";
|
jsb_cocos2d_NavMesh_class->name = "NavMesh";
|
||||||
|
@ -1210,7 +1146,7 @@ void js_register_cocos2dx_navmesh_NavMesh(JSContext *cx, JS::HandleObject global
|
||||||
jsb_cocos2d_NavMesh_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_NavMesh_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_NavMesh_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_NavMesh_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_NavMesh_class->convert = JS_ConvertStub;
|
jsb_cocos2d_NavMesh_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_NavMesh_class->finalize = js_cocos2d_NavMesh_finalize;
|
jsb_cocos2d_NavMesh_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_NavMesh_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_NavMesh_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
|
|
@ -5,30 +5,8 @@
|
||||||
#include "physics3d/jsb_cocos2dx_physics3d_manual.h"
|
#include "physics3d/jsb_cocos2dx_physics3d_manual.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -357,32 +335,18 @@ bool js_cocos2dx_physics3d_Physics3DShape_constructor(JSContext *cx, uint32_t ar
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Physics3DShape* cobj = new (std::nothrow) cocos2d::Physics3DShape();
|
cocos2d::Physics3DShape* cobj = new (std::nothrow) cocos2d::Physics3DShape();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Physics3DShape>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Physics3DShape> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Physics3DShape"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DShape");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_Physics3DShape_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DShape)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DShape(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DShape(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DShape_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DShape_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DShape_class->name = "Physics3DShape";
|
jsb_cocos2d_Physics3DShape_class->name = "Physics3DShape";
|
||||||
|
@ -393,7 +357,7 @@ void js_register_cocos2dx_physics3d_Physics3DShape(JSContext *cx, JS::HandleObje
|
||||||
jsb_cocos2d_Physics3DShape_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DShape_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DShape_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DShape_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DShape_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DShape_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DShape_class->finalize = js_cocos2d_Physics3DShape_finalize;
|
jsb_cocos2d_Physics3DShape_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DShape_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DShape_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -642,9 +606,6 @@ bool js_cocos2dx_physics3d_Physics3DObject_needCollisionCallback(JSContext *cx,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_Physics3DObject_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DObject)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DObject(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DObject(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DObject_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DObject_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DObject_class->name = "Physics3DObject";
|
jsb_cocos2d_Physics3DObject_class->name = "Physics3DObject";
|
||||||
|
@ -655,7 +616,7 @@ void js_register_cocos2dx_physics3d_Physics3DObject(JSContext *cx, JS::HandleObj
|
||||||
jsb_cocos2d_Physics3DObject_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DObject_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DObject_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DObject_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DObject_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DObject_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DObject_class->finalize = js_cocos2d_Physics3DObject_finalize;
|
jsb_cocos2d_Physics3DObject_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DObject_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DObject_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -1714,34 +1675,20 @@ bool js_cocos2dx_physics3d_Physics3DRigidBody_constructor(JSContext *cx, uint32_
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Physics3DRigidBody* cobj = new (std::nothrow) cocos2d::Physics3DRigidBody();
|
cocos2d::Physics3DRigidBody* cobj = new (std::nothrow) cocos2d::Physics3DRigidBody();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Physics3DRigidBody>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Physics3DRigidBody> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Physics3DRigidBody"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DRigidBody");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Physics3DObject_prototype;
|
extern JSObject *jsb_cocos2d_Physics3DObject_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Physics3DRigidBody_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DRigidBody)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DRigidBody(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DRigidBody(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DRigidBody_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DRigidBody_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DRigidBody_class->name = "Physics3DRigidBody";
|
jsb_cocos2d_Physics3DRigidBody_class->name = "Physics3DRigidBody";
|
||||||
|
@ -1752,7 +1699,7 @@ void js_register_cocos2dx_physics3d_Physics3DRigidBody(JSContext *cx, JS::Handle
|
||||||
jsb_cocos2d_Physics3DRigidBody_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DRigidBody_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DRigidBody_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DRigidBody_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DRigidBody_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DRigidBody_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DRigidBody_class->finalize = js_cocos2d_Physics3DRigidBody_finalize;
|
jsb_cocos2d_Physics3DRigidBody_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DRigidBody_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DRigidBody_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -2123,34 +2070,20 @@ bool js_cocos2dx_physics3d_Physics3DComponent_constructor(JSContext *cx, uint32_
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Physics3DComponent* cobj = new (std::nothrow) cocos2d::Physics3DComponent();
|
cocos2d::Physics3DComponent* cobj = new (std::nothrow) cocos2d::Physics3DComponent();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Physics3DComponent>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Physics3DComponent> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Physics3DComponent"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DComponent");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Component_prototype;
|
extern JSObject *jsb_cocos2d_Component_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Physics3DComponent_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DComponent)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DComponent(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DComponent(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DComponent_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DComponent_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DComponent_class->name = "Physics3DComponent";
|
jsb_cocos2d_Physics3DComponent_class->name = "Physics3DComponent";
|
||||||
|
@ -2161,7 +2094,7 @@ void js_register_cocos2dx_physics3d_Physics3DComponent(JSContext *cx, JS::Handle
|
||||||
jsb_cocos2d_Physics3DComponent_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DComponent_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DComponent_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DComponent_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DComponent_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DComponent_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DComponent_class->finalize = js_cocos2d_Physics3DComponent_finalize;
|
jsb_cocos2d_Physics3DComponent_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DComponent_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DComponent_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -2287,34 +2220,20 @@ bool js_cocos2dx_physics3d_PhysicsSprite3D_constructor(JSContext *cx, uint32_t a
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::PhysicsSprite3D* cobj = new (std::nothrow) cocos2d::PhysicsSprite3D();
|
cocos2d::PhysicsSprite3D* cobj = new (std::nothrow) cocos2d::PhysicsSprite3D();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::PhysicsSprite3D>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::PhysicsSprite3D> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::PhysicsSprite3D"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::PhysicsSprite3D");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Sprite3D_prototype;
|
extern JSObject *jsb_cocos2d_Sprite3D_prototype;
|
||||||
|
|
||||||
void js_cocos2d_PhysicsSprite3D_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (PhysicsSprite3D)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_PhysicsSprite3D(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_PhysicsSprite3D(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_PhysicsSprite3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_PhysicsSprite3D_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_PhysicsSprite3D_class->name = "PhysicsSprite3D";
|
jsb_cocos2d_PhysicsSprite3D_class->name = "PhysicsSprite3D";
|
||||||
|
@ -2325,7 +2244,7 @@ void js_register_cocos2dx_physics3d_PhysicsSprite3D(JSContext *cx, JS::HandleObj
|
||||||
jsb_cocos2d_PhysicsSprite3D_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_PhysicsSprite3D_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_PhysicsSprite3D_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_PhysicsSprite3D_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_PhysicsSprite3D_class->convert = JS_ConvertStub;
|
jsb_cocos2d_PhysicsSprite3D_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_PhysicsSprite3D_class->finalize = js_cocos2d_PhysicsSprite3D_finalize;
|
jsb_cocos2d_PhysicsSprite3D_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_PhysicsSprite3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_PhysicsSprite3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -2826,32 +2745,18 @@ bool js_cocos2dx_physics3d_Physics3DWorld_constructor(JSContext *cx, uint32_t ar
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Physics3DWorld* cobj = new (std::nothrow) cocos2d::Physics3DWorld();
|
cocos2d::Physics3DWorld* cobj = new (std::nothrow) cocos2d::Physics3DWorld();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Physics3DWorld>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Physics3DWorld> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Physics3DWorld"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DWorld");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_Physics3DWorld_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DWorld)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DWorld(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DWorld(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DWorld_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DWorld_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DWorld_class->name = "Physics3DWorld";
|
jsb_cocos2d_Physics3DWorld_class->name = "Physics3DWorld";
|
||||||
|
@ -2862,7 +2767,7 @@ void js_register_cocos2dx_physics3d_Physics3DWorld(JSContext *cx, JS::HandleObje
|
||||||
jsb_cocos2d_Physics3DWorld_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DWorld_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DWorld_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DWorld_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DWorld_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DWorld_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DWorld_class->finalize = js_cocos2d_Physics3DWorld_finalize;
|
jsb_cocos2d_Physics3DWorld_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DWorld_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DWorld_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -3162,9 +3067,6 @@ bool js_cocos2dx_physics3d_Physics3DConstraint_getbtContraint(JSContext *cx, uin
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void js_cocos2d_Physics3DConstraint_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DConstraint)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DConstraint(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DConstraint(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DConstraint_class->name = "Physics3DConstraint";
|
jsb_cocos2d_Physics3DConstraint_class->name = "Physics3DConstraint";
|
||||||
|
@ -3175,7 +3077,7 @@ void js_register_cocos2dx_physics3d_Physics3DConstraint(JSContext *cx, JS::Handl
|
||||||
jsb_cocos2d_Physics3DConstraint_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DConstraint_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DConstraint_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DConstraint_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DConstraint_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DConstraint_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DConstraint_class->finalize = js_cocos2d_Physics3DConstraint_finalize;
|
jsb_cocos2d_Physics3DConstraint_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -3459,34 +3361,20 @@ bool js_cocos2dx_physics3d_Physics3DPointToPointConstraint_constructor(JSContext
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Physics3DPointToPointConstraint* cobj = new (std::nothrow) cocos2d::Physics3DPointToPointConstraint();
|
cocos2d::Physics3DPointToPointConstraint* cobj = new (std::nothrow) cocos2d::Physics3DPointToPointConstraint();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Physics3DPointToPointConstraint>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Physics3DPointToPointConstraint> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Physics3DPointToPointConstraint"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DPointToPointConstraint");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Physics3DPointToPointConstraint_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DPointToPointConstraint)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DPointToPointConstraint(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DPointToPointConstraint(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DPointToPointConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DPointToPointConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DPointToPointConstraint_class->name = "Physics3DPointToPointConstraint";
|
jsb_cocos2d_Physics3DPointToPointConstraint_class->name = "Physics3DPointToPointConstraint";
|
||||||
|
@ -3497,7 +3385,7 @@ void js_register_cocos2dx_physics3d_Physics3DPointToPointConstraint(JSContext *c
|
||||||
jsb_cocos2d_Physics3DPointToPointConstraint_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DPointToPointConstraint_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DPointToPointConstraint_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DPointToPointConstraint_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DPointToPointConstraint_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DPointToPointConstraint_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DPointToPointConstraint_class->finalize = js_cocos2d_Physics3DPointToPointConstraint_finalize;
|
jsb_cocos2d_Physics3DPointToPointConstraint_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DPointToPointConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DPointToPointConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -4370,34 +4258,20 @@ bool js_cocos2dx_physics3d_Physics3DHingeConstraint_constructor(JSContext *cx, u
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Physics3DHingeConstraint* cobj = new (std::nothrow) cocos2d::Physics3DHingeConstraint();
|
cocos2d::Physics3DHingeConstraint* cobj = new (std::nothrow) cocos2d::Physics3DHingeConstraint();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Physics3DHingeConstraint>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Physics3DHingeConstraint> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Physics3DHingeConstraint"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DHingeConstraint");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Physics3DHingeConstraint_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DHingeConstraint)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DHingeConstraint(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DHingeConstraint(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DHingeConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DHingeConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DHingeConstraint_class->name = "Physics3DHingeConstraint";
|
jsb_cocos2d_Physics3DHingeConstraint_class->name = "Physics3DHingeConstraint";
|
||||||
|
@ -4408,7 +4282,7 @@ void js_register_cocos2dx_physics3d_Physics3DHingeConstraint(JSContext *cx, JS::
|
||||||
jsb_cocos2d_Physics3DHingeConstraint_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DHingeConstraint_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DHingeConstraint_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DHingeConstraint_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DHingeConstraint_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DHingeConstraint_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DHingeConstraint_class->finalize = js_cocos2d_Physics3DHingeConstraint_finalize;
|
jsb_cocos2d_Physics3DHingeConstraint_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DHingeConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DHingeConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -5733,34 +5607,20 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_constructor(JSContext *cx,
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Physics3DSliderConstraint* cobj = new (std::nothrow) cocos2d::Physics3DSliderConstraint();
|
cocos2d::Physics3DSliderConstraint* cobj = new (std::nothrow) cocos2d::Physics3DSliderConstraint();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Physics3DSliderConstraint>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Physics3DSliderConstraint> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Physics3DSliderConstraint"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DSliderConstraint");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Physics3DSliderConstraint_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DSliderConstraint)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DSliderConstraint(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DSliderConstraint(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DSliderConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DSliderConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DSliderConstraint_class->name = "Physics3DSliderConstraint";
|
jsb_cocos2d_Physics3DSliderConstraint_class->name = "Physics3DSliderConstraint";
|
||||||
|
@ -5771,7 +5631,7 @@ void js_register_cocos2dx_physics3d_Physics3DSliderConstraint(JSContext *cx, JS:
|
||||||
jsb_cocos2d_Physics3DSliderConstraint_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DSliderConstraint_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DSliderConstraint_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DSliderConstraint_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DSliderConstraint_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DSliderConstraint_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DSliderConstraint_class->finalize = js_cocos2d_Physics3DSliderConstraint_finalize;
|
jsb_cocos2d_Physics3DSliderConstraint_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DSliderConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DSliderConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -6339,34 +6199,20 @@ bool js_cocos2dx_physics3d_Physics3DConeTwistConstraint_constructor(JSContext *c
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Physics3DConeTwistConstraint* cobj = new (std::nothrow) cocos2d::Physics3DConeTwistConstraint();
|
cocos2d::Physics3DConeTwistConstraint* cobj = new (std::nothrow) cocos2d::Physics3DConeTwistConstraint();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Physics3DConeTwistConstraint>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Physics3DConeTwistConstraint> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Physics3DConeTwistConstraint"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3DConeTwistConstraint");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Physics3DConeTwistConstraint_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3DConeTwistConstraint)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3DConeTwistConstraint(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3DConeTwistConstraint(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3DConeTwistConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3DConeTwistConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3DConeTwistConstraint_class->name = "Physics3DConeTwistConstraint";
|
jsb_cocos2d_Physics3DConeTwistConstraint_class->name = "Physics3DConeTwistConstraint";
|
||||||
|
@ -6377,7 +6223,7 @@ void js_register_cocos2dx_physics3d_Physics3DConeTwistConstraint(JSContext *cx,
|
||||||
jsb_cocos2d_Physics3DConeTwistConstraint_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3DConeTwistConstraint_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3DConeTwistConstraint_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3DConeTwistConstraint_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3DConeTwistConstraint_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3DConeTwistConstraint_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3DConeTwistConstraint_class->finalize = js_cocos2d_Physics3DConeTwistConstraint_finalize;
|
jsb_cocos2d_Physics3DConeTwistConstraint_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3DConeTwistConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3DConeTwistConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -6736,34 +6582,20 @@ bool js_cocos2dx_physics3d_Physics3D6DofConstraint_constructor(JSContext *cx, ui
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
cocos2d::Physics3D6DofConstraint* cobj = new (std::nothrow) cocos2d::Physics3D6DofConstraint();
|
cocos2d::Physics3D6DofConstraint* cobj = new (std::nothrow) cocos2d::Physics3D6DofConstraint();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
js_type_class_t *typeClass = js_get_type_from_native<cocos2d::Physics3D6DofConstraint>(cobj);
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
TypeTest<cocos2d::Physics3D6DofConstraint> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
// link the native object with the javascript object
|
// link the native object with the javascript object
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, cobj, typeClass, "cocos2d::Physics3D6DofConstraint"));
|
||||||
AddNamedObjectRoot(cx, &p->obj, "cocos2d::Physics3D6DofConstraint");
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok)
|
if (JS_HasProperty(cx, jsobj, "_ctor", &ok) && ok)
|
||||||
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args);
|
ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(jsobj), "_ctor", args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
extern JSObject *jsb_cocos2d_Physics3DConstraint_prototype;
|
||||||
|
|
||||||
void js_cocos2d_Physics3D6DofConstraint_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (Physics3D6DofConstraint)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_physics3d_Physics3D6DofConstraint(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_physics3d_Physics3D6DofConstraint(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_cocos2d_Physics3D6DofConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_cocos2d_Physics3D6DofConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_cocos2d_Physics3D6DofConstraint_class->name = "Physics3D6DofConstraint";
|
jsb_cocos2d_Physics3D6DofConstraint_class->name = "Physics3D6DofConstraint";
|
||||||
|
@ -6774,7 +6606,7 @@ void js_register_cocos2dx_physics3d_Physics3D6DofConstraint(JSContext *cx, JS::H
|
||||||
jsb_cocos2d_Physics3D6DofConstraint_class->enumerate = JS_EnumerateStub;
|
jsb_cocos2d_Physics3D6DofConstraint_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_cocos2d_Physics3D6DofConstraint_class->resolve = JS_ResolveStub;
|
jsb_cocos2d_Physics3D6DofConstraint_class->resolve = JS_ResolveStub;
|
||||||
jsb_cocos2d_Physics3D6DofConstraint_class->convert = JS_ConvertStub;
|
jsb_cocos2d_Physics3D6DofConstraint_class->convert = JS_ConvertStub;
|
||||||
jsb_cocos2d_Physics3D6DofConstraint_class->finalize = js_cocos2d_Physics3D6DofConstraint_finalize;
|
jsb_cocos2d_Physics3D6DofConstraint_class->finalize = jsb_ref_finalize;
|
||||||
jsb_cocos2d_Physics3D6DofConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_cocos2d_Physics3D6DofConstraint_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
|
|
@ -4,30 +4,8 @@
|
||||||
#include "jsb_cocos2dx_spine_manual.h"
|
#include "jsb_cocos2dx_spine_manual.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {
|
static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
{
|
||||||
JS::RootedValue initializing(cx);
|
|
||||||
bool isNewValid = true;
|
|
||||||
JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject());
|
|
||||||
isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean();
|
|
||||||
if (isNewValid)
|
|
||||||
{
|
|
||||||
TypeTest<T> t;
|
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
|
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
|
||||||
JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(_tmp));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -632,25 +610,14 @@ bool js_cocos2dx_spine_SkeletonRenderer_constructor(JSContext *cx, uint32_t argc
|
||||||
ok = false;
|
ok = false;
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0);
|
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonRenderer> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonRenderer>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonRenderer");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonRenderer");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -663,50 +630,28 @@ bool js_cocos2dx_spine_SkeletonRenderer_constructor(JSContext *cx, uint32_t argc
|
||||||
bool arg1;
|
bool arg1;
|
||||||
arg1 = JS::ToBoolean(args.get(1));
|
arg1 = JS::ToBoolean(args.get(1));
|
||||||
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1);
|
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonRenderer> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonRenderer>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonRenderer");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonRenderer");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
cobj = new (std::nothrow) spine::SkeletonRenderer();
|
cobj = new (std::nothrow) spine::SkeletonRenderer();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonRenderer> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonRenderer>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonRenderer");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonRenderer");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -720,25 +665,14 @@ bool js_cocos2dx_spine_SkeletonRenderer_constructor(JSContext *cx, uint32_t argc
|
||||||
ok = false;
|
ok = false;
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1);
|
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonRenderer> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonRenderer>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonRenderer");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonRenderer");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -755,25 +689,14 @@ bool js_cocos2dx_spine_SkeletonRenderer_constructor(JSContext *cx, uint32_t argc
|
||||||
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1, arg2);
|
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1, arg2);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonRenderer> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonRenderer>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonRenderer");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonRenderer");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -786,25 +709,14 @@ bool js_cocos2dx_spine_SkeletonRenderer_constructor(JSContext *cx, uint32_t argc
|
||||||
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1);
|
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonRenderer> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonRenderer>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonRenderer");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonRenderer");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -820,25 +732,14 @@ bool js_cocos2dx_spine_SkeletonRenderer_constructor(JSContext *cx, uint32_t argc
|
||||||
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1, arg2);
|
cobj = new (std::nothrow) spine::SkeletonRenderer(arg0, arg1, arg2);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonRenderer> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonRenderer>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonRenderer");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonRenderer");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -856,9 +757,6 @@ bool js_cocos2dx_spine_SkeletonRenderer_constructor(JSContext *cx, uint32_t argc
|
||||||
|
|
||||||
extern JSObject *jsb_cocos2d_Node_prototype;
|
extern JSObject *jsb_cocos2d_Node_prototype;
|
||||||
|
|
||||||
void js_spine_SkeletonRenderer_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (SkeletonRenderer)", obj);
|
|
||||||
}
|
|
||||||
void js_register_cocos2dx_spine_SkeletonRenderer(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_spine_SkeletonRenderer(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_spine_SkeletonRenderer_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_spine_SkeletonRenderer_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
jsb_spine_SkeletonRenderer_class->name = "Skeleton";
|
jsb_spine_SkeletonRenderer_class->name = "Skeleton";
|
||||||
|
@ -869,7 +767,7 @@ void js_register_cocos2dx_spine_SkeletonRenderer(JSContext *cx, JS::HandleObject
|
||||||
jsb_spine_SkeletonRenderer_class->enumerate = JS_EnumerateStub;
|
jsb_spine_SkeletonRenderer_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_spine_SkeletonRenderer_class->resolve = JS_ResolveStub;
|
jsb_spine_SkeletonRenderer_class->resolve = JS_ResolveStub;
|
||||||
jsb_spine_SkeletonRenderer_class->convert = JS_ConvertStub;
|
jsb_spine_SkeletonRenderer_class->convert = JS_ConvertStub;
|
||||||
jsb_spine_SkeletonRenderer_class->finalize = js_spine_SkeletonRenderer_finalize;
|
jsb_spine_SkeletonRenderer_class->finalize = jsb_ref_finalize;
|
||||||
jsb_spine_SkeletonRenderer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_spine_SkeletonRenderer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
@ -1568,25 +1466,14 @@ bool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t arg
|
||||||
ok = false;
|
ok = false;
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonAnimation> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonAnimation>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1599,50 +1486,28 @@ bool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t arg
|
||||||
bool arg1;
|
bool arg1;
|
||||||
arg1 = JS::ToBoolean(args.get(1));
|
arg1 = JS::ToBoolean(args.get(1));
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonAnimation> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonAnimation>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation();
|
cobj = new (std::nothrow) spine::SkeletonAnimation();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonAnimation> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonAnimation>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1656,25 +1521,14 @@ bool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t arg
|
||||||
ok = false;
|
ok = false;
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonAnimation> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonAnimation>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1691,25 +1545,14 @@ bool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t arg
|
||||||
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonAnimation> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonAnimation>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1722,25 +1565,14 @@ bool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t arg
|
||||||
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonAnimation> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonAnimation>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1756,25 +1588,14 @@ bool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t arg
|
||||||
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeTest<spine::SkeletonAnimation> t;
|
js_type_class_t *typeClass = js_get_type_from_native<spine::SkeletonAnimation>(cobj);
|
||||||
js_type_class_t *typeClass = nullptr;
|
|
||||||
std::string typeName = t.s_name();
|
|
||||||
auto typeMapIter = _js_global_type_map.find(typeName);
|
|
||||||
CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!");
|
|
||||||
typeClass = typeMapIter->second;
|
|
||||||
CCASSERT(typeClass, "The value is null.");
|
|
||||||
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
// obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);
|
||||||
JS::RootedObject proto(cx, typeClass->proto.ref());
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
obj = JS_NewObject(cx, typeClass->jsclass, proto, parent);
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1802,14 +1623,9 @@ bool js_cocos2dx_spine_SkeletonAnimation_ctor(JSContext *cx, uint32_t argc, jsva
|
||||||
ok = false;
|
ok = false;
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1822,28 +1638,18 @@ bool js_cocos2dx_spine_SkeletonAnimation_ctor(JSContext *cx, uint32_t argc, jsva
|
||||||
bool arg1;
|
bool arg1;
|
||||||
arg1 = JS::ToBoolean(args.get(1));
|
arg1 = JS::ToBoolean(args.get(1));
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation();
|
cobj = new (std::nothrow) spine::SkeletonAnimation();
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1857,14 +1663,9 @@ bool js_cocos2dx_spine_SkeletonAnimation_ctor(JSContext *cx, uint32_t argc, jsva
|
||||||
ok = false;
|
ok = false;
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1881,14 +1682,9 @@ bool js_cocos2dx_spine_SkeletonAnimation_ctor(JSContext *cx, uint32_t argc, jsva
|
||||||
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1901,14 +1697,9 @@ bool js_cocos2dx_spine_SkeletonAnimation_ctor(JSContext *cx, uint32_t argc, jsva
|
||||||
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
ok &= jsval_to_std_string(cx, args.get(1), &arg1);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1924,14 +1715,9 @@ bool js_cocos2dx_spine_SkeletonAnimation_ctor(JSContext *cx, uint32_t argc, jsva
|
||||||
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2);
|
||||||
if (!ok) { ok = true; break; }
|
if (!ok) { ok = true; break; }
|
||||||
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2);
|
cobj = new (std::nothrow) spine::SkeletonAnimation(arg0, arg1, arg2);
|
||||||
cocos2d::Ref *_ccobj = dynamic_cast<cocos2d::Ref *>(cobj);
|
|
||||||
if (_ccobj) {
|
|
||||||
_ccobj->autorelease();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
js_proxy_t* p = jsb_new_proxy(cobj, obj);
|
||||||
AddNamedObjectRoot(cx, &p->obj, "spine::SkeletonAnimation");
|
jsb_ref_init(cx, &p->obj, cobj, "spine::SkeletonAnimation");
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1949,9 +1735,6 @@ bool js_cocos2dx_spine_SkeletonAnimation_ctor(JSContext *cx, uint32_t argc, jsva
|
||||||
|
|
||||||
extern JSObject *jsb_spine_SkeletonRenderer_prototype;
|
extern JSObject *jsb_spine_SkeletonRenderer_prototype;
|
||||||
|
|
||||||
void js_spine_SkeletonAnimation_finalize(JSFreeOp *fop, JSObject *obj) {
|
|
||||||
CCLOGINFO("jsbindings: finalizing JS object %p (SkeletonAnimation)", obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void js_register_cocos2dx_spine_SkeletonAnimation(JSContext *cx, JS::HandleObject global) {
|
void js_register_cocos2dx_spine_SkeletonAnimation(JSContext *cx, JS::HandleObject global) {
|
||||||
jsb_spine_SkeletonAnimation_class = (JSClass *)calloc(1, sizeof(JSClass));
|
jsb_spine_SkeletonAnimation_class = (JSClass *)calloc(1, sizeof(JSClass));
|
||||||
|
@ -1963,7 +1746,7 @@ void js_register_cocos2dx_spine_SkeletonAnimation(JSContext *cx, JS::HandleObjec
|
||||||
jsb_spine_SkeletonAnimation_class->enumerate = JS_EnumerateStub;
|
jsb_spine_SkeletonAnimation_class->enumerate = JS_EnumerateStub;
|
||||||
jsb_spine_SkeletonAnimation_class->resolve = JS_ResolveStub;
|
jsb_spine_SkeletonAnimation_class->resolve = JS_ResolveStub;
|
||||||
jsb_spine_SkeletonAnimation_class->convert = JS_ConvertStub;
|
jsb_spine_SkeletonAnimation_class->convert = JS_ConvertStub;
|
||||||
jsb_spine_SkeletonAnimation_class->finalize = js_spine_SkeletonAnimation_finalize;
|
jsb_spine_SkeletonAnimation_class->finalize = jsb_ref_finalize;
|
||||||
jsb_spine_SkeletonAnimation_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
jsb_spine_SkeletonAnimation_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);
|
||||||
|
|
||||||
static JSPropertySpec properties[] = {
|
static JSPropertySpec properties[] = {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -76,6 +76,10 @@
|
||||||
|
|
||||||
#define BYTE_CODE_FILE_EXT ".jsc"
|
#define BYTE_CODE_FILE_EXT ".jsc"
|
||||||
|
|
||||||
|
// EXPERIMENTAL: Enable this in order to get rid of retain/release
|
||||||
|
// when using the Garbage Collector
|
||||||
|
#define CC_ENABLE_GC_FOR_NATIVE_OBJECTS 0
|
||||||
|
|
||||||
using namespace cocos2d;
|
using namespace cocos2d;
|
||||||
|
|
||||||
static std::string inData;
|
static std::string inData;
|
||||||
|
@ -208,15 +212,6 @@ static std::string getMouseFuncName(EventMouse::MouseEventType eventType)
|
||||||
return funcName;
|
return funcName;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rootObject(JSContext *cx, JS::Heap<JSObject*> *obj) {
|
|
||||||
AddNamedObjectRoot(cx, obj, "unnamed");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void unRootObject(JSContext *cx, JS::Heap<JSObject*> *obj) {
|
|
||||||
RemoveObjectRoot(cx, obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeJSObject(JSContext* cx, void* nativeObj)
|
void removeJSObject(JSContext* cx, void* nativeObj)
|
||||||
{
|
{
|
||||||
js_proxy_t* nproxy;
|
js_proxy_t* nproxy;
|
||||||
|
@ -1592,6 +1587,36 @@ bool ScriptingCore::isObjectValid(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptingCore::rootObject(Ref* ref)
|
||||||
|
{
|
||||||
|
// js_proxy_t* nproxy;
|
||||||
|
// js_proxy_t* jsproxy;
|
||||||
|
// void *ptr = (void*)ref;
|
||||||
|
// nproxy = jsb_get_native_proxy(ptr);
|
||||||
|
// if (nproxy) {
|
||||||
|
// JSContext *cx = getGlobalContext();
|
||||||
|
// jsproxy = jsb_get_js_proxy(nproxy->obj);
|
||||||
|
// AddObjectRoot(cx, &jsproxy->obj);
|
||||||
|
//
|
||||||
|
// CCLOG("Rooting %p - %p: %s", ref, &jsproxy->obj, typeid(*ref).name());
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScriptingCore::unrootObject(Ref* ref)
|
||||||
|
{
|
||||||
|
// js_proxy_t* nproxy;
|
||||||
|
// js_proxy_t* jsproxy;
|
||||||
|
// void *ptr = (void*)ref;
|
||||||
|
// nproxy = jsb_get_native_proxy(ptr);
|
||||||
|
// if (nproxy) {
|
||||||
|
// JSContext *cx = getGlobalContext();
|
||||||
|
// jsproxy = jsb_get_js_proxy(nproxy->obj);
|
||||||
|
// RemoveObjectRoot(cx, &jsproxy->obj);
|
||||||
|
//
|
||||||
|
// CCLOG("Unrooting %p - %p: %s", ref, &jsproxy->obj, typeid(*ref).name());
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Debug
|
#pragma mark - Debug
|
||||||
|
|
||||||
void SimpleRunLoop::update(float dt)
|
void SimpleRunLoop::update(float dt)
|
||||||
|
@ -1960,4 +1985,67 @@ void jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy)
|
||||||
JS_REMOVE_PROXY(nativeProxy, jsProxy);
|
JS_REMOVE_PROXY(nativeProxy, jsProxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Ref functions
|
||||||
|
//
|
||||||
|
JSObject* jsb_ref_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug)
|
||||||
|
{
|
||||||
|
// JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET
|
||||||
|
JS::RootedObject proto(cx, typeClass->proto.ref());
|
||||||
|
JS::RootedObject parent(cx, typeClass->parentProto.ref());
|
||||||
|
JS::RootedObject js_obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
|
||||||
|
js_proxy_t* newproxy = jsb_new_proxy(ref, js_obj);
|
||||||
|
jsb_ref_init(cx, &newproxy->obj, ref, debug);
|
||||||
|
return js_obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
void jsb_ref_init(JSContext* cx, JS::Heap<JSObject*> *obj, Ref* ref, const char* debug)
|
||||||
|
{
|
||||||
|
// CCLOG("jsb_ref_init: JSObject address = %p. %s", obj->get(), debug);
|
||||||
|
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
|
||||||
|
(void)cx;
|
||||||
|
(void)obj;
|
||||||
|
ref->_scriptOwned = true;
|
||||||
|
#else
|
||||||
|
ref->autorelease();
|
||||||
|
JS::AddNamedObjectRoot(cx, obj, debug);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void jsb_ref_finalize(JSFreeOp* fop, JSObject* obj)
|
||||||
|
{
|
||||||
|
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
|
||||||
|
js_proxy_t* nproxy;
|
||||||
|
js_proxy_t* jsproxy;
|
||||||
|
jsproxy = jsb_get_js_proxy(obj);
|
||||||
|
if (jsproxy)
|
||||||
|
{
|
||||||
|
auto ref = static_cast<cocos2d::Ref*>(jsproxy->ptr);
|
||||||
|
nproxy = jsb_get_native_proxy(jsproxy->ptr);
|
||||||
|
|
||||||
|
if (ref)
|
||||||
|
{
|
||||||
|
CCLOG("jsb_ref_finalize: JSObject address = %p (%s)", obj, typeid(*ref).name());
|
||||||
|
|
||||||
|
jsb_remove_proxy(nproxy, jsproxy);
|
||||||
|
ref->release();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
jsb_remove_proxy(nullptr, jsproxy);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
// CCLOG("jsb_ref_finalize: JSObject address = %p", obj);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void jsb_ref_rebind(JSContext* cx, JS::HandleObject jsobj, js_proxy_t *js2native_proxy, cocos2d::Ref* oldRef, cocos2d::Ref* newRef, const char* debug)
|
||||||
|
{
|
||||||
|
#if not CC_ENABLE_GC_FOR_NATIVE_OBJECTS
|
||||||
|
JS::RemoveObjectRoot(cx, &js2native_proxy->obj);
|
||||||
|
#endif
|
||||||
|
jsb_remove_proxy(jsb_get_native_proxy(oldRef), js2native_proxy);
|
||||||
|
|
||||||
|
// Rebind js obj with new action
|
||||||
|
js_proxy_t* newProxy = jsb_new_proxy(newRef, jsobj);
|
||||||
|
jsb_ref_init(cx, &newProxy->obj, newRef, debug);
|
||||||
|
}
|
||||||
|
|
|
@ -478,7 +478,21 @@ public:
|
||||||
* @return @~english The global object
|
* @return @~english The global object
|
||||||
*/
|
*/
|
||||||
bool isFunctionOverridedInJS(JS::HandleObject obj, const std::string& name, JSNative native);
|
bool isFunctionOverridedInJS(JS::HandleObject obj, const std::string& name, JSNative native);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roots the associated JSObj.
|
||||||
|
* The GC won't collected rooted objects. This function is only called
|
||||||
|
* when compiled with CC_ENABLE_GC_FOR_NATIVE_OBJECTS=1
|
||||||
|
*/
|
||||||
|
virtual void rootObject(cocos2d::Ref* ref) override;
|
||||||
|
/**
|
||||||
|
* Unroots the associated JSObj.
|
||||||
|
* The GC will collect this object the next time the GC
|
||||||
|
* is called.
|
||||||
|
* This function is only called when compiled with CC_ENABLE_GC_FOR_NATIVE_OBJECTS=1
|
||||||
|
*/
|
||||||
|
virtual void unrootObject(cocos2d::Ref* ref) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void string_report(JS::HandleValue val);
|
void string_report(JS::HandleValue val);
|
||||||
void initRegister();
|
void initRegister();
|
||||||
|
@ -538,6 +552,27 @@ js_proxy_t* jsb_get_native_proxy(void* nativeObj);
|
||||||
js_proxy_t* jsb_get_js_proxy(JS::HandleObject jsObj);
|
js_proxy_t* jsb_get_js_proxy(JS::HandleObject jsObj);
|
||||||
void jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy);
|
void jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic initialization function for subclasses of Ref
|
||||||
|
*/
|
||||||
|
void jsb_ref_init(JSContext* cx, JS::Heap<JSObject*> *obj, cocos2d::Ref* ref, const char* debug);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic finalize used by objects that are subclass of Ref
|
||||||
|
*/
|
||||||
|
void jsb_ref_finalize(JSFreeOp* fop, JSObject* obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Disassociates oldRef from jsobj, and associates a new Ref.
|
||||||
|
Useful for the EaseActions and others
|
||||||
|
*/
|
||||||
|
void jsb_ref_rebind(JSContext* cx, JS::HandleObject jsobj, js_proxy_t *js2native_proxy, cocos2d::Ref* oldRef, cocos2d::Ref* newRef, const char* debug);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates a new JSObject of a certain type (typeClass) and creates a proxy associated with and the Ref
|
||||||
|
*/
|
||||||
|
JSObject* jsb_ref_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug);
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
jsval getJSObject(JSContext* cx, T* nativeObj)
|
jsval getJSObject(JSContext* cx, T* nativeObj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2465,13 +2465,9 @@ bool js_cocos2dx_ActionInterval_repeat(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
JS_ReportError(cx, "js_cocos2dx_ActionInterval_repeat : Repeat times must be greater than 0");
|
JS_ReportError(cx, "js_cocos2dx_ActionInterval_repeat : Repeat times must be greater than 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Repeat* action = cocos2d::Repeat::create(cobj, timesInt);
|
cocos2d::Repeat* action = new (std::nothrow) cocos2d::Repeat;
|
||||||
// Unbind current proxy binding
|
action->initWithAction(cobj, timesInt);
|
||||||
JS::RemoveObjectRoot(cx, &proxy->obj);
|
jsb_ref_rebind(cx, obj, proxy, cobj, action, "cocos2d::Repeat");
|
||||||
jsb_remove_proxy(jsb_get_native_proxy(cobj), proxy);
|
|
||||||
// Rebind js obj with new action
|
|
||||||
js_proxy_t* newProxy = jsb_new_proxy(action, obj);
|
|
||||||
JS::AddNamedObjectRoot(cx, &newProxy->obj, "cocos2d::Repeat");
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
args.rval().set(OBJECT_TO_JSVAL(obj));
|
||||||
return true;
|
return true;
|
||||||
|
@ -2484,21 +2480,17 @@ bool js_cocos2dx_ActionInterval_repeat(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
bool js_cocos2dx_ActionInterval_repeatForever(JSContext *cx, uint32_t argc, jsval *vp)
|
bool js_cocos2dx_ActionInterval_repeatForever(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject jsobj(cx, args.thisv().toObjectOrNull());
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
js_proxy_t *proxy = jsb_get_js_proxy(jsobj);
|
||||||
cocos2d::ActionInterval* cobj = (cocos2d::ActionInterval *)(proxy ? proxy->ptr : NULL);
|
cocos2d::ActionInterval* cobj = (cocos2d::ActionInterval *)(proxy ? proxy->ptr : NULL);
|
||||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ActionInterval_repeatForever : Invalid Native Object");
|
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ActionInterval_repeatForever : Invalid Native Object");
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
cocos2d::RepeatForever* action = cocos2d::RepeatForever::create(cobj);
|
cocos2d::RepeatForever* action = new (std::nothrow) cocos2d::RepeatForever;
|
||||||
// Unbind current proxy binding
|
action->initWithAction(cobj);
|
||||||
JS::RemoveObjectRoot(cx, &proxy->obj);
|
|
||||||
jsb_remove_proxy(jsb_get_native_proxy(cobj), proxy);
|
|
||||||
// Rebind js obj with new action
|
|
||||||
js_proxy_t* newProxy = jsb_new_proxy(action, obj);
|
|
||||||
JS::AddNamedObjectRoot(cx, &newProxy->obj, "cocos2d::RepeatForever");
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
jsb_ref_rebind(cx, jsobj, proxy, cobj, action, "cocos2d::RepeatForever");
|
||||||
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2525,13 +2517,9 @@ bool js_cocos2dx_ActionInterval_speed(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Speed* action = cocos2d::Speed::create(cobj, speed);
|
cocos2d::Speed* action = new (std::nothrow) cocos2d::Speed;
|
||||||
// Unbind current proxy binding
|
action->initWithAction(cobj, speed);
|
||||||
JS::RemoveObjectRoot(cx, &proxy->obj);
|
jsb_ref_rebind(cx, obj, proxy, cobj, action, "cocos2d::Speed");
|
||||||
jsb_remove_proxy(jsb_get_native_proxy(cobj), proxy);
|
|
||||||
// Rebind js obj with new action
|
|
||||||
js_proxy_t* newProxy = jsb_new_proxy(action, obj);
|
|
||||||
JS::AddNamedObjectRoot(cx, &newProxy->obj, "cocos2d::Speed");
|
|
||||||
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
args.rval().set(OBJECT_TO_JSVAL(obj));
|
||||||
return true;
|
return true;
|
||||||
|
@ -2582,12 +2570,12 @@ enum ACTION_TAG {
|
||||||
bool js_cocos2dx_ActionInterval_easing(JSContext *cx, uint32_t argc, jsval *vp)
|
bool js_cocos2dx_ActionInterval_easing(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
{
|
{
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
|
JS::RootedObject jsobj(cx, args.thisv().toObjectOrNull());
|
||||||
js_proxy_t *proxy = jsb_get_js_proxy(obj);
|
js_proxy_t *proxy = jsb_get_js_proxy(jsobj);
|
||||||
cocos2d::ActionInterval* cobj = (cocos2d::ActionInterval *)(proxy ? proxy->ptr : NULL);
|
cocos2d::ActionInterval* oldAction = (cocos2d::ActionInterval *)(proxy ? proxy->ptr : NULL);
|
||||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ActionInterval_easing : Invalid Native Object");
|
JSB_PRECONDITION2 (oldAction, cx, false, "js_cocos2dx_ActionInterval_easing : Invalid Native Object");
|
||||||
|
|
||||||
cocos2d::ActionInterval* currentAction = cobj;
|
cocos2d::ActionInterval* newAction = nullptr;
|
||||||
JS::RootedObject tmp(cx);
|
JS::RootedObject tmp(cx);
|
||||||
JS::RootedValue jsTag(cx);
|
JS::RootedValue jsTag(cx);
|
||||||
JS::RootedValue jsParam(cx);
|
JS::RootedValue jsParam(cx);
|
||||||
|
@ -2596,103 +2584,221 @@ bool js_cocos2dx_ActionInterval_easing(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
|
|
||||||
for (int i = 0; i < argc; i++)
|
for (int i = 0; i < argc; i++)
|
||||||
{
|
{
|
||||||
// jsval vpi = argv[i];
|
// jsval vpi = argv[i];
|
||||||
JS::RootedValue vpi(cx, args.get(i));
|
JS::RootedValue vpi(cx, args.get(i));
|
||||||
bool ok = vpi.isObject() &&
|
bool ok = vpi.isObject() &&
|
||||||
JS_ValueToObject(cx, vpi, &tmp) &&
|
JS_ValueToObject(cx, vpi, &tmp) &&
|
||||||
JS_GetProperty(cx, tmp, "tag", &jsTag) &&
|
JS_GetProperty(cx, tmp, "tag", &jsTag) &&
|
||||||
JS::ToNumber(cx, jsTag, &tag);
|
JS::ToNumber(cx, jsTag, &tag);
|
||||||
JS_GetProperty(cx, tmp, "param", &jsParam) && JS::ToNumber(cx, jsParam, ¶meter);
|
JS_GetProperty(cx, tmp, "param", &jsParam) && JS::ToNumber(cx, jsParam, ¶meter);
|
||||||
bool hasParam = (parameter == parameter);
|
bool hasParam = (parameter == parameter);
|
||||||
if (!ok) continue;
|
if (!ok) continue;
|
||||||
|
|
||||||
cocos2d::ActionEase* action;
|
|
||||||
ok = true;
|
ok = true;
|
||||||
if (tag == EASE_IN)
|
if (tag == EASE_IN)
|
||||||
{
|
{
|
||||||
if (!hasParam) ok = false;
|
if (!hasParam) ok = false;
|
||||||
action = cocos2d::EaseIn::create(currentAction, parameter);
|
auto tmpaction = new (std::nothrow) cocos2d::EaseIn;
|
||||||
|
tmpaction->initWithAction(oldAction, parameter);
|
||||||
|
newAction = tmpaction;
|
||||||
}
|
}
|
||||||
else if (tag == EASE_OUT)
|
else if (tag == EASE_OUT)
|
||||||
{
|
{
|
||||||
if (!hasParam) ok = false;
|
if (!hasParam) ok = false;
|
||||||
action = cocos2d::EaseOut::create(currentAction, parameter);
|
auto tmpaction = new (std::nothrow) cocos2d::EaseOut;
|
||||||
|
tmpaction->initWithAction(oldAction, parameter);
|
||||||
|
newAction = tmpaction;
|
||||||
}
|
}
|
||||||
else if (tag == EASE_INOUT)
|
else if (tag == EASE_INOUT)
|
||||||
{
|
{
|
||||||
if (!hasParam) ok = false;
|
if (!hasParam) ok = false;
|
||||||
action = cocos2d::EaseInOut::create(currentAction, parameter);
|
auto tmpaction = new (std::nothrow) cocos2d::EaseInOut;
|
||||||
|
tmpaction->initWithAction(oldAction, parameter);
|
||||||
|
newAction = tmpaction;
|
||||||
}
|
}
|
||||||
else if (tag == EASE_EXPONENTIAL_IN)
|
else if (tag == EASE_EXPONENTIAL_IN)
|
||||||
action = cocos2d::EaseExponentialIn::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseExponentialIn;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_EXPONENTIAL_OUT)
|
else if (tag == EASE_EXPONENTIAL_OUT)
|
||||||
action = cocos2d::EaseExponentialOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseExponentialOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_EXPONENTIAL_INOUT)
|
else if (tag == EASE_EXPONENTIAL_INOUT)
|
||||||
action = cocos2d::EaseExponentialInOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow)cocos2d::EaseExponentialInOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_SINE_IN)
|
else if (tag == EASE_SINE_IN)
|
||||||
action = cocos2d::EaseSineIn::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow)cocos2d::EaseSineIn;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_SINE_OUT)
|
else if (tag == EASE_SINE_OUT)
|
||||||
action = cocos2d::EaseSineOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow)cocos2d::EaseSineOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_SINE_INOUT)
|
else if (tag == EASE_SINE_INOUT)
|
||||||
action = cocos2d::EaseSineInOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow)cocos2d::EaseSineInOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_ELASTIC_IN)
|
else if (tag == EASE_ELASTIC_IN)
|
||||||
{
|
{
|
||||||
if (!hasParam) parameter = 0.3;
|
if (!hasParam) parameter = 0.3;
|
||||||
action = cocos2d::EaseElasticIn::create(currentAction, parameter);
|
auto tmpaction = new (std::nothrow)cocos2d::EaseElasticIn;
|
||||||
|
tmpaction->initWithAction(oldAction, parameter);
|
||||||
|
newAction = tmpaction;
|
||||||
}
|
}
|
||||||
else if (tag == EASE_ELASTIC_OUT)
|
else if (tag == EASE_ELASTIC_OUT)
|
||||||
{
|
{
|
||||||
if (!hasParam) parameter = 0.3;
|
if (!hasParam) parameter = 0.3;
|
||||||
action = cocos2d::EaseElasticOut::create(currentAction, parameter);
|
auto tmpaction = new (std::nothrow)cocos2d::EaseElasticOut;
|
||||||
|
tmpaction->initWithAction(oldAction, parameter);
|
||||||
|
newAction = tmpaction;
|
||||||
}
|
}
|
||||||
else if (tag == EASE_ELASTIC_INOUT)
|
else if (tag == EASE_ELASTIC_INOUT)
|
||||||
{
|
{
|
||||||
if (!hasParam) parameter = 0.3;
|
if (!hasParam) parameter = 0.3;
|
||||||
action = cocos2d::EaseElasticInOut::create(currentAction, parameter);
|
auto tmpaction = new (std::nothrow)cocos2d::EaseElasticInOut;
|
||||||
|
tmpaction->initWithAction(oldAction, parameter);
|
||||||
|
newAction = tmpaction;
|
||||||
}
|
}
|
||||||
else if (tag == EASE_BOUNCE_IN)
|
else if (tag == EASE_BOUNCE_IN)
|
||||||
action = cocos2d::EaseBounceIn::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow)cocos2d::EaseBounceIn;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_BOUNCE_OUT)
|
else if (tag == EASE_BOUNCE_OUT)
|
||||||
action = cocos2d::EaseBounceOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseBounceOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_BOUNCE_INOUT)
|
else if (tag == EASE_BOUNCE_INOUT)
|
||||||
action = cocos2d::EaseBounceInOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseBounceInOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_BACK_IN)
|
else if (tag == EASE_BACK_IN)
|
||||||
action = cocos2d::EaseBackIn::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseBackIn;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_BACK_OUT)
|
else if (tag == EASE_BACK_OUT)
|
||||||
action = cocos2d::EaseBackOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseBackOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_BACK_INOUT)
|
else if (tag == EASE_BACK_INOUT)
|
||||||
action = cocos2d::EaseBackInOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseBackInOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_QUADRATIC_IN)
|
else if (tag == EASE_QUADRATIC_IN)
|
||||||
action = cocos2d::EaseQuadraticActionIn::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseQuadraticActionIn;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_QUADRATIC_OUT)
|
else if (tag == EASE_QUADRATIC_OUT)
|
||||||
action = cocos2d::EaseQuadraticActionOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseQuadraticActionOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_QUADRATIC_INOUT)
|
else if (tag == EASE_QUADRATIC_INOUT)
|
||||||
action = cocos2d::EaseQuadraticActionInOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseQuadraticActionInOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_QUARTIC_IN)
|
else if (tag == EASE_QUARTIC_IN)
|
||||||
action = cocos2d::EaseQuarticActionIn::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseQuarticActionIn;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_QUARTIC_OUT)
|
else if (tag == EASE_QUARTIC_OUT)
|
||||||
action = cocos2d::EaseQuarticActionOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseQuarticActionOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_QUARTIC_INOUT)
|
else if (tag == EASE_QUARTIC_INOUT)
|
||||||
action = cocos2d::EaseQuarticActionInOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseQuarticActionInOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_QUINTIC_IN)
|
else if (tag == EASE_QUINTIC_IN)
|
||||||
action = cocos2d::EaseQuinticActionIn::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseQuinticActionIn;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_QUINTIC_OUT)
|
else if (tag == EASE_QUINTIC_OUT)
|
||||||
action = cocos2d::EaseQuinticActionOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseQuinticActionOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_QUINTIC_INOUT)
|
else if (tag == EASE_QUINTIC_INOUT)
|
||||||
action = cocos2d::EaseQuinticActionInOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseQuinticActionInOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_CIRCLE_IN)
|
else if (tag == EASE_CIRCLE_IN)
|
||||||
action = cocos2d::EaseCircleActionIn::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseCircleActionIn;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_CIRCLE_OUT)
|
else if (tag == EASE_CIRCLE_OUT)
|
||||||
action = cocos2d::EaseCircleActionOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseCircleActionOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_CIRCLE_INOUT)
|
else if (tag == EASE_CIRCLE_INOUT)
|
||||||
action = cocos2d::EaseCircleActionInOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseCircleActionInOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_CUBIC_IN)
|
else if (tag == EASE_CUBIC_IN)
|
||||||
action = cocos2d::EaseCubicActionIn::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseCubicActionIn;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_CUBIC_OUT)
|
else if (tag == EASE_CUBIC_OUT)
|
||||||
action = cocos2d::EaseCubicActionOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseCubicActionOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_CUBIC_INOUT)
|
else if (tag == EASE_CUBIC_INOUT)
|
||||||
action = cocos2d::EaseCubicActionInOut::create(currentAction);
|
{
|
||||||
|
auto tmpaction = new (std::nothrow) cocos2d::EaseCubicActionInOut;
|
||||||
|
tmpaction->initWithAction(oldAction);
|
||||||
|
newAction = tmpaction;
|
||||||
|
}
|
||||||
else if (tag == EASE_BEZIER_ACTION)
|
else if (tag == EASE_BEZIER_ACTION)
|
||||||
{
|
{
|
||||||
JS::RootedValue jsParam2(cx);
|
JS::RootedValue jsParam2(cx);
|
||||||
|
@ -2706,28 +2812,25 @@ bool js_cocos2dx_ActionInterval_easing(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
ok &= JS_GetProperty(cx, tmp, "param4", &jsParam4);
|
ok &= JS_GetProperty(cx, tmp, "param4", &jsParam4);
|
||||||
ok &= JS::ToNumber(cx, jsParam4, ¶meter4);
|
ok &= JS::ToNumber(cx, jsParam4, ¶meter4);
|
||||||
if (!ok) continue;
|
if (!ok) continue;
|
||||||
|
|
||||||
action = cocos2d::EaseBezierAction::create(currentAction);
|
auto tmpaction = new (std::nothrow) cocos2d::EaseBezierAction;
|
||||||
((EaseBezierAction *)action)->setBezierParamer(parameter, parameter2, parameter3, parameter4);
|
tmpaction->initWithAction(oldAction);
|
||||||
|
tmpaction->setBezierParamer(parameter, parameter2, parameter3, parameter4);
|
||||||
|
newAction = tmpaction;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!ok || !action) {
|
if (!ok || !newAction) {
|
||||||
JS_ReportError(cx, "js_cocos2dx_ActionInterval_easing : Invalid action: At least one action was expecting parameter");
|
JS_ReportError(cx, "js_cocos2dx_ActionInterval_easing : Invalid action: At least one action was expecting parameter");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentAction = action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unbind current proxy binding
|
// Unbind existing proxy binding with cobj, and rebind with the new action
|
||||||
JS::RemoveObjectRoot(cx, &proxy->obj);
|
jsb_ref_rebind(cx, jsobj, proxy, oldAction, newAction, "cocos2d::EaseAction");
|
||||||
jsb_remove_proxy(jsb_get_native_proxy(cobj), proxy);
|
|
||||||
// Rebind js obj with new action
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
js_proxy_t* newProxy = jsb_new_proxy(currentAction, obj);
|
|
||||||
JS::AddNamedObjectRoot(cx, &newProxy->obj, "cocos2d::EaseAction");
|
|
||||||
args.rval().set(OBJECT_TO_JSVAL(obj));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2741,38 +2844,26 @@ bool js_BezierActions_create(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||||
if( ! JS::ToNumber(cx, args.get(0), &t) ) {
|
if( ! JS::ToNumber(cx, args.get(0), &t) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int num;
|
int num;
|
||||||
Point *arr;
|
Point *arr;
|
||||||
jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
||||||
|
|
||||||
ccBezierConfig config;
|
ccBezierConfig config;
|
||||||
config.controlPoint_1 = arr[0];
|
config.controlPoint_1 = arr[0];
|
||||||
config.controlPoint_2 = arr[1];
|
config.controlPoint_2 = arr[1];
|
||||||
config.endPosition = arr[2];
|
config.endPosition = arr[2];
|
||||||
|
|
||||||
T* ret = T::create(t, config);
|
T* ret = new (std::nothrow) T;
|
||||||
|
ret->initWithDuration(t, config);
|
||||||
|
|
||||||
delete [] arr;
|
delete [] arr;
|
||||||
|
|
||||||
jsval jsret;
|
JSObject* jsobj;
|
||||||
do {
|
js_type_class_t *typeProxy = js_get_type_from_native<T>(ret);
|
||||||
if (ret) {
|
jsobj = jsb_ref_create_jsobject(cx, ret, typeProxy, typeid(*ret).name());
|
||||||
js_proxy_t *p = jsb_get_native_proxy(ret);
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (p) {
|
|
||||||
jsret = OBJECT_TO_JSVAL(p->obj);
|
|
||||||
} else {
|
|
||||||
// create a new js obj of that class
|
|
||||||
js_proxy_t *proxy = js_get_or_create_proxy<T>(cx, ret);
|
|
||||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
jsret = JSVAL_NULL;
|
|
||||||
}
|
|
||||||
} while (0);
|
|
||||||
args.rval().set(jsret);
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1);
|
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||||
return false;
|
return false;
|
||||||
|
@ -2790,8 +2881,7 @@ bool js_BezierActions_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
double arg0;
|
double arg0;
|
||||||
cocos2d::_ccBezierConfig arg1;
|
cocos2d::_ccBezierConfig arg1;
|
||||||
JS::RootedValue jsarg0(cx, args.get(0));
|
ok &= JS::ToNumber( cx, JS::RootedValue(cx, args.get(0)), &arg0);
|
||||||
ok &= JS::ToNumber( cx, jsarg0, &arg0);
|
|
||||||
|
|
||||||
int num;
|
int num;
|
||||||
cocos2d::Vec2 *arr;
|
cocos2d::Vec2 *arr;
|
||||||
|
@ -2818,48 +2908,36 @@ template<class T>
|
||||||
bool js_CardinalSplineActions_create(JSContext *cx, uint32_t argc, jsval *vp) {
|
bool js_CardinalSplineActions_create(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
if (argc == 3) {
|
if (argc == 3) {
|
||||||
double dur;
|
double dur;
|
||||||
ok &= JS::ToNumber(cx, args.get(0), &dur);
|
ok &= JS::ToNumber(cx, args.get(0), &dur);
|
||||||
|
|
||||||
int num;
|
int num;
|
||||||
Point *arr;
|
Point *arr;
|
||||||
ok &= jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
ok &= jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
||||||
|
|
||||||
double ten;
|
double ten;
|
||||||
ok &= JS::ToNumber(cx, args.get(2), &ten);
|
ok &= JS::ToNumber(cx, args.get(2), &ten);
|
||||||
|
|
||||||
JSB_PRECONDITION2(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION2(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
PointArray *points = PointArray::create(num);
|
PointArray *points = PointArray::create(num);
|
||||||
|
|
||||||
for( int i=0; i < num;i++) {
|
for( int i=0; i < num;i++) {
|
||||||
points->addControlPoint(arr[i]);
|
points->addControlPoint(arr[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
T *ret = T::create(dur, points, ten);
|
T *ret = new (std::nothrow) T;
|
||||||
|
ret->initWithDuration(dur, points, ten);
|
||||||
|
|
||||||
delete [] arr;
|
delete [] arr;
|
||||||
|
|
||||||
jsval jsret;
|
JSObject* jsobj;
|
||||||
do {
|
js_type_class_t *typeProxy = js_get_type_from_native<T>(ret);
|
||||||
if (ret) {
|
jsobj = jsb_ref_create_jsobject(cx, ret, typeProxy, typeid(*ret).name());
|
||||||
js_proxy_t *p = jsb_get_native_proxy(ret);
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (p) {
|
|
||||||
jsret = OBJECT_TO_JSVAL(p->obj);
|
|
||||||
} else {
|
|
||||||
// create a new js obj of that class
|
|
||||||
js_proxy_t *proxy = js_get_or_create_proxy<T>(cx, ret);
|
|
||||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
jsret = JSVAL_NULL;
|
|
||||||
}
|
|
||||||
} while (0);
|
|
||||||
args.rval().set(jsret);
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1);
|
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||||
return false;
|
return false;
|
||||||
|
@ -2869,45 +2947,33 @@ template<class T>
|
||||||
bool js_CatmullRomActions_create(JSContext *cx, uint32_t argc, jsval *vp) {
|
bool js_CatmullRomActions_create(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
double dur;
|
double dur;
|
||||||
ok &= JS::ToNumber(cx, args.get(0), &dur);
|
ok &= JS::ToNumber(cx, args.get(0), &dur);
|
||||||
|
|
||||||
int num;
|
int num;
|
||||||
Point *arr;
|
Point *arr;
|
||||||
ok &= jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
ok &= jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
||||||
|
|
||||||
JSB_PRECONDITION2(ok, cx, false, "Error processing arguments");
|
JSB_PRECONDITION2(ok, cx, false, "Error processing arguments");
|
||||||
|
|
||||||
PointArray *points = PointArray::create(num);
|
PointArray *points = PointArray::create(num);
|
||||||
|
|
||||||
for( int i=0; i < num;i++) {
|
for( int i=0; i < num;i++) {
|
||||||
points->addControlPoint(arr[i]);
|
points->addControlPoint(arr[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
T *ret = T::create(dur, points);
|
T *ret = new (std::nothrow) T;
|
||||||
|
ret->initWithDuration(dur, points);
|
||||||
|
|
||||||
delete [] arr;
|
delete [] arr;
|
||||||
|
|
||||||
jsval jsret;
|
JSObject* jsobj;
|
||||||
do {
|
js_type_class_t *typeProxy = js_get_type_from_native<T>(ret);
|
||||||
if (ret) {
|
jsobj = jsb_ref_create_jsobject(cx, ret, typeProxy, typeid(*ret).name());
|
||||||
js_proxy_t *p = jsb_get_native_proxy(ret);
|
args.rval().set(OBJECT_TO_JSVAL(jsobj));
|
||||||
if (p) {
|
|
||||||
jsret = OBJECT_TO_JSVAL(p->obj);
|
|
||||||
} else {
|
|
||||||
// create a new js obj of that class
|
|
||||||
js_proxy_t *proxy = js_get_or_create_proxy<T>(cx, ret);
|
|
||||||
jsret = OBJECT_TO_JSVAL(proxy->obj);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
jsret = JSVAL_NULL;
|
|
||||||
}
|
|
||||||
} while (0);
|
|
||||||
args.rval().set(jsret);
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1);
|
JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1);
|
||||||
return false;
|
return false;
|
||||||
|
@ -2923,18 +2989,17 @@ bool js_CatmullRomActions_initWithDuration(JSContext *cx, uint32_t argc, jsval *
|
||||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_CatmullRom_initWithDuration : Invalid Native Object");
|
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_CatmullRom_initWithDuration : Invalid Native Object");
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
double arg0;
|
double arg0;
|
||||||
JS::RootedValue jsarg0(cx, args.get(0));
|
ok &= JS::ToNumber( cx, JS::RootedValue(cx, args.get(0)), &arg0);
|
||||||
ok &= JS::ToNumber(cx, jsarg0, &arg0);
|
|
||||||
|
|
||||||
int num;
|
int num;
|
||||||
Point *arr;
|
Point *arr;
|
||||||
ok &= jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
ok &= jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
||||||
|
|
||||||
cocos2d::PointArray* arg1 = cocos2d::PointArray::create(num);
|
cocos2d::PointArray* arg1 = cocos2d::PointArray::create(num);
|
||||||
for( int i=0; i < num;i++) {
|
for( int i=0; i < num;i++) {
|
||||||
arg1->addControlPoint(arr[i]);
|
arg1->addControlPoint(arr[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CatmullRom_initWithDuration : Error processing arguments");
|
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CatmullRom_initWithDuration : Error processing arguments");
|
||||||
bool ret = cobj->initWithDuration(arg0, arg1);
|
bool ret = cobj->initWithDuration(arg0, arg1);
|
||||||
delete [] arr;
|
delete [] arr;
|
||||||
|
@ -2948,7 +3013,6 @@ bool js_CatmullRomActions_initWithDuration(JSContext *cx, uint32_t argc, jsval *
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool JSB_CCBezierBy_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {
|
bool JSB_CCBezierBy_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||||
return js_BezierActions_create<cocos2d::BezierBy>(cx, argc, vp);
|
return js_BezierActions_create<cocos2d::BezierBy>(cx, argc, vp);
|
||||||
}
|
}
|
||||||
|
@ -2967,6 +3031,7 @@ bool JSB_CCBezierTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
return js_BezierActions_initWithDuration<cocos2d::BezierTo>(cx, argc, vp);
|
return js_BezierActions_initWithDuration<cocos2d::BezierTo>(cx, argc, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool JSB_CCCardinalSplineBy_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {
|
bool JSB_CCCardinalSplineBy_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||||
return js_CardinalSplineActions_create<cocos2d::CardinalSplineBy>(cx, argc, vp);
|
return js_CardinalSplineActions_create<cocos2d::CardinalSplineBy>(cx, argc, vp);
|
||||||
}
|
}
|
||||||
|
@ -2985,10 +3050,10 @@ bool js_cocos2dx_CardinalSplineTo_initWithDuration(JSContext *cx, uint32_t argc,
|
||||||
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_CardinalSplineTo_initWithDuration : Invalid Native Object");
|
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_CardinalSplineTo_initWithDuration : Invalid Native Object");
|
||||||
if (argc == 3) {
|
if (argc == 3) {
|
||||||
double arg0;
|
double arg0;
|
||||||
|
|
||||||
double arg2;
|
double arg2;
|
||||||
JS::RootedValue jsarg0(cx, args.get(0));
|
ok &= JS::ToNumber( cx, JS::RootedValue(cx, args.get(0)), &arg0);
|
||||||
ok &= JS::ToNumber(cx, jsarg0, &arg0);
|
|
||||||
|
|
||||||
int num;
|
int num;
|
||||||
Point *arr;
|
Point *arr;
|
||||||
ok &= jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
ok &= jsval_to_ccarray_of_CCPoint(cx, args.get(1), &arr, &num);
|
||||||
|
@ -2996,12 +3061,11 @@ bool js_cocos2dx_CardinalSplineTo_initWithDuration(JSContext *cx, uint32_t argc,
|
||||||
for( int i=0; i < num;i++) {
|
for( int i=0; i < num;i++) {
|
||||||
arg1->addControlPoint(arr[i]);
|
arg1->addControlPoint(arr[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
JS::RootedValue jsarg2(cx, args.get(2));
|
ok &= JS::ToNumber( cx, JS::RootedValue(cx, args.get(2)), &arg2);
|
||||||
ok &= JS::ToNumber(cx, jsarg2, &arg2);
|
|
||||||
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CardinalSplineTo_initWithDuration : Error processing arguments");
|
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CardinalSplineTo_initWithDuration : Error processing arguments");
|
||||||
bool ret = cobj->initWithDuration(arg0, arg1, arg2);
|
bool ret = cobj->initWithDuration(arg0, arg1, arg2);
|
||||||
|
|
||||||
delete [] arr;
|
delete [] arr;
|
||||||
jsval jsret = JSVAL_NULL;
|
jsval jsret = JSVAL_NULL;
|
||||||
jsret = BOOLEAN_TO_JSVAL(ret);
|
jsret = BOOLEAN_TO_JSVAL(ret);
|
||||||
|
@ -3013,6 +3077,7 @@ bool js_cocos2dx_CardinalSplineTo_initWithDuration(JSContext *cx, uint32_t argc,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool JSB_CCCatmullRomBy_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {
|
bool JSB_CCCatmullRomBy_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {
|
||||||
return js_CatmullRomActions_create<cocos2d::CatmullRomBy>(cx, argc, vp);
|
return js_CatmullRomActions_create<cocos2d::CatmullRomBy>(cx, argc, vp);
|
||||||
}
|
}
|
||||||
|
@ -3021,11 +3086,13 @@ bool JSB_CCCatmullRomTo_actionWithDuration(JSContext *cx, uint32_t argc, jsval *
|
||||||
return js_CatmullRomActions_create<cocos2d::CatmullRomTo>(cx, argc, vp);
|
return js_CatmullRomActions_create<cocos2d::CatmullRomTo>(cx, argc, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JSB_CatmullRomBy_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {
|
bool JSB_CatmullRomBy_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
|
{
|
||||||
return js_CatmullRomActions_initWithDuration<cocos2d::CatmullRomBy>(cx, argc, vp);
|
return js_CatmullRomActions_initWithDuration<cocos2d::CatmullRomBy>(cx, argc, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JSB_CatmullRomTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {
|
bool JSB_CatmullRomTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)
|
||||||
|
{
|
||||||
return js_CatmullRomActions_initWithDuration<cocos2d::CatmullRomTo>(cx, argc, vp);
|
return js_CatmullRomActions_initWithDuration<cocos2d::CatmullRomTo>(cx, argc, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,20 +4,6 @@
|
||||||
-- @extend Ref
|
-- @extend Ref
|
||||||
-- @parent_module cc
|
-- @parent_module cc
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- @overload self, cc.Texture2D
|
|
||||||
-- @overload self, string
|
|
||||||
-- @function [parent=#Mesh] setTexture
|
|
||||||
-- @param self
|
|
||||||
-- @param #string texPath
|
|
||||||
-- @return Mesh#Mesh self (return value: cc.Mesh)
|
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
--
|
|
||||||
-- @function [parent=#Mesh] getTexture
|
|
||||||
-- @param self
|
|
||||||
-- @return Texture2D#Texture2D ret (return value: cc.Texture2D)
|
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Returns the Material being used by the Mesh
|
-- Returns the Material being used by the Mesh
|
||||||
-- @function [parent=#Mesh] getMaterial
|
-- @function [parent=#Mesh] getMaterial
|
||||||
|
@ -30,6 +16,12 @@
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return int#int ret (return value: int)
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- check texture each frame?
|
||||||
|
-- @function [parent=#Mesh] enableCheckTexture
|
||||||
|
-- @param self
|
||||||
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Sets a new Material to the Mesh
|
-- Sets a new Material to the Mesh
|
||||||
-- @function [parent=#Mesh] setMaterial
|
-- @function [parent=#Mesh] setMaterial
|
||||||
|
@ -84,7 +76,7 @@
|
||||||
-- @return Mesh#Mesh self (return value: cc.Mesh)
|
-- @return Mesh#Mesh self (return value: cc.Mesh)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
-- check texture
|
||||||
-- @function [parent=#Mesh] checkTexture
|
-- @function [parent=#Mesh] checkTexture
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return Mesh#Mesh self (return value: cc.Mesh)
|
-- @return Mesh#Mesh self (return value: cc.Mesh)
|
||||||
|
@ -123,6 +115,13 @@
|
||||||
-- @param #cc.MeshSkin skin
|
-- @param #cc.MeshSkin skin
|
||||||
-- @return Mesh#Mesh self (return value: cc.Mesh)
|
-- @return Mesh#Mesh self (return value: cc.Mesh)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- set enable check texture, check texture each frame if eanble is true. It is false by default
|
||||||
|
-- @function [parent=#Mesh] setEnableCheckTexture
|
||||||
|
-- @param self
|
||||||
|
-- @param #bool enableCheckTexture
|
||||||
|
-- @return Mesh#Mesh self (return value: cc.Mesh)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
--
|
||||||
-- @function [parent=#Mesh] isVisible
|
-- @function [parent=#Mesh] isVisible
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- @module Sprite3DMaterial
|
|
||||||
-- @extend Material
|
|
||||||
-- @parent_module cc
|
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- Get material type<br>
|
|
||||||
-- return Material type
|
|
||||||
-- @function [parent=#Sprite3DMaterial] getMaterialType
|
|
||||||
-- @param self
|
|
||||||
-- @return int#int ret (return value: int)
|
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- Create material with file name, it creates material from cache if it is previously loaded<br>
|
|
||||||
-- param path Path of material file<br>
|
|
||||||
-- return Created material
|
|
||||||
-- @function [parent=#Sprite3DMaterial] createWithFilename
|
|
||||||
-- @param self
|
|
||||||
-- @param #string path
|
|
||||||
-- @return Sprite3DMaterial#Sprite3DMaterial ret (return value: cc.Sprite3DMaterial)
|
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- Release all cached materials
|
|
||||||
-- @function [parent=#Sprite3DMaterial] releaseCachedMaterial
|
|
||||||
-- @param self
|
|
||||||
-- @return Sprite3DMaterial#Sprite3DMaterial self (return value: cc.Sprite3DMaterial)
|
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- @overload self
|
|
||||||
-- @overload self, int, bool
|
|
||||||
-- @function [parent=#Sprite3DMaterial] createBuiltInMaterial
|
|
||||||
-- @param self
|
|
||||||
-- @param #int type
|
|
||||||
-- @param #bool skinned
|
|
||||||
-- @return Sprite3DMaterial#Sprite3DMaterial ret (return value: cc.Sprite3DMaterial)
|
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- Create material with GLProgramState<br>
|
|
||||||
-- param programState GLProgramState instance<br>
|
|
||||||
-- return Created material
|
|
||||||
-- @function [parent=#Sprite3DMaterial] createWithGLStateProgram
|
|
||||||
-- @param self
|
|
||||||
-- @param #cc.GLProgramState programState
|
|
||||||
-- @return Sprite3DMaterial#Sprite3DMaterial ret (return value: cc.Sprite3DMaterial)
|
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- Release all built in materials
|
|
||||||
-- @function [parent=#Sprite3DMaterial] releaseBuiltInMaterial
|
|
||||||
-- @param self
|
|
||||||
-- @return Sprite3DMaterial#Sprite3DMaterial self (return value: cc.Sprite3DMaterial)
|
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
-- Clone material
|
|
||||||
-- @function [parent=#Sprite3DMaterial] clone
|
|
||||||
-- @param self
|
|
||||||
-- @return Material#Material ret (return value: cc.Material)
|
|
||||||
|
|
||||||
return nil
|
|
|
@ -1321,11 +1321,6 @@
|
||||||
-- @field [parent=#cc] MotionStreak3D#MotionStreak3D MotionStreak3D preloaded module
|
-- @field [parent=#cc] MotionStreak3D#MotionStreak3D MotionStreak3D preloaded module
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------
|
|
||||||
-- the cc Sprite3DMaterial
|
|
||||||
-- @field [parent=#cc] Sprite3DMaterial#Sprite3DMaterial Sprite3DMaterial preloaded module
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------
|
--------------------------------------------------------
|
||||||
-- the cc ComponentLua
|
-- the cc ComponentLua
|
||||||
-- @field [parent=#cc] ComponentLua#ComponentLua ComponentLua preloaded module
|
-- @field [parent=#cc] ComponentLua#ComponentLua ComponentLua preloaded module
|
||||||
|
|
|
@ -1749,108 +1749,6 @@ int lua_register_cocos2dx_3d_BillBoard(lua_State* tolua_S)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_cocos2dx_3d_Mesh_setTexture(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
cocos2d::Mesh* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_setTexture'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
do{
|
|
||||||
if (argc == 1) {
|
|
||||||
cocos2d::Texture2D* arg0;
|
|
||||||
ok &= luaval_to_object<cocos2d::Texture2D>(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Mesh:setTexture");
|
|
||||||
|
|
||||||
if (!ok) { break; }
|
|
||||||
cobj->setTexture(arg0);
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}while(0);
|
|
||||||
ok = true;
|
|
||||||
do{
|
|
||||||
if (argc == 1) {
|
|
||||||
std::string arg0;
|
|
||||||
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Mesh:setTexture");
|
|
||||||
|
|
||||||
if (!ok) { break; }
|
|
||||||
cobj->setTexture(arg0);
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}while(0);
|
|
||||||
ok = true;
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:setTexture",argc, 1);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_setTexture'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_cocos2dx_3d_Mesh_getTexture(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
cocos2d::Mesh* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_getTexture'", 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_3d_Mesh_getTexture'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cocos2d::Texture2D* ret = cobj->getTexture();
|
|
||||||
object_to_luaval<cocos2d::Texture2D>(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:getTexture",argc, 0);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_getTexture'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_cocos2dx_3d_Mesh_getMaterial(lua_State* tolua_S)
|
int lua_cocos2dx_3d_Mesh_getMaterial(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -1945,6 +1843,53 @@ int lua_cocos2dx_3d_Mesh_getVertexSizeInBytes(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int lua_cocos2dx_3d_Mesh_enableCheckTexture(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
cocos2d::Mesh* cobj = nullptr;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0);
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!cobj)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_enableCheckTexture'", 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_3d_Mesh_enableCheckTexture'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
bool ret = cobj->enableCheckTexture();
|
||||||
|
tolua_pushboolean(tolua_S,(bool)ret);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:enableCheckTexture",argc, 0);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_enableCheckTexture'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int lua_cocos2dx_3d_Mesh_setMaterial(lua_State* tolua_S)
|
int lua_cocos2dx_3d_Mesh_setMaterial(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -2598,6 +2543,56 @@ int lua_cocos2dx_3d_Mesh_setSkin(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int lua_cocos2dx_3d_Mesh_setEnableCheckTexture(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
cocos2d::Mesh* cobj = nullptr;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!tolua_isusertype(tolua_S,1,"cc.Mesh",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cobj = (cocos2d::Mesh*)tolua_tousertype(tolua_S,1,0);
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
if (!cobj)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Mesh_setEnableCheckTexture'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S)-1;
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
bool arg0;
|
||||||
|
|
||||||
|
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Mesh:setEnableCheckTexture");
|
||||||
|
if(!ok)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Mesh_setEnableCheckTexture'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
cobj->setEnableCheckTexture(arg0);
|
||||||
|
lua_settop(tolua_S, 1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Mesh:setEnableCheckTexture",argc, 1);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if COCOS2D_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Mesh_setEnableCheckTexture'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int lua_cocos2dx_3d_Mesh_isVisible(lua_State* tolua_S)
|
int lua_cocos2dx_3d_Mesh_isVisible(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -2795,10 +2790,9 @@ int lua_register_cocos2dx_3d_Mesh(lua_State* tolua_S)
|
||||||
|
|
||||||
tolua_beginmodule(tolua_S,"Mesh");
|
tolua_beginmodule(tolua_S,"Mesh");
|
||||||
tolua_function(tolua_S,"new",lua_cocos2dx_3d_Mesh_constructor);
|
tolua_function(tolua_S,"new",lua_cocos2dx_3d_Mesh_constructor);
|
||||||
tolua_function(tolua_S,"setTexture",lua_cocos2dx_3d_Mesh_setTexture);
|
|
||||||
tolua_function(tolua_S,"getTexture",lua_cocos2dx_3d_Mesh_getTexture);
|
|
||||||
tolua_function(tolua_S,"getMaterial",lua_cocos2dx_3d_Mesh_getMaterial);
|
tolua_function(tolua_S,"getMaterial",lua_cocos2dx_3d_Mesh_getMaterial);
|
||||||
tolua_function(tolua_S,"getVertexSizeInBytes",lua_cocos2dx_3d_Mesh_getVertexSizeInBytes);
|
tolua_function(tolua_S,"getVertexSizeInBytes",lua_cocos2dx_3d_Mesh_getVertexSizeInBytes);
|
||||||
|
tolua_function(tolua_S,"enableCheckTexture",lua_cocos2dx_3d_Mesh_enableCheckTexture);
|
||||||
tolua_function(tolua_S,"setMaterial",lua_cocos2dx_3d_Mesh_setMaterial);
|
tolua_function(tolua_S,"setMaterial",lua_cocos2dx_3d_Mesh_setMaterial);
|
||||||
tolua_function(tolua_S,"getName",lua_cocos2dx_3d_Mesh_getName);
|
tolua_function(tolua_S,"getName",lua_cocos2dx_3d_Mesh_getName);
|
||||||
tolua_function(tolua_S,"getMeshVertexAttribute",lua_cocos2dx_3d_Mesh_getMeshVertexAttribute);
|
tolua_function(tolua_S,"getMeshVertexAttribute",lua_cocos2dx_3d_Mesh_getMeshVertexAttribute);
|
||||||
|
@ -2812,6 +2806,7 @@ int lua_register_cocos2dx_3d_Mesh(lua_State* tolua_S)
|
||||||
tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_3d_Mesh_setBlendFunc);
|
tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_3d_Mesh_setBlendFunc);
|
||||||
tolua_function(tolua_S,"setForce2DQueue",lua_cocos2dx_3d_Mesh_setForce2DQueue);
|
tolua_function(tolua_S,"setForce2DQueue",lua_cocos2dx_3d_Mesh_setForce2DQueue);
|
||||||
tolua_function(tolua_S,"setSkin",lua_cocos2dx_3d_Mesh_setSkin);
|
tolua_function(tolua_S,"setSkin",lua_cocos2dx_3d_Mesh_setSkin);
|
||||||
|
tolua_function(tolua_S,"setEnableCheckTexture",lua_cocos2dx_3d_Mesh_setEnableCheckTexture);
|
||||||
tolua_function(tolua_S,"isVisible",lua_cocos2dx_3d_Mesh_isVisible);
|
tolua_function(tolua_S,"isVisible",lua_cocos2dx_3d_Mesh_isVisible);
|
||||||
tolua_function(tolua_S,"setGLProgramState",lua_cocos2dx_3d_Mesh_setGLProgramState);
|
tolua_function(tolua_S,"setGLProgramState",lua_cocos2dx_3d_Mesh_setGLProgramState);
|
||||||
tolua_function(tolua_S,"setVisible",lua_cocos2dx_3d_Mesh_setVisible);
|
tolua_function(tolua_S,"setVisible",lua_cocos2dx_3d_Mesh_setVisible);
|
||||||
|
|
|
@ -96758,266 +96758,6 @@ int lua_register_cocos2dx_MotionStreak3D(lua_State* tolua_S)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lua_cocos2dx_Sprite3DMaterial_getMaterialType(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
cocos2d::Sprite3DMaterial* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"cc.Sprite3DMaterial",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (cocos2d::Sprite3DMaterial*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite3DMaterial_getMaterialType'", 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_Sprite3DMaterial_getMaterialType'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int ret = (int)cobj->getMaterialType();
|
|
||||||
tolua_pushnumber(tolua_S,(lua_Number)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3DMaterial:getMaterialType",argc, 0);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3DMaterial_getMaterialType'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_cocos2dx_Sprite3DMaterial_createWithFilename(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.Sprite3DMaterial",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S) - 1;
|
|
||||||
|
|
||||||
if (argc == 1)
|
|
||||||
{
|
|
||||||
std::string arg0;
|
|
||||||
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3DMaterial:createWithFilename");
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite3DMaterial_createWithFilename'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cocos2d::Sprite3DMaterial* ret = cocos2d::Sprite3DMaterial::createWithFilename(arg0);
|
|
||||||
object_to_luaval<cocos2d::Sprite3DMaterial>(tolua_S, "cc.Sprite3DMaterial",(cocos2d::Sprite3DMaterial*)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite3DMaterial:createWithFilename",argc, 1);
|
|
||||||
return 0;
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3DMaterial_createWithFilename'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_cocos2dx_Sprite3DMaterial_releaseCachedMaterial(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.Sprite3DMaterial",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S) - 1;
|
|
||||||
|
|
||||||
if (argc == 0)
|
|
||||||
{
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite3DMaterial_releaseCachedMaterial'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cocos2d::Sprite3DMaterial::releaseCachedMaterial();
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite3DMaterial:releaseCachedMaterial",argc, 0);
|
|
||||||
return 0;
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3DMaterial_releaseCachedMaterial'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_cocos2dx_Sprite3DMaterial_createBuiltInMaterial(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.Sprite3DMaterial",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (argc == 0)
|
|
||||||
{
|
|
||||||
cocos2d::Sprite3DMaterial::createBuiltInMaterial();
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
} while (0);
|
|
||||||
ok = true;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (argc == 2)
|
|
||||||
{
|
|
||||||
cocos2d::Sprite3DMaterial::MaterialType arg0;
|
|
||||||
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Sprite3DMaterial:createBuiltInMaterial");
|
|
||||||
if (!ok) { break; }
|
|
||||||
bool arg1;
|
|
||||||
ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Sprite3DMaterial:createBuiltInMaterial");
|
|
||||||
if (!ok) { break; }
|
|
||||||
cocos2d::Sprite3DMaterial* ret = cocos2d::Sprite3DMaterial::createBuiltInMaterial(arg0, arg1);
|
|
||||||
object_to_luaval<cocos2d::Sprite3DMaterial>(tolua_S, "cc.Sprite3DMaterial",(cocos2d::Sprite3DMaterial*)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
} while (0);
|
|
||||||
ok = true;
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite3DMaterial:createBuiltInMaterial",argc, 2);
|
|
||||||
return 0;
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3DMaterial_createBuiltInMaterial'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_cocos2dx_Sprite3DMaterial_createWithGLStateProgram(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.Sprite3DMaterial",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S) - 1;
|
|
||||||
|
|
||||||
if (argc == 1)
|
|
||||||
{
|
|
||||||
cocos2d::GLProgramState* arg0;
|
|
||||||
ok &= luaval_to_object<cocos2d::GLProgramState>(tolua_S, 2, "cc.GLProgramState",&arg0, "cc.Sprite3DMaterial:createWithGLStateProgram");
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite3DMaterial_createWithGLStateProgram'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cocos2d::Sprite3DMaterial* ret = cocos2d::Sprite3DMaterial::createWithGLStateProgram(arg0);
|
|
||||||
object_to_luaval<cocos2d::Sprite3DMaterial>(tolua_S, "cc.Sprite3DMaterial",(cocos2d::Sprite3DMaterial*)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite3DMaterial:createWithGLStateProgram",argc, 1);
|
|
||||||
return 0;
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3DMaterial_createWithGLStateProgram'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_cocos2dx_Sprite3DMaterial_releaseBuiltInMaterial(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.Sprite3DMaterial",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S) - 1;
|
|
||||||
|
|
||||||
if (argc == 0)
|
|
||||||
{
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite3DMaterial_releaseBuiltInMaterial'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cocos2d::Sprite3DMaterial::releaseBuiltInMaterial();
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite3DMaterial:releaseBuiltInMaterial",argc, 0);
|
|
||||||
return 0;
|
|
||||||
#if COCOS2D_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite3DMaterial_releaseBuiltInMaterial'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
static int lua_cocos2dx_Sprite3DMaterial_finalize(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
printf("luabindings: finalizing LUA object (Sprite3DMaterial)");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int lua_register_cocos2dx_Sprite3DMaterial(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
tolua_usertype(tolua_S,"cc.Sprite3DMaterial");
|
|
||||||
tolua_cclass(tolua_S,"Sprite3DMaterial","cc.Sprite3DMaterial","cc.Material",nullptr);
|
|
||||||
|
|
||||||
tolua_beginmodule(tolua_S,"Sprite3DMaterial");
|
|
||||||
tolua_function(tolua_S,"getMaterialType",lua_cocos2dx_Sprite3DMaterial_getMaterialType);
|
|
||||||
tolua_function(tolua_S,"createWithFilename", lua_cocos2dx_Sprite3DMaterial_createWithFilename);
|
|
||||||
tolua_function(tolua_S,"releaseCachedMaterial", lua_cocos2dx_Sprite3DMaterial_releaseCachedMaterial);
|
|
||||||
tolua_function(tolua_S,"createBuiltInMaterial", lua_cocos2dx_Sprite3DMaterial_createBuiltInMaterial);
|
|
||||||
tolua_function(tolua_S,"createWithGLStateProgram", lua_cocos2dx_Sprite3DMaterial_createWithGLStateProgram);
|
|
||||||
tolua_function(tolua_S,"releaseBuiltInMaterial", lua_cocos2dx_Sprite3DMaterial_releaseBuiltInMaterial);
|
|
||||||
tolua_endmodule(tolua_S);
|
|
||||||
std::string typeName = typeid(cocos2d::Sprite3DMaterial).name();
|
|
||||||
g_luaType[typeName] = "cc.Sprite3DMaterial";
|
|
||||||
g_typeCast["Sprite3DMaterial"] = "cc.Sprite3DMaterial";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int lua_cocos2dx_ComponentLua_getScriptObject(lua_State* tolua_S)
|
int lua_cocos2dx_ComponentLua_getScriptObject(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -97318,7 +97058,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S)
|
||||||
lua_register_cocos2dx_EaseExponentialOut(tolua_S);
|
lua_register_cocos2dx_EaseExponentialOut(tolua_S);
|
||||||
lua_register_cocos2dx_Label(tolua_S);
|
lua_register_cocos2dx_Label(tolua_S);
|
||||||
lua_register_cocos2dx_Application(tolua_S);
|
lua_register_cocos2dx_Application(tolua_S);
|
||||||
lua_register_cocos2dx_Sprite3DMaterial(tolua_S);
|
|
||||||
lua_register_cocos2dx_DelayTime(tolua_S);
|
lua_register_cocos2dx_DelayTime(tolua_S);
|
||||||
lua_register_cocos2dx_LabelAtlas(tolua_S);
|
lua_register_cocos2dx_LabelAtlas(tolua_S);
|
||||||
lua_register_cocos2dx_SpriteBatchNode(tolua_S);
|
lua_register_cocos2dx_SpriteBatchNode(tolua_S);
|
||||||
|
|
|
@ -2151,13 +2151,6 @@ int register_all_cocos2dx(lua_State* tolua_S);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6790,7 +6790,6 @@
|
||||||
"cocos/scripting/lua-bindings/auto/api/Sprite.lua",
|
"cocos/scripting/lua-bindings/auto/api/Sprite.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Sprite3D.lua",
|
"cocos/scripting/lua-bindings/auto/api/Sprite3D.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Sprite3DCache.lua",
|
"cocos/scripting/lua-bindings/auto/api/Sprite3DCache.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/Sprite3DMaterial.lua",
|
|
||||||
"cocos/scripting/lua-bindings/auto/api/SpriteBatchNode.lua",
|
"cocos/scripting/lua-bindings/auto/api/SpriteBatchNode.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/SpriteDisplayData.lua",
|
"cocos/scripting/lua-bindings/auto/api/SpriteDisplayData.lua",
|
||||||
"cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua",
|
"cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"packageUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene1/",
|
"packageUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene1/",
|
||||||
"remoteManifestUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene1/project_dev.manifest",
|
"remoteManifestUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene1/project_dev.manifest",
|
||||||
"remoteVersionUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene1/version_dev.manifest",
|
"remoteVersionUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene1/version_dev.manifest",
|
||||||
"version" : "1.0.0",
|
"version" : "1.0.0",
|
||||||
"engineVersion" : "3.0 beta",
|
"engineVersion" : "3.0 beta",
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"packageUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene2/",
|
"packageUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene2/",
|
||||||
"remoteManifestUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene2/project_dev.manifest",
|
"remoteManifestUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene2/project_dev.manifest",
|
||||||
"version" : "1.0.0",
|
"version" : "1.0.0",
|
||||||
"engineVersion" : "3.0 beta",
|
"engineVersion" : "3.0 beta",
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"packageUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene3/",
|
"packageUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene3/",
|
||||||
"remoteManifestUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene3/project_dev.manifest",
|
"remoteManifestUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene3/project_dev.manifest",
|
||||||
"remoteVersionUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene3/version_dev.manifest",
|
"remoteVersionUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene3/version_dev.manifest",
|
||||||
"version" : "1.0.0",
|
"version" : "1.0.0",
|
||||||
"engineVersion" : "3.0 beta",
|
"engineVersion" : "3.0 beta",
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"packageUrl" : "http://cocostudio.download.appget.cn/Cocos2D-X/",
|
"packageUrl" : "http://cocostudio.download.appget.cn/Cocos2D-X/",
|
||||||
"remoteManifestUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene4/project_dev.manifest",
|
"remoteManifestUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene4/project_dev.manifest",
|
||||||
"remoteVersionUrl" : "http://tools.itharbors.com/assets_manager/AMTestScene4/version_dev.manifest",
|
"remoteVersionUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/AMTestScene4/version_dev.manifest",
|
||||||
"version" : "1.0.0",
|
"version" : "1.0.0",
|
||||||
"engineVersion" : "3.0 beta",
|
"engineVersion" : "3.0 beta",
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"packageUrl" : "http://tools.itharbors.com/assets_manager/ScriptTest/",
|
"packageUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/ScriptTest/",
|
||||||
"remoteManifestUrl" : "http://tools.itharbors.com/assets_manager/ScriptTest/project_dev.manifest",
|
"remoteManifestUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/ScriptTest/project_dev.manifest",
|
||||||
"remoteVersionUrl" : "http://tools.itharbors.com/assets_manager/ScriptTest/version_dev.manifest",
|
"remoteVersionUrl" : "http://cocos2d-x.org/assets/cpp-tests-resources/assets_manager/ScriptTest/version_dev.manifest",
|
||||||
"version" : "1.0.0",
|
"version" : "1.0.0",
|
||||||
"engineVersion" : "3.0",
|
"engineVersion" : "3.0",
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<false/>
|
<false/>
|
||||||
<key>NSExceptionDomains</key>
|
<key>NSExceptionDomains</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>tools.itharbors.com</key>
|
<key>cocos2d-x.org/assets/cpp-tests-resources</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSIncludesSubdomains</key>
|
<key>NSIncludesSubdomains</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
|
|
@ -153,7 +153,7 @@ var SocketIOTestLayer = cc.Layer.extend({
|
||||||
onMenuSIOClientClicked: function(sender) {
|
onMenuSIOClientClicked: function(sender) {
|
||||||
|
|
||||||
//create a client by using this static method, url does not need to contain the protocol
|
//create a client by using this static method, url does not need to contain the protocol
|
||||||
var sioclient = SocketIO.connect("ws://tools.itharbors.com:4000", {"force new connection" : true});
|
var sioclient = SocketIO.connect("ws://cocos2d-x.org/assets/cpp-tests-resources:4000", {"force new connection" : true});
|
||||||
|
|
||||||
//if you need to track multiple sockets it is best to store them with tags in your own array for now
|
//if you need to track multiple sockets it is best to store them with tags in your own array for now
|
||||||
sioclient.tag = "Test Client";
|
sioclient.tag = "Test Client";
|
||||||
|
@ -193,7 +193,7 @@ var SocketIOTestLayer = cc.Layer.extend({
|
||||||
onMenuSIOEndpointClicked: function(sender) {
|
onMenuSIOEndpointClicked: function(sender) {
|
||||||
|
|
||||||
//repeat the same connection steps for the namespace "testpoint"
|
//repeat the same connection steps for the namespace "testpoint"
|
||||||
var sioendpoint = SocketIO.connect("ws://tools.itharbors.com:4000/testpoint", {"force new connection" : true});
|
var sioendpoint = SocketIO.connect("ws://cocos2d-x.org/assets/cpp-tests-resources:4000/testpoint", {"force new connection" : true});
|
||||||
|
|
||||||
//a tag to differentiate in shared callbacks
|
//a tag to differentiate in shared callbacks
|
||||||
sioendpoint.tag = "Test Endpoint";
|
sioendpoint.tag = "Test Endpoint";
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2318a1593d2d490a3860179acaf81a1bf867a36b
|
Subproject commit 76c1ae80aa78df9f35ad2cccd8fab9aa60cf68a6
|
Loading…
Reference in New Issue