28 #define ERR_LUA LOG_STREAM(err, log_lua)
35 static const char *
Rng =
"Rng";
39 boost::uint32_t seed = lua_kernel_base::get_lua_kernel<lua_kernel_base>(L).get_random_seed();
51 ERR_LUA <<
"This may indicate a memory leak, please report at bugs.wesnoth.org" << std::endl;
83 static luaL_Reg const callbacks[] = {
LUALIB_API void * luaL_checkudata(lua_State *L, int ud, const char *tname)
LUA_API int lua_type(lua_State *L, int idx)
uint32_t get_next_random()
Get a new random number.
int impl_rng_destroy(lua_State *L)
void seed_random(const std::string &seed, const unsigned int call_count=0)
Same as uint32_t version, but uses a stringstream to convert given hex string.
LUALIB_API void luaL_setmetatable(lua_State *L, const char *tname)
LUA_API void * lua_newuserdata(lua_State *L, size_t size)
static lg::log_domain log_lua("scripting/lua")
LUA_API void lua_setglobal(lua_State *L, const char *var)
LUALIB_API void * luaL_testudata(lua_State *L, int ud, const char *tname)
LUA_API void lua_pushnumber(lua_State *L, lua_Number n)
LUALIB_API int luaL_newmetatable(lua_State *L, const char *tname)
int impl_rng_seed(lua_State *L)
LUA_API void lua_pushvalue(lua_State *L, int idx)
LUA_API int lua_error(lua_State *L)
Standard logging facilities (interface).
LUALIB_API void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup)
int impl_rng_create(lua_State *L)
Implementations for lua callbacks.
int impl_rng_draw(lua_State *L)
GLsizei const GLcharARB ** string
void load_tables(lua_State *L)
Creates the metatable for RNG objects, and adds the Rng table which contains the constructor.
LUA_API const char * lua_pushstring(lua_State *L, const char *s)
LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
LUA_API const char * lua_typename(lua_State *L, int t)
#define luaL_checkstring(L, n)