summaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorhecks <42101236+hecktest@users.noreply.github.com>2021-07-11 09:50:34 +0200
committerGitHub <noreply@github.com>2021-07-11 09:50:34 +0200
commit1d25d1f7ad35f739e8a64c2bdb44105998aed19b (patch)
tree34af48bb94a2e464e6c7c775b353f64777bd650a /src/script/lua_api
parent29522017a3c06f16a2fe2ef484ed3088b42748ea (diff)
downloadminetest-1d25d1f7ad35f739e8a64c2bdb44105998aed19b.tar.gz
minetest-1d25d1f7ad35f739e8a64c2bdb44105998aed19b.tar.bz2
minetest-1d25d1f7ad35f739e8a64c2bdb44105998aed19b.zip
Refactor video driver name retrieval (#11413)
Co-authored-by: hecktest <>
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index 788557460..ad00de1c4 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -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);