Merge pull request #11963 from CocosRobot/update_lua_bindings_1432259998

[AUTO]: updating luabinding & jsbinding automatically
This commit is contained in:
minggo 2015-05-22 14:41:28 +08:00
commit 11f8f0fc21
7 changed files with 105 additions and 1 deletions

View File

@ -20323,6 +20323,18 @@ str
return cc.Texture2D;
},
/**
* @method getTextureFilePath
* @param {cc.Texture2D} arg0
* @return {String}
*/
getTextureFilePath : function (
texture2d
)
{
return ;
},
/**
* @method removeUnusedTextures
*/

View File

@ -62350,6 +62350,35 @@ bool js_cocos2dx_TextureCache_getTextureForKey(JSContext *cx, uint32_t argc, jsv
JS_ReportError(cx, "js_cocos2dx_TextureCache_getTextureForKey : wrong number of arguments: %d, was expecting %d", argc, 1);
return false;
}
bool js_cocos2dx_TextureCache_getTextureFilePath(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
bool ok = true;
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_TextureCache_getTextureFilePath : Invalid Native Object");
if (argc == 1) {
cocos2d::Texture2D* arg0;
do {
if (!args.get(0).isObject()) { ok = false; break; }
js_proxy_t *jsProxy;
JSObject *tmpObj = args.get(0).toObjectOrNull();
jsProxy = jsb_get_js_proxy(tmpObj);
arg0 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL);
JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object");
} while (0);
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TextureCache_getTextureFilePath : Error processing arguments");
const std::string ret = cobj->getTextureFilePath(arg0);
jsval jsret = JSVAL_NULL;
jsret = std_string_to_jsval(cx, ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_TextureCache_getTextureFilePath : wrong number of arguments: %d, was expecting %d", argc, 1);
return false;
}
bool js_cocos2dx_TextureCache_removeUnusedTextures(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -62473,6 +62502,7 @@ void js_register_cocos2dx_TextureCache(JSContext *cx, JS::HandleObject global) {
JS_FN("addImage", js_cocos2dx_TextureCache_addImage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("unbindImageAsync", js_cocos2dx_TextureCache_unbindImageAsync, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getTextureForKey", js_cocos2dx_TextureCache_getTextureForKey, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getTextureFilePath", js_cocos2dx_TextureCache_getTextureFilePath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("removeUnusedTextures", js_cocos2dx_TextureCache_removeUnusedTextures, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("removeTexture", js_cocos2dx_TextureCache_removeTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("waitForQuit", js_cocos2dx_TextureCache_waitForQuit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),

View File

@ -3635,6 +3635,7 @@ bool js_cocos2dx_TextureCache_getCachedTextureInfo(JSContext *cx, uint32_t argc,
bool js_cocos2dx_TextureCache_addImage(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_TextureCache_unbindImageAsync(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_TextureCache_getTextureForKey(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_TextureCache_getTextureFilePath(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_TextureCache_removeUnusedTextures(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_TextureCache_removeTexture(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_TextureCache_waitForQuit(JSContext *cx, uint32_t argc, jsval *vp);

View File

@ -85,6 +85,15 @@
-- @param #string key
-- @return Texture2D#Texture2D ret (return value: cc.Texture2D)
--------------------------------
-- Get the file path of the texture<br>
-- param texture A Texture2D object pointer.<br>
-- return The full path of the file.
-- @function [parent=#TextureCache] getTextureFilePath
-- @param self
-- @param #cc.Texture2D texture
-- @return string#string ret (return value: string)
--------------------------------
-- Removes unused textures.<br>
-- Textures that have a retain count of 1 will be deleted.<br>

View File

@ -124,7 +124,7 @@
-- @return string#string ret (return value: string)
--------------------------------
-- All supported platforms other iOS & Android use xml file to save values. This function checks whether the xml file exists or not.<br>
-- All supported platforms other iOS & Android and CC_PLATFORM_WINRT use xml file to save values. This function checks whether the xml file exists or not.<br>
-- return True if the xml file exists, flase if not.<br>
-- js NA
-- @function [parent=#UserDefault] isXMLFileExist

View File

@ -80241,6 +80241,56 @@ int lua_cocos2dx_TextureCache_getTextureForKey(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_TextureCache_getTextureFilePath(lua_State* tolua_S)
{
int argc = 0;
cocos2d::TextureCache* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.TextureCache",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_getTextureFilePath'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::Texture2D* arg0;
ok &= luaval_to_object<cocos2d::Texture2D>(tolua_S, 2, "cc.Texture2D",&arg0, "cc.TextureCache:getTextureFilePath");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TextureCache_getTextureFilePath'", nullptr);
return 0;
}
const std::string ret = cobj->getTextureFilePath(arg0);
tolua_pushcppstring(tolua_S,ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TextureCache:getTextureFilePath",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TextureCache_getTextureFilePath'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_TextureCache_removeUnusedTextures(lua_State* tolua_S)
{
int argc = 0;
@ -80444,6 +80494,7 @@ int lua_register_cocos2dx_TextureCache(lua_State* tolua_S)
tolua_function(tolua_S,"addImage",lua_cocos2dx_TextureCache_addImage);
tolua_function(tolua_S,"unbindImageAsync",lua_cocos2dx_TextureCache_unbindImageAsync);
tolua_function(tolua_S,"getTextureForKey",lua_cocos2dx_TextureCache_getTextureForKey);
tolua_function(tolua_S,"getTextureFilePath",lua_cocos2dx_TextureCache_getTextureFilePath);
tolua_function(tolua_S,"removeUnusedTextures",lua_cocos2dx_TextureCache_removeUnusedTextures);
tolua_function(tolua_S,"removeTexture",lua_cocos2dx_TextureCache_removeTexture);
tolua_function(tolua_S,"waitForQuit",lua_cocos2dx_TextureCache_waitForQuit);

View File

@ -1972,6 +1972,7 @@ int register_all_cocos2dx(lua_State* tolua_S);
#endif // __cocos2dx_h__