1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix absence of images when compiled with RUN_IN_PLACE=0.

This commit is contained in:
Ilya Zhuravlev 2013-12-13 20:35:57 +04:00 committed by Perttu Ahola
parent 4d22977509
commit b8c3221d55
3 changed files with 14 additions and 3 deletions

View file

@ -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);

View file

@ -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);