|
From: Tapio V. <aa...@us...> - 2009-11-08 08:30:45
|
Module: performous
Branch: dance
Commit: 16cc19c81d94cb0db32ec8a4fef071b6e582d5ed
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Oct 30 17:29:00 2009 +0100
Added installation directory to background directory list
---
game/backgrounds.cc | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 14b4090..8450234 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -16,7 +16,13 @@
void Backgrounds::reload() {
if (m_loading) return;
// Copy backgrounddirs from config into m_bgdirs
- ConfigItem::StringList const& sd = config["system/path_backgrounds"].sl();
+ ConfigItem::StringList sd = config["system/path_backgrounds"].sl();
+ char const* env_data_dir = getenv("PERFORMOUS_DATA_DIR");
+ if (env_data_dir) {
+ std::string background_dir(env_data_dir);
+ background_dir.append("/backgrounds/");
+ sd.push_back(background_dir);
+ }
m_bgs.clear();
std::transform(sd.begin(), sd.end(), std::inserter(m_bgdirs, m_bgdirs.end()), pathMangle);
// Run loading thread
|