diff options
author | krzys-h <krzys_h@interia.pl> | 2014-10-27 21:15:14 +0100 |
---|---|---|
committer | krzys-h <krzys_h@interia.pl> | 2014-10-27 21:15:14 +0100 |
commit | d6e88a07b08585d6a6f151d34a07d8bca78711ea (patch) | |
tree | 1c3f385d0883ef3db787d91e6f11edd8323ebc03 /src/common/profile.cpp | |
parent | 990ecf729038baa995fd7d58d17aceecce343d4b (diff) | |
download | colobot-d6e88a07b08585d6a6f151d34a07d8bca78711ea.tar.gz colobot-d6e88a07b08585d6a6f151d34a07d8bca78711ea.tar.bz2 colobot-d6e88a07b08585d6a6f151d34a07d8bca78711ea.zip |
Support for %lvl% in TerrainInitTextures + cleanup
cleanup:
* Removed CProfile::SetUserPath (unused)
* Removed CProfile::GetUserBasedPath (unused)
* Removed CProfile::CopyFileToTemp (i have no idea why it even existed)
* Removed CopyFileListToTemp (it did the same as CopyFileToTemp but for multiple files, wasn't even fully implemented)
Diffstat (limited to 'src/common/profile.cpp')
-rw-r--r-- | src/common/profile.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/common/profile.cpp b/src/common/profile.cpp index 92fc1d6..75ab135 100644 --- a/src/common/profile.cpp +++ b/src/common/profile.cpp @@ -247,52 +247,3 @@ std::vector< std::string > CProfile::GetSection(std::string section, std::string return ret_list; } - -void CProfile::SetUserDir(std::string dir) -{ - m_userDirectory = dir; -} - - -std::string CProfile::GetUserBasedPath(std::string dir, std::string defaultDir) -{ - std::string path = dir; - boost::replace_all(path, "\\", "/"); - if (dir.find("/") == std::string::npos) - { - path = defaultDir + "/" + dir; - } - - if (m_userDirectory.length() > 0) - { - boost::replace_all(path, "%user%", m_userDirectory); - } - else - { - boost::replace_all(path, "%user%", defaultDir); - } - - return fs::path(path).make_preferred().string(); -} - - -bool CProfile::CopyFileToTemp(std::string filename) -{ - std::string src, dst; - std::string tmp_user_dir = m_userDirectory; - - src = GetUserBasedPath(filename, "textures"); - SetUserDir("temp"); - dst = GetUserBasedPath(filename, "textures"); - SetUserDir(tmp_user_dir); - - fs::create_directory(fs::path(dst).parent_path().make_preferred().string()); - fs::copy_file(src, dst, fs::copy_option::overwrite_if_exists); - if (fs::exists(dst)) - { - return true; - } - - return false; -} - |