mirror of
https://github.com/u0u0/Quick-Cocos2dx-Community.git
synced 2026-06-22 07:10:28 +08:00
Add new Lua Binding for spSkeletonData. Integrate win32 Player. Add "exact_fit" mode for display
56 lines
894 B
C
56 lines
894 B
C
|
|
#include "lua_extensions_more.h"
|
|
|
|
#if __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// cjson
|
|
#include "cjson/lua_cjson.h"
|
|
|
|
// zlib
|
|
#include "zlib/lua_zlib.h"
|
|
|
|
// lpack
|
|
#include "lpack/lpack.h"
|
|
|
|
#ifndef WP8
|
|
|
|
// filesystem
|
|
#include "filesystem/lfs.h"
|
|
#endif
|
|
|
|
// lsqlite3
|
|
#include "lsqlite3/lsqlite3.h"
|
|
|
|
static luaL_Reg luax_exts[] = {
|
|
{"cjson", luaopen_cjson_safe},
|
|
{"zlib", luaopen_zlib},
|
|
{"pack", luaopen_pack},
|
|
#ifndef WP8
|
|
{"lfs", luaopen_lfs},
|
|
#endif
|
|
#if CC_USE_SQLITE
|
|
{"lsqlite3", luaopen_lsqlite3},
|
|
#endif
|
|
{NULL, NULL}
|
|
};
|
|
|
|
void luaopen_lua_extensions_more(lua_State *L)
|
|
{
|
|
// load extensions
|
|
luaL_Reg* lib = luax_exts;
|
|
lua_getglobal(L, "package");
|
|
lua_getfield(L, -1, "preload");
|
|
for (; lib->func; lib++)
|
|
{
|
|
lua_pushcfunction(L, lib->func);
|
|
lua_setfield(L, -2, lib->name);
|
|
}
|
|
lua_pop(L, 2);
|
|
}
|
|
|
|
#if __cplusplus
|
|
} // extern "C"
|
|
#endif
|