diff options
author | Ilya Zhuravlev <zhuravlevilya@ya.ru> | 2013-12-13 20:35:57 +0400 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2014-01-05 12:43:40 +0200 |
commit | b8c3221d556b94b9e14df450ecf8f3be20ba87db (patch) | |
tree | 194b5129346ecef454f9eadb5c91ba101d37c5a8 /src/script/lua_api | |
parent | 4d22977509af7b7a7f70bfd5ad9a01c2994d2395 (diff) | |
download | minetest-b8c3221d556b94b9e14df450ecf8f3be20ba87db.tar.gz minetest-b8c3221d556b94b9e14df450ecf8f3be20ba87db.tar.bz2 minetest-b8c3221d556b94b9e14df450ecf8f3be20ba87db.zip |
Fix absence of images when compiled with RUN_IN_PLACE=0.
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 10 | ||||
-rw-r--r-- | src/script/lua_api/l_mainmenu.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index ba8a09747..abf2a8f81 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -704,6 +704,14 @@ int ModApiMainMenu::l_get_texturepath(lua_State *L) return 1; } +int ModApiMainMenu::l_get_texturepath_share(lua_State *L) +{ + std::string gamepath + = fs::RemoveRelativePathComponents(porting::path_share + DIR_DELIM + "textures"); + lua_pushstring(L, gamepath.c_str()); + return 1; +} + /******************************************************************************/ int ModApiMainMenu::l_get_dirlist(lua_State *L) { @@ -1032,6 +1040,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top) API_FCT(get_modpath); API_FCT(get_gamepath); API_FCT(get_texturepath); + API_FCT(get_texturepath_share); API_FCT(get_dirlist); API_FCT(create_dir); API_FCT(delete_dir); @@ -1059,6 +1068,7 @@ void ModApiMainMenu::InitializeAsync(AsyncEngine& engine) ASYNC_API_FCT(get_modpath); ASYNC_API_FCT(get_gamepath); ASYNC_API_FCT(get_texturepath); + ASYNC_API_FCT(get_texturepath_share); ASYNC_API_FCT(get_dirlist); ASYNC_API_FCT(create_dir); ASYNC_API_FCT(delete_dir); diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h index e185f0a37..db11ae794 100644 --- a/src/script/lua_api/l_mainmenu.h +++ b/src/script/lua_api/l_mainmenu.h @@ -111,6 +111,8 @@ private: static int l_get_texturepath(lua_State *L); + static int l_get_texturepath_share(lua_State *L); + static int l_get_dirlist(lua_State *L); static int l_create_dir(lua_State *L); |