lua/wrappers/gfx/lua_asset.cpp
/**
	 * Checks if the asset contains the given texture.
	 *
	 * @param am.texture texture The texture to check for.
	 * @returns boolean True if the texture was found.
	 */
Checks if the asset contains the given texture.
Checks if the asset contains the given texture .
int Asset_has_texture(lua_State *lua)
	{
		Asset *asset = castUData<Asset>(lua, 1);
		if (asset)
		{
			if (lua_isstr(lua, 2))
			{
				lua_pushboolean(lua, asset->hasTexture(lua_tostring(lua, 2)));
				return 1;
			}
			Texture *texture = castUData<Texture>(lua, 2);
			if (texture)
			{
				lua_pushboolean(lua, asset->hasTexture(texture));
				return 1;
			}
			return LuaState::expectedArgs(lua, "has_texture", 2, "am.texture texture", "string filename");
		}
		return LuaState::expectedContext(lua, "has_texture", "am.asset");
	}
int Asset_has_texture ( lua_State * lua ) { Asset * asset = castUData < Asset > ( lua , 1 ) ; if ( asset ) { if ( lua_isstr ( lua , 2 ) ) { lua_pushboolean ( lua , asset -> hasTexture ( lua_tostring ( lua , 2 ) ) ) ; return 1 ; } Texture * texture = castUData < Texture > ( lua , 2 ) ; if ( texture ) { lua_pushboolean ( lua , asset -> hasTexture ( texture ) ) ; return 1 ; } return LuaState :: expectedArgs ( lua , " " , 2 , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Checks if the asset contains the given texture.
Checks if the asset contains the given texture .