aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-04-07 10:43:06 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-04-07 10:43:06 +0300
commit18d8e3acec44a60a0ee1bbf0b515654fa2102ee9 (patch)
treec6c1a226144eb15fc33f467e4237bad995923b98
parent578fc5bb4418b0746fea373f382f5921058382c4 (diff)
downloadminetest-18d8e3acec44a60a0ee1bbf0b515654fa2102ee9.tar.gz
minetest-18d8e3acec44a60a0ee1bbf0b515654fa2102ee9.tar.bz2
minetest-18d8e3acec44a60a0ee1bbf0b515654fa2102ee9.zip
Support custom textures installed as /textures/all/*.png
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/tile.cpp12
-rw-r--r--textures/all/textures_here.txt1
3 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29882500c..027a710b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,6 +104,7 @@ if(BUILD_CLIENT)
endif()
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}/textures/all/textures_here.txt" DESTINATION "${SHAREDIR}/textures/all")
endif()
install(FILES "README.txt" DESTINATION "${DOCDIR}")
diff --git a/src/tile.cpp b/src/tile.cpp
index 25f8a000b..73c286fb3 100644
--- a/src/tile.cpp
+++ b/src/tile.cpp
@@ -132,6 +132,18 @@ std::string getTexturePath(const std::string &filename)
}
/*
+ 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
*/
if(fullpath == "")
diff --git a/textures/all/textures_here.txt b/textures/all/textures_here.txt
new file mode 100644
index 000000000..37940850a
--- /dev/null
+++ b/textures/all/textures_here.txt
@@ -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.