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})
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
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.
):
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),
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);
*/
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);
}