|
From: Yoda-JM <yo...@us...> - 2009-11-10 21:41:53
|
Module: performous
Branch: master
Commit: d77f87225586462101ca8297b3cd9c536d73694c
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Nov 10 22:41:18 2009 +0100
Updated path search to primarly search inside performous data directory
---
game/configuration.cc | 8 ++++----
game/fs.cc | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/game/configuration.cc b/game/configuration.cc
index 522393d..b19444c 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -337,10 +337,10 @@ void readConfig() {
// Adding some default pathes
char const* env_data_dir = getenv("PERFORMOUS_DATA_DIR");
if (env_data_dir) {
- config["system/path_themes"].sl().push_back(std::string(env_data_dir) + "/themes/");
- config["system/path_songs"].sl().push_back(std::string(env_data_dir) + "/songs/");
- config["system/path_pictures"].sl().push_back(std::string(env_data_dir) + "/pictures/");
- config["system/path_backgrounds"].sl().push_back(std::string(env_data_dir) + "/backgrounds/");
+ config["system/path_themes"].sl().insert(config["system/path_themes"].sl().begin(), std::string(env_data_dir) + "/themes/");
+ config["system/path_songs"].sl().insert(config["system/path_songs"].sl().begin(), std::string(env_data_dir) + "/songs/");
+ config["system/path_pictures"].sl().insert(config["system/path_pictures"].sl().begin(), std::string(env_data_dir) + "/pictures/");
+ config["system/path_backgrounds"].sl().insert(config["system/path_backgrounds"].sl().begin(), std::string(env_data_dir) + "/backgrounds/");
}
}
diff --git a/game/fs.cc b/game/fs.cc
index c9a3039..499830f 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -37,7 +37,7 @@ std::string getThemePath(std::string const& filename) {
p /= theme;
if (fs::is_directory(p)) { theme = p.string(); break; }
}
- }
+ }
if (*theme.rbegin() == '/') theme.erase(theme.size() - 1); // Remove trailing slash
return theme + "/" + filename;
}
|