/apps/twnlua: expose ctx
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
/* generated by bindgen.py */
|
||||
void bindgen_load_twn(lua_State *L);
|
||||
void bindgen_unload_twn(lua_State *L);
|
||||
void bindgen_build_context(lua_State *L);
|
||||
|
||||
|
||||
/* require will go through physicsfs exclusively so that scripts can be in the data dir */
|
||||
@ -110,6 +111,9 @@ void game_tick(void) {
|
||||
|
||||
State *state = ctx.udata;
|
||||
|
||||
bindgen_build_context(state->L);
|
||||
lua_setglobal(state->L, "ctx");
|
||||
|
||||
lua_getglobal(state->L, "game_tick");
|
||||
if (lua_pcall(state->L, 0, 0, 0) != LUA_OK) {
|
||||
log_critical("%s", lua_tostring(state->L, -1));
|
||||
|
Reference in New Issue
Block a user