mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
redundancy reduced
This commit is contained in:
parent
8c86bcae54
commit
9b843817f8
10 changed files with 136 additions and 146 deletions
|
|
@ -90,9 +90,9 @@ static int l_file_mkdirs(lua_State* L) {
|
|||
static int l_file_read_bytes(lua_State* L) {
|
||||
fs::path path = resolve_path(L, lua_tostring(L, 1));
|
||||
if (fs::is_regular_file(path)) {
|
||||
size_t length = (size_t) fs::file_size(path);
|
||||
size_t length = static_cast<size_t>(fs::file_size(path));
|
||||
|
||||
ubyte* bytes = files::read_bytes(path, length);
|
||||
auto bytes = files::read_bytes(path, length);
|
||||
|
||||
lua_createtable(L, length, 0);
|
||||
int newTable = lua_gettop(L);
|
||||
|
|
|
|||
|
|
@ -413,12 +413,6 @@ static int l_gui_get_locales_info(lua_State* L) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
/// @brief gui.get_locale() -> string
|
||||
static int l_gui_get_locale(lua_State* L) {
|
||||
lua_pushstring(L, langs::current->getId().c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
const luaL_Reg guilib [] = {
|
||||
{"get_viewport", lua_wrap_errors<l_gui_getviewport>},
|
||||
{"getattr", lua_wrap_errors<l_gui_getattr>},
|
||||
|
|
@ -426,7 +420,6 @@ const luaL_Reg guilib [] = {
|
|||
{"get_env", lua_wrap_errors<l_gui_get_env>},
|
||||
{"str", lua_wrap_errors<l_gui_str>},
|
||||
{"reindex", lua_wrap_errors<l_gui_reindex>},
|
||||
{"get_locale", lua_wrap_errors<l_gui_get_locale>},
|
||||
{"get_locales_info", lua_wrap_errors<l_gui_get_locales_info>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue