aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-10 23:30:12 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:11:04 +0200
commitee8b6d34447acab3ffb318dc8c070df890c1b810 (patch)
tree1b7bb1741effe3b7c9dee6582a60a380edb24e55 /src
parent2115a766f6ef7eefc122d1c91a28fe94f664a11a (diff)
downloadminetest-ee8b6d34447acab3ffb318dc8c070df890c1b810.tar.gz
minetest-ee8b6d34447acab3ffb318dc8c070df890c1b810.tar.bz2
minetest-ee8b6d34447acab3ffb318dc8c070df890c1b810.zip
Move images to data/textures and fix some path stuff; hope that installation still works
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/porting.cpp5
-rw-r--r--src/porting.h5
-rw-r--r--src/server.cpp6
-rw-r--r--src/tile.cpp3
5 files changed, 13 insertions, 11 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7a45bf1d1..f75c182bd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -299,9 +299,8 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../minetest.conf.example" DESTINATION
if(BUILD_CLIENT)
install(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
- file(GLOB images "${CMAKE_CURRENT_SOURCE_DIR}/../data/*.png")
-
- install(FILES ${images} DESTINATION ${DATADIR})
+ file(GLOB images "${CMAKE_CURRENT_SOURCE_DIR}/../data/textures/*.png")
+ install(FILES ${images} DESTINATION ${DATADIR}/textures)
if(USE_GETTEXT)
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
diff --git a/src/porting.cpp b/src/porting.cpp
index f3a0ab074..00595b06c 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -125,6 +125,11 @@ void signal_handler_init(void)
std::string path_data = ".." DIR_DELIM "data";
std::string path_userdata = "..";
+std::string getDataPath(const char *subpath)
+{
+ return path_data + DIR_DELIM + subpath;
+}
+
void pathRemoveFile(char *path, char delim)
{
// Remove filename and path delimiter
diff --git a/src/porting.h b/src/porting.h
index 3f9486b63..4970a8478 100644
--- a/src/porting.h
+++ b/src/porting.h
@@ -73,10 +73,7 @@ extern std::string path_userdata;
Get full path of stuff in data directory.
Example: "stone.png" -> "../data/stone.png"
*/
-inline std::string getDataPath(const char *subpath)
-{
- return path_data + "/" + subpath;
-}
+std::string getDataPath(const char *subpath);
/*
Initialize path_data and path_userdata.
diff --git a/src/server.cpp b/src/server.cpp
index 330388727..e7cfc9afc 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -950,8 +950,8 @@ Server::Server(
):
m_env(new ServerMap(mapsavedir), this),
m_con(PROTOCOL_ID, 512, CONNECTION_TIMEOUT, this),
- m_authmanager(mapsavedir+"/auth.txt"),
- m_banmanager(mapsavedir+"/ipban.txt"),
+ m_authmanager(mapsavedir+DIR_DELIM+"auth.txt"),
+ m_banmanager(mapsavedir+DIR_DELIM+"ipban.txt"),
m_thread(this),
m_emergethread(this),
m_time_counter(0),
@@ -978,7 +978,7 @@ Server::Server(
m_env.getMap().addEventReceiver(this);
// If file exists, load environment metadata
- if(fs::PathExists(m_mapsavedir+"/env_meta.txt"))
+ if(fs::PathExists(m_mapsavedir+DIR_DELIM+"env_meta.txt"))
{
infostream<<"Server: Loading environment metadata"<<std::endl;
m_env.loadMeta(m_mapsavedir);
diff --git a/src/tile.cpp b/src/tile.cpp
index 366f2dfb7..f328ab766 100644
--- a/src/tile.cpp
+++ b/src/tile.cpp
@@ -130,7 +130,8 @@ std::string getTexturePath(const std::string &filename)
*/
if(fullpath == "")
{
- std::string testpath = porting::getDataPath(filename.c_str());
+ std::string rel_path = std::string("textures")+DIR_DELIM+filename;
+ std::string testpath = porting::path_data + DIR_DELIM + rel_path;
// Check all filename extensions. Returns "" if not found.
fullpath = getImagePath(testpath);
}