From f766463b3c181b476816d3f335b1bcb8e239f866 Mon Sep 17 00:00:00 2001 From: grorp Date: Wed, 1 Jan 2025 20:55:25 +0100 Subject: [PATCH] Remove unused l_get_video_drivers in ModApiMainMenu --- doc/menu_lua_api.md | 5 ----- src/script/lua_api/l_mainmenu.cpp | 22 ---------------------- src/script/lua_api/l_mainmenu.h | 2 -- 3 files changed, 29 deletions(-) diff --git a/doc/menu_lua_api.md b/doc/menu_lua_api.md index b17e4b1c8..49459e191 100644 --- a/doc/menu_lua_api.md +++ b/doc/menu_lua_api.md @@ -105,11 +105,6 @@ of manually putting one, as different OSs use different delimiters. E.g. * `spec` = `SimpleSoundSpec` (see `lua_api.md`) * `looped` = bool * `handle:stop()` or `core.sound_stop(handle)` -* `core.get_video_drivers()` - * get list of video drivers supported by engine (not all modes are guaranteed to work) - * returns list of available video drivers' settings name and 'friendly' display name - e.g. `{ {name="opengl", friendly_name="OpenGL"}, {name="software", friendly_name="Software Renderer"} }` - * first element of returned list is guaranteed to be the NULL driver * `core.get_mapgen_names([include_hidden=false])` -> table of map generator algorithms registered in the core (possible in async calls) * `core.get_cache_path()` -> path of cache diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index 8f27db3b9..f077a8cdc 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -875,27 +875,6 @@ int ModApiMainMenu::l_download_file(lua_State *L) return 1; } -/******************************************************************************/ -int ModApiMainMenu::l_get_video_drivers(lua_State *L) -{ - auto drivers = RenderingEngine::getSupportedVideoDrivers(); - - lua_newtable(L); - for (u32 i = 0; i != drivers.size(); i++) { - auto &info = RenderingEngine::getVideoDriverInfo(drivers[i]); - - lua_newtable(L); - lua_pushstring(L, info.name.c_str()); - lua_setfield(L, -2, "name"); - lua_pushstring(L, info.friendly_name.c_str()); - lua_setfield(L, -2, "friendly_name"); - - lua_rawseti(L, -2, i + 1); - } - - return 1; -} - /******************************************************************************/ int ModApiMainMenu::l_get_language(lua_State *L) { @@ -1096,7 +1075,6 @@ void ModApiMainMenu::Initialize(lua_State *L, int top) API_FCT(show_path_select_dialog); API_FCT(download_file); API_FCT(get_language); - API_FCT(get_video_drivers); API_FCT(get_window_info); API_FCT(get_active_renderer); API_FCT(get_active_irrlicht_device); diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h index e70a95dd0..63f45d74b 100644 --- a/src/script/lua_api/l_mainmenu.h +++ b/src/script/lua_api/l_mainmenu.h @@ -127,8 +127,6 @@ private: static int l_download_file(lua_State *L); - static int l_get_video_drivers(lua_State *L); - //version compatibility static int l_get_min_supp_proto(lua_State *L);