|
From: Tapio V. <aa...@us...> - 2010-07-15 17:37:45
|
Module: performous
Branch: master
Commit: 05b38b758eaea4623c2d201b627d6b9076b1d6eb
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Jul 14 20:04:58 2010 +0200
Appended theme name to cache directory
---
game/fs.cc | 3 +--
game/surface.cc | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/game/fs.cc b/game/fs.cc
index d356d8b..b52539b 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -86,10 +86,9 @@ fs::path getCacheDir() {
return getConfigDir() / "cache"; // APPDATA/performous
#else
fs::path shortDir = "performous";
- fs::path shareDir = SHARED_DATA_DIR;
char const* xdg_cache_home = getenv("XDG_CACHE_HOME");
// FIXME: Should this use "games" or not?
- return (xdg_cache_home ? xdg_cache_home / shortDir : getHomeDir() / ".cache" / shareDir);
+ return (xdg_cache_home ? xdg_cache_home / shortDir : getHomeDir() / ".cache" / shortDir);
#endif
}
diff --git a/game/surface.cc b/game/surface.cc
index 47468ec..319e0e7 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -46,7 +46,7 @@ template <typename T> void loader(T& target, fs::path name) {
loadSVG(target, filename);
} else {
std::string cache_basename = name.filename() + ".cache_" + (boost::format("%.2f") % config["graphic/svg_lod"].f()).str() + ".png";
- fs::path cache_filename = getCacheDir() / cache_basename;
+ fs::path cache_filename = getCacheDir() / "themes" / (config["game/theme"].s().empty() ? "default" : config["game/theme"].s()) / cache_basename;
if(fs::exists(cache_filename)) {
if(fs::last_write_time(filename) > fs::last_write_time(cache_filename)) {
// SVG file is newer we should update cache
|