diff options
author | Richard Linden <none@none> | 2013-01-04 16:46:25 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2013-01-04 16:46:25 -0800 |
commit | 0d8f1077a62099915cb532dc354d0e450e3e6a79 (patch) | |
tree | f76f43d025304bc6aa65d3f91663cac67a6715cc /indra/newview/llfloaterjoystick.cpp | |
parent | 0d12d171cf20c63a45e7ad0989e65d05aabb86ea (diff) | |
parent | 7dbb8860373769dfca7d6c6588284866a1bf86a3 (diff) |
Automated merge with http://bitbucket.org/lindenlab/viewer-development
Diffstat (limited to 'indra/newview/llfloaterjoystick.cpp')
-rw-r--r-- | indra/newview/llfloaterjoystick.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index c37798c330..e2813a8272 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -33,6 +33,7 @@ #include "llerror.h" #include "llrect.h" #include "llstring.h" +#include "lltrace.h" // project includes #include "lluictrlfactory.h" @@ -41,6 +42,16 @@ #include "llviewerjoystick.h" #include "llcheckboxctrl.h" +static LLTrace::Measurement<> sJoystickAxes[6] = +{ + LLTrace::Measurement<>("Joystick axis 1"), + LLTrace::Measurement<>("Joystick axis 2"), + LLTrace::Measurement<>("Joystick axis 3"), + LLTrace::Measurement<>("Joystick axis 4"), + LLTrace::Measurement<>("Joystick axis 5"), + LLTrace::Measurement<>("Joystick axis 6") +}; + LLFloaterJoystick::LLFloaterJoystick(const LLSD& data) : LLFloater(data) { @@ -60,7 +71,7 @@ void LLFloaterJoystick::draw() for (U32 i = 0; i < 6; i++) { F32 value = joystick->getJoystickAxis(i); - mAxisStats[i]->addValue(value * gFrameIntervalSeconds); + sJoystickAxes[i].sample(value * gFrameIntervalSeconds.value()); if (mAxisStatsBar[i]) { F32 minbar, maxbar; @@ -83,12 +94,12 @@ BOOL LLFloaterJoystick::postBuild() for (U32 i = 0; i < 6; i++) { - mAxisStats[i] = new LLStat(4); + std::string stat_name(llformat("Joystick axis %d", i)); std::string axisname = llformat("axis%d", i); mAxisStatsBar[i] = getChild<LLStatBar>(axisname); if (mAxisStatsBar[i]) { - mAxisStatsBar[i]->setStat(mAxisStats[i]); + mAxisStatsBar[i]->setStat(stat_name); mAxisStatsBar[i]->setRange(-range, range, range * 0.25f, range * 0.5f); } } |