1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 00:55:20 +02:00

Refactor video driver name retrieval (#11413)

Co-authored-by: hecktest <>
This commit is contained in:
hecks
2021-07-11 09:50:34 +02:00
committed by GitHub
parent 29522017a3
commit 1d25d1f7ad
3 changed files with 16 additions and 27 deletions

View File

@@ -737,13 +737,12 @@ int ModApiMainMenu::l_get_video_drivers(lua_State *L)
lua_newtable(L);
for (u32 i = 0; i != drivers.size(); i++) {
const char *name = RenderingEngine::getVideoDriverName(drivers[i]);
const char *fname = RenderingEngine::getVideoDriverFriendlyName(drivers[i]);
auto &info = RenderingEngine::getVideoDriverInfo(drivers[i]);
lua_newtable(L);
lua_pushstring(L, name);
lua_pushstring(L, info.name.c_str());
lua_setfield(L, -2, "name");
lua_pushstring(L, fname);
lua_pushstring(L, info.friendly_name.c_str());
lua_setfield(L, -2, "friendly_name");
lua_rawseti(L, -2, i + 1);