Support custom textures installed as /textures/all/*.png

This commit is contained in:
Perttu Ahola 2012-04-07 10:43:06 +03:00
parent 578fc5bb44
commit 18d8e3acec
3 changed files with 14 additions and 0 deletions

@ -104,6 +104,7 @@ if(BUILD_CLIENT)
endif() endif()
if(RUN_IN_PLACE) if(RUN_IN_PLACE)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/mods/minetest/mods_here.txt" DESTINATION "${SHAREDIR}/mods/minetest") install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/mods/minetest/mods_here.txt" DESTINATION "${SHAREDIR}/mods/minetest")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/textures/all/textures_here.txt" DESTINATION "${SHAREDIR}/textures/all")
endif() endif()
install(FILES "README.txt" DESTINATION "${DOCDIR}") install(FILES "README.txt" DESTINATION "${DOCDIR}")

@ -131,6 +131,18 @@ std::string getTexturePath(const std::string &filename)
fullpath = getImagePath(testpath); fullpath = getImagePath(testpath);
} }
/*
Check from $user/textures/all
*/
if(fullpath == "")
{
std::string texture_path = porting::path_user + DIR_DELIM
+ "textures" + DIR_DELIM + "all";
std::string testpath = texture_path + DIR_DELIM + filename;
// Check all filename extensions. Returns "" if not found.
fullpath = getImagePath(testpath);
}
/* /*
Check from default data directory Check from default data directory
*/ */

@ -0,0 +1 @@
If you haven't modified the texture_path setting, you can copy textures of your texture packs into here. Folders are currently not supported.