|
From: Yoda-JM <yo...@us...> - 2011-02-24 10:33:47
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Thu Feb 24 11:08:16 2011 +0100
Imported part of opengl2 commit abe0b19d
---
game/fs.cc | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/game/fs.cc b/game/fs.cc
index 83f48d5..e34a784 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -120,13 +120,10 @@ std::string getThemePath(std::string const& filename) {
std::string theme = config["game/theme"].s();
static const std::string defaultTheme = "default";
if (theme.empty()) theme = defaultTheme;
- // Try current theme and if that fails, try default theme.
- try {
- return getPath(fs::path("themes") / theme / filename);
- } catch (std::runtime_error&) {
- if (theme == defaultTheme) throw;
- return getPath(fs::path("themes") / defaultTheme / filename);
- }
+ // Try current theme and if that fails, try default theme and finally data dir
+ try { return getPath(fs::path("themes") / theme / filename); } catch (std::runtime_error&) {}
+ if (theme == defaultTheme) try { return getPath(fs::path("themes") / defaultTheme / filename); } catch (std::runtime_error&) {}
+ return getPath(filename);
}
bool isThemeResource(fs::path filename){
|