diff options
| author | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-01-15 18:56:25 +0200 | 
|---|---|---|
| committer | Ychebotarev ProductEngine <ychebotarev@productengine.com> | 2010-01-15 18:56:25 +0200 | 
| commit | 91e8b4bc64ef296893b6a72cc57a3ae8a5d49d03 (patch) | |
| tree | c7a5dfbcfa87ac6b6578a057e4e4746bdd58c555 /indra/newview/llfloatervoicedevicesettings.cpp | |
| parent | 17a72e5e51cae48c7cd6f7f3dda06c895dd482c8 (diff) | |
| parent | b21fca13e6bea9420f80a35163d25a33b929bbd1 (diff) | |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llfloatervoicedevicesettings.cpp')
| -rw-r--r-- | indra/newview/llfloatervoicedevicesettings.cpp | 38 | 
1 files changed, 21 insertions, 17 deletions
diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp index 43024a4bd0..638c9f1b8c 100644 --- a/indra/newview/llfloatervoicedevicesettings.cpp +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -110,32 +110,33 @@ void LLPanelVoiceDeviceSettings::draw()  	LLPanel::draw(); -	F32 voice_power = gVoiceClient->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 = gVoiceClient->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"); +				} +				else +				{ +					color = LLUIColorTable::instance().getColor("PanelFocusBackgroundColor");  				} -				gl_rect_2d(bar_view->getRect(), LLColor4::grey, FALSE); + +				LLRect color_rect = bar_view->getRect(); +				color_rect.stretch(-1); +				gl_rect_2d(color_rect, color, TRUE);  			}  		}  	} @@ -276,7 +277,10 @@ void LLPanelVoiceDeviceSettings::initialize()  void LLPanelVoiceDeviceSettings::cleanup()  { -	gVoiceClient->tuningStop(); +	if (gVoiceClient) +	{ +		gVoiceClient->tuningStop(); +	}  	LLVoiceChannel::resume();  }  | 
