4#define luaL_setfuncs krig_custom_setfuncs
8 #include "luajit-2.1/lua.h"
9 #include "luajit-2.1/lualib.h"
10 #include "luajit-2.1/lauxlib.h"
13#if !defined LUA_VERSION_NUM || LUA_VERSION_NUM==501
17inline void krig_custom_setfuncs (lua_State *L,
const luaL_Reg *l,
int nup) {
18 luaL_checkstack(L, nup+1,
"too many upvalues");
19 for (; l->name != NULL; l++) {
21 lua_pushstring(L, l->name);
22 for (i = 0; i < nup; i++)
23 lua_pushvalue(L, -(nup+1));
24 lua_pushcclosure(L, l->func, nup);
25 lua_settable(L, -(nup + 3));
31#include "krig_game_engine.h"
35#define SCRIPT_CALLBACK_ON_LOAD "on_load"
36#define SCRIPT_CALLBACK_ON_UPDATE "on_update"
37#define SCRIPT_CALLBACK_ON_DRAW "on_draw"
38#define SCRIPT_CALLBACK_ON_DRAW_SCREEN "on_draw_screen"
39#define SCRIPT_CALLBACK_ON_COLLISION "on_collision"
40#define SCRIPT_CALLBACK_ON_UNLOAD "on_unload"
43Vector loadVector(lua_State *L);
44Vector loadVector(lua_State *L,
int &index);
45Quaternion loadQuaternion(lua_State *L,
const int &index);
46Object* loadObject(lua_State *L,
const int &index);
47void loadArray(lua_State *L,
float array[],
int len,
int index);
48void returnVector(lua_State *L,
const Vector &t);
49void returnQuaternion(lua_State *L,
const Quaternion &t);
50void returnObject(lua_State *L,
Object*
object);
51void returnArray(lua_State *L,
float array[],
int len);
52void luaopen_krigApi(lua_State *L);
Base game object from which all concrete types are defined.
Definition Quaternion.h:18