1 /******************************
2 ** Tsunagari Tile Engine **
4 ** Copyright 2011 OmegaSDG **
5 ******************************/
16 void Script::addFn(const char* name
, lua_CFunction fn
)
18 lua_register(L
, name
, fn
);
21 void Script::addInt(const char* name
, lua_Integer i
)
23 lua_pushinteger(L
, i
);
24 lua_setglobal(L
, name
);
27 void Script::addData(const char* name
, void* data
)
29 lua_pushlightuserdata(L
, data
);
30 lua_setglobal(L
, name
);
33 void Script::run(const char* fn
)
35 if (luaL_loadfile(L
, fn
)) {
36 Log::err("Script::run", std::string("Couldn't load file: ") +