1 #ifndef _lua_int__hpp__included__
2 #define _lua_int__hpp__included__
10 std::string
get_string_argument(lua_State
* LS
, unsigned argindex
, const char* fname
);
11 bool get_boolean_argument(lua_State
* LS
, unsigned argindex
, const char* fname
);
12 extern lua_render_context
* lua_render_ctx
;
13 extern controls_t
* lua_input_controllerdata
;
17 T
get_numeric_argument(lua_State
* LS
, unsigned argindex
, const char* fname
)
19 if(lua_isnone(LS
, argindex
) || !lua_isnumber(LS
, argindex
)) {
20 lua_pushfstring(LS
, "argument #%i to %s must be numeric", argindex
, fname
);
23 return static_cast<T
>(lua_tonumber(LS
, argindex
));
27 void get_numeric_argument(lua_State
* LS
, unsigned argindex
, T
& value
, const char* fname
)
29 if(lua_isnoneornil(LS
, argindex
))
31 if(lua_isnone(LS
, argindex
) || !lua_isnumber(LS
, argindex
)) {
32 lua_pushfstring(LS
, "argument #%i to %s must be numeric if present", argindex
, fname
);
35 value
= static_cast<T
>(lua_tonumber(LS
, argindex
));