1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

SAPI: Move core.get_us_time() to Util module

This commit is contained in:
kwolekr 2015-10-26 03:45:55 -04:00
parent 5f342aa015
commit 306b067091
5 changed files with 17 additions and 12 deletions

View file

@ -65,6 +65,14 @@ int ModApiUtil::l_log(lua_State *L)
return 0;
}
// get_us_time()
int ModApiUtil::l_get_us_time(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
lua_pushnumber(L, porting::getTimeUs());
return 1;
}
#define CHECK_SECURE_SETTING(L, name) \
if (name.compare(0, 7, "secure.") == 0) {\
lua_pushliteral(L, "Attempt to set secure setting.");\
@ -368,6 +376,8 @@ void ModApiUtil::Initialize(lua_State *L, int top)
{
API_FCT(log);
API_FCT(get_us_time);
API_FCT(setting_set);
API_FCT(setting_get);
API_FCT(setting_setbool);
@ -399,6 +409,8 @@ void ModApiUtil::InitializeAsync(AsyncEngine& engine)
{
ASYNC_API_FCT(log);
ASYNC_API_FCT(get_us_time);
//ASYNC_API_FCT(setting_set);
ASYNC_API_FCT(setting_get);
//ASYNC_API_FCT(setting_setbool);