summaryrefslogtreecommitdiff
path: root/indra/newview/llenvmanager.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2016-12-20 09:33:40 -0500
committerNat Goodspeed <nat@lindenlab.com>2016-12-20 09:33:40 -0500
commit42b8895c54a1ab9aa019d4e60b5cf432506aff44 (patch)
tree784121134b5e3f7e0879d566afa35a63547278e1 /indra/newview/llenvmanager.cpp
parentc992a6df9f5c8751c6f4811009e3b1ada09f208e (diff)
DRTVWR-418: Untangle LLWLParamKey, LLWLAnimator circularity.
LLWLAnimator stores a std::map<F32, LLWLParamKey>. But llwlanimator.h only forward-declared LLWLParamKey, begging the question of how this ever compiled on any previous platform. LLWLParamKey was declared for real in llwlparammanager.h, so the obvious fix is to #include "llwlparammanager.h" in llwlanimator.h. Unfortunately this doesn't work because llwlparammanager.h already #includes "llwlanimator.h". As the dependency is specifically on LLWLParamKey, which isa LLEnvKey, which is declared in llenvmanager.h, move LLWLParamKey to llenvmanager.h. Then we can #include "llenvmanager.h" in llwlanimator.h instead of merely forward- declaring LLWLParamKey. This migration compiles LLWLParamKey in a context in which LLTrans isn't visible. It's not really clear why all LLWLParamKey's methods are inline, but toString() -- the method that requires LLTrans -- isn't going to be fast in any case. Break toString() out to llenvmanager.cpp, and #include "lltrans.h" there.
Diffstat (limited to 'indra/newview/llenvmanager.cpp')
-rw-r--r--indra/newview/llenvmanager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index a626ad1bff..4cbeba083b 100644
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -35,6 +35,22 @@
#include "llwaterparammanager.h"
#include "llwlhandlers.h"
#include "llwlparammanager.h"
+#include "lltrans.h"
+
+std::string LLWLParamKey::toString() const
+{
+ switch (scope)
+ {
+ case SCOPE_LOCAL:
+ return name + std::string(" (") + LLTrans::getString("Local") + std::string(")");
+ break;
+ case SCOPE_REGION:
+ return name + std::string(" (") + LLTrans::getString("Region") + std::string(")");
+ break;
+ default:
+ return name + " (?)";
+ }
+}
std::string LLEnvPrefs::getWaterPresetName() const
{