diff options
| author | Roxie Linden <roxie@lindenlab.com> | 2010-02-24 18:28:19 -0800 |
|---|---|---|
| committer | Roxie Linden <roxie@lindenlab.com> | 2010-02-24 18:28:19 -0800 |
| commit | a9867b6437efd07ef9b18315d61155bd10860e13 (patch) | |
| tree | d059f1d6a6809acbedd5ba2ea72c4f88acee2b1b /indra/newview/llfloatervoicedevicesettings.cpp | |
| parent | 6bb43e1369d957a041c796120e87a89ff3fa10ee (diff) | |
| parent | 8a2404fa3341db0bd7a60459e008b8a3c6afad03 (diff) | |
Automated merge
Diffstat (limited to 'indra/newview/llfloatervoicedevicesettings.cpp')
| -rw-r--r-- | indra/newview/llfloatervoicedevicesettings.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp index 0e437fb9b3..63365e3461 100644 --- a/indra/newview/llfloatervoicedevicesettings.cpp +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -107,32 +107,33 @@ void LLPanelVoiceDeviceSettings::draw() LLPanel::draw(); - F32 voice_power = LLVoiceClient::getInstance()->tuningGetEnergy(); - S32 discrete_power = 0; - - if (!is_in_tuning_mode) - { - discrete_power = 0; - } - else - { - discrete_power = llmin(4, llfloor((voice_power / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 4.f)); - } - if (is_in_tuning_mode) { - for(S32 power_bar_idx = 0; power_bar_idx < 5; power_bar_idx++) + const S32 num_bars = 5; + F32 voice_power = LLVoiceClient::getInstance()->tuningGetEnergy() / LLVoiceClient::OVERDRIVEN_POWER_LEVEL; + S32 discrete_power = llmin(num_bars, llfloor(voice_power * (F32)num_bars + 0.1f)); + + for(S32 power_bar_idx = 0; power_bar_idx < num_bars; power_bar_idx++) { std::string view_name = llformat("%s%d", "bar", power_bar_idx); LLView* bar_view = getChild<LLView>(view_name); if (bar_view) { + gl_rect_2d(bar_view->getRect(), LLColor4::grey, TRUE); + + LLColor4 color; if (power_bar_idx < discrete_power) { - LLColor4 color = (power_bar_idx >= 3) ? LLUIColorTable::instance().getColor("OverdrivenColor") : LLUIColorTable::instance().getColor("SpeakingColor"); - gl_rect_2d(bar_view->getRect(), color, TRUE); + color = (power_bar_idx >= 3) ? LLUIColorTable::instance().getColor("OverdrivenColor") : LLUIColorTable::instance().getColor("SpeakingColor"); } - gl_rect_2d(bar_view->getRect(), LLColor4::grey, FALSE); + else + { + color = LLUIColorTable::instance().getColor("PanelFocusBackgroundColor"); + } + + LLRect color_rect = bar_view->getRect(); + color_rect.stretch(-1); + gl_rect_2d(color_rect, color, TRUE); } } } |
