mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
replace lua Random implementation with usertype
This commit is contained in:
parent
3a40162f1e
commit
088bf63f3f
7 changed files with 115 additions and 38 deletions
|
|
@ -22,7 +22,7 @@ static int l_random(lua::State* L) {
|
|||
}
|
||||
}
|
||||
|
||||
static int l_bytes(lua::State* L) {
|
||||
static int l_generate(lua::State* L) {
|
||||
size_t size = lua::tointeger(L, 1);
|
||||
|
||||
auto randomEngine = util::seeded_random_engine(random_device);
|
||||
|
|
@ -40,7 +40,7 @@ static int l_uuid(lua::State* L) {
|
|||
|
||||
const luaL_Reg randomlib[] = {
|
||||
{"random", lua::wrap<l_random>},
|
||||
{"bytes", lua::wrap<l_bytes>},
|
||||
{"bytes", lua::wrap<l_generate>},
|
||||
{"uuid", lua::wrap<l_uuid>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue