Some minor optimizations to the mesh LOD panel

Fri, 01 Dec 2017 10:20:48 +0100

author
Ansariel
date
Fri, 01 Dec 2017 10:20:48 +0100
changeset 53519
0a92f07b5b2c
parent 53518
f61b653c81cc
child 53520
8ca179e02930

Some minor optimizations to the mesh LOD panel

indra/newview/llpanelobject.cpp file | annotate | diff | revisions
indra/newview/llpanelobject.h file | annotate | diff | revisions
indra/newview/skins/default/xui/de/floater_tools.xml file | annotate | diff | revisions
indra/newview/skins/default/xui/en/floater_tools.xml file | annotate | diff | revisions
indra/newview/skins/starlight/xui/en/floater_tools.xml file | annotate | diff | revisions
indra/newview/skins/starlightcui/xui/en/floater_tools.xml file | annotate | diff | revisions
indra/newview/skins/vintage/xui/en/floater_tools.xml file | annotate | diff | revisions
     1.1 --- a/indra/newview/llpanelobject.cpp	Thu Nov 30 23:02:50 2017 +0100
     1.2 +++ b/indra/newview/llpanelobject.cpp	Fri Dec 01 10:20:48 2017 +0100
     1.3 @@ -332,7 +332,7 @@
     1.4  	childSetCommitCallback("sculpt invert control", onCommitSculptType, this);
     1.5  	//<FS:Beq> FIRE-21445 + Mesh Info in object panel
     1.6  	mComboLOD = getChild<LLComboBox>("LOD_show_combo");
     1.7 -	childSetCommitCallback("LOD_show_combo", onCommitLOD, this);
     1.8 +	mComboLOD->setCommitCallback(boost::bind(&LLPanelObject::onCommitLOD, this));
     1.9  	//</FS:Beq>
    1.10  	// Start with everyone disabled
    1.11  	clearCtrls();
    1.12 @@ -1541,7 +1541,6 @@
    1.13  	}
    1.14  
    1.15  	F32 radius;
    1.16 -//	F32 distance;
    1.17  
    1.18  	if (objectp->mDrawable->isState(LLDrawable::RIGGED))
    1.19  	{
    1.20 @@ -1565,47 +1564,37 @@
    1.21  	F32 dlow = llmin(radius / 0.06f, max_distance);
    1.22  	F32 dmid = llmin(radius / 0.24f, max_distance);
    1.23  
    1.24 -	childSetVisible("object_radius", TRUE);
    1.25 +	childSetVisible("object_radius", true);
    1.26  	LLTextBox* tb = getChild<LLTextBox>("object_radius_value");
    1.27 -	if (tb)
    1.28 -	{
    1.29 -		tb->setText(llformat("%.3f", radius));
    1.30 -		tb->setVisible(TRUE);
    1.31 -	}
    1.32 -	
    1.33 -	childSetVisible("LOD_swap_defaults_label", TRUE);
    1.34 -	childSetVisible("LOD_swap_usr_label", TRUE);
    1.35 -	childSetVisible("LOD_swap_factors_label", TRUE);
    1.36 -	childSetVisible("LOD_swap_label", TRUE);
    1.37 -	childSetVisible("LOD_swap_usr_label", TRUE);
    1.38 -	childSetVisible("LOD_swap_LOD_Change_label", TRUE);
    1.39 -	childSetVisible("LODSwapTableDscriptionsText", TRUE);
    1.40 -	childSetVisible("ObjectLODbehaviourLabel", TRUE);
    1.41 -	childSetVisible("LOD_swap_ll_default", TRUE);
    1.42 -	childSetVisible("LOD_swap_fs_default", TRUE);
    1.43 -	childSetVisible("LOD_swap_usr_current", TRUE);
    1.44 +	tb->setText(llformat("%.3f", radius));
    1.45 +	tb->setVisible(TRUE);
    1.46 +
    1.47 +	childSetVisible("LOD_swap_defaults_label", true);
    1.48 +	childSetVisible("LOD_swap_usr_label", true);
    1.49 +	childSetVisible("LOD_swap_factors_label", true);
    1.50 +	childSetVisible("LOD_swap_label", true);
    1.51 +	childSetVisible("LOD_swap_usr_label", true);
    1.52 +	childSetVisible("LOD_swap_LOD_Change_label", true);
    1.53 +	childSetVisible("LODSwapTableDscriptionsText", true);
    1.54 +	childSetVisible("ObjectLODbehaviourLabel", true);
    1.55  
    1.56  	// Setup the LL defaults
    1.57 -	factor = 1.125; // LL default for most people http://wiki.phoenixviewer.com/support:whirly_fizzle#lod_comparison
    1.58 +	factor = 1.125f; // LL default for most people http://wiki.phoenixviewer.com/support:whirly_fizzle#lod_comparison
    1.59  	args["FACTOR"] = llformat("%.3f", factor);
    1.60  	tb = getChild<LLTextBox>("LOD_swap_ll_default");
    1.61 -	if (tb)
    1.62 -	{
    1.63 -		tb->setToolTip(getString("ll_lod_tooltip_msg",args));
    1.64 -		tb->setVisible(TRUE);
    1.65 -	}
    1.66 +	tb->setToolTip(getString("ll_lod_tooltip_msg",args));
    1.67 +	tb->setVisible(TRUE);
    1.68 +
    1.69  	tb = getChild<LLTextBox>("LOD_swap_ll_values");
    1.70  	setLODDistValues(tb, factor, dmid, dlow, dlowest);
    1.71  
    1.72  	// now the FS defaults
    1.73 -	factor = 2.0;
    1.74 +	factor = 2.0f;
    1.75  	args["FACTOR"] = llformat("%.3f", factor);
    1.76  	tb = getChild<LLTextBox>("LOD_swap_fs_default");
    1.77 -	if (tb)
    1.78 -	{
    1.79 -		tb->setToolTip(getString("fs_lod_tooltip_msg", args));
    1.80 -		tb->setVisible(TRUE);
    1.81 -	}
    1.82 +	tb->setToolTip(getString("fs_lod_tooltip_msg", args));
    1.83 +	tb->setVisible(TRUE);
    1.84 +
    1.85  	tb = getChild<LLTextBox>("LOD_swap_fs_values");
    1.86  	setLODDistValues(tb, factor, dmid, dlow, dlowest);
    1.87  
    1.88 @@ -1613,11 +1602,9 @@
    1.89  	factor = LLVOVolume::sLODFactor;
    1.90  	args["FACTOR"] = llformat("%.3f", factor);
    1.91  	tb = getChild<LLTextBox>("LOD_swap_usr_current");
    1.92 -	if (tb)
    1.93 -	{
    1.94 -		tb->setText(getString("user_lod_label_string", args));// Note: here we are setting the label not the tooltip
    1.95 -		tb->setVisible(TRUE);
    1.96 -	}
    1.97 +	tb->setText(getString("user_lod_label_string", args));// Note: here we are setting the label not the tooltip
    1.98 +	tb->setVisible(TRUE);
    1.99 +
   1.100  	tb = getChild<LLTextBox>("LOD_swap_usr_values");
   1.101  	setLODDistValues(tb, factor, dmid, dlow, dlowest);
   1.102  }
   1.103 @@ -1662,22 +1649,22 @@
   1.104  		tb->setVisible(FALSE);
   1.105  	}
   1.106  	
   1.107 -	childSetVisible("ObjectLODbehaviourLabel", FALSE);
   1.108 -	childSetVisible("LOD_swap_defaults_label", FALSE);
   1.109 -	childSetVisible("LOD_swap_factors_label", FALSE);
   1.110 -	childSetVisible("LOD_swap_usr_label", FALSE);
   1.111 -	childSetVisible("LOD_swap_label", FALSE);
   1.112 -	childSetVisible("LOD_swap_usr_label", FALSE);
   1.113 -	childSetVisible("LOD_swap_H2M_label", FALSE);
   1.114 -	childSetVisible("LOD_swap_M2L_label", FALSE);
   1.115 -	childSetVisible("LOD_swap_L2I_label", FALSE);
   1.116 -	childSetVisible("LODSwapTableDscriptionsText", FALSE);
   1.117 -	childSetVisible("LOD_swap_ll_default", FALSE);
   1.118 -	childSetVisible("LOD_swap_fs_default", FALSE);
   1.119 -	childSetVisible("LOD_swap_usr_current", FALSE);
   1.120 -	childSetVisible("LOD_swap_ll_values", FALSE);
   1.121 -	childSetVisible("LOD_swap_fs_values", FALSE);
   1.122 -	childSetVisible("LOD_swap_usr_values", FALSE);
   1.123 +	childSetVisible("ObjectLODbehaviourLabel", false);
   1.124 +	childSetVisible("LOD_swap_defaults_label", false);
   1.125 +	childSetVisible("LOD_swap_factors_label", false);
   1.126 +	childSetVisible("LOD_swap_usr_label", false);
   1.127 +	childSetVisible("LOD_swap_label", false);
   1.128 +	childSetVisible("LOD_swap_usr_label", false);
   1.129 +	childSetVisible("LOD_swap_H2M_label", false);
   1.130 +	childSetVisible("LOD_swap_M2L_label", false);
   1.131 +	childSetVisible("LOD_swap_L2I_label", false);
   1.132 +	childSetVisible("LODSwapTableDscriptionsText", false);
   1.133 +	childSetVisible("LOD_swap_ll_default", false);
   1.134 +	childSetVisible("LOD_swap_fs_default", false);
   1.135 +	childSetVisible("LOD_swap_usr_current", false);
   1.136 +	childSetVisible("LOD_swap_ll_values", false);
   1.137 +	childSetVisible("LOD_swap_fs_values", false);
   1.138 +	childSetVisible("LOD_swap_usr_values", false);
   1.139  }
   1.140  //</FS:Beq>
   1.141  
   1.142 @@ -1738,18 +1725,15 @@
   1.143  }
   1.144  
   1.145  //<FS:Beq> FIRE-21445 + Mesh Info in object panel
   1.146 -// static
   1.147 -void LLPanelObject::onCommitLOD(LLUICtrl* ctrl, void* userdata)
   1.148 +void LLPanelObject::onCommitLOD()
   1.149  {
   1.150 -	LLPanelObject* self = (LLPanelObject*)userdata;
   1.151 -
   1.152 -	if (self->mObject.isNull())
   1.153 +	if (mObject.isNull())
   1.154  	{
   1.155  		return;
   1.156  	}
   1.157  	// We use the setting to pass down the override because overriding at this point get reset by other code in the render pipeline.
   1.158  	// the actual forceLOD call is made in llviewerwindow.cpp
   1.159 -	gSavedSettings.setS32("ShowSpecificLODInEdit", self->mComboLOD->getValue());
   1.160 +	gSavedSettings.setS32("ShowSpecificLODInEdit", mComboLOD->getValue());
   1.161  }
   1.162  //</FS:Beq>
   1.163  
   1.164 @@ -2342,21 +2326,23 @@
   1.165  		new_pos_global = regionp->getPosGlobalFromRegion(newpos);
   1.166  	}
   1.167  
   1.168 -	// ## Zi: Building spin controls for attachments
   1.169 +	// <FS:Zi> Building spin controls for attachments
   1.170  	// partly copied from llmaniptranslate.cpp to get the positioning right
   1.171  	if (mObject->isAttachment())
   1.172  	{
   1.173 -		LLVector3 old_position_local=mObject->getPosition();
   1.174 -
   1.175 -		if(mRootObject!=mObject)
   1.176 +		LLVector3 old_position_local = mObject->getPosition();
   1.177 +
   1.178 +		if (mRootObject != mObject)
   1.179  		{
   1.180 -			newpos=newpos-mRootObject->getPosition();
   1.181 -			newpos=newpos*~mRootObject->getRotation();
   1.182 +			newpos = newpos - mRootObject->getPosition();
   1.183 +			newpos = newpos * ~mRootObject->getRotation();
   1.184  			mObject->setPositionParent(newpos);
   1.185  		}
   1.186  		else
   1.187 +		{
   1.188  			mObject->setPosition(newpos);
   1.189 -		LLManip::rebuild(mObject) ;
   1.190 +		}
   1.191 +		LLManip::rebuild(mObject);
   1.192  
   1.193  		gAgentAvatarp->clampAttachmentPositions();
   1.194  
   1.195 @@ -2366,17 +2352,17 @@
   1.196  		if (mObject->isRootEdit())
   1.197  		{
   1.198  			// counter-translate child objects if we are moving the root as an individual
   1.199 -			mObject->resetChildrenPosition(old_position_local-new_position_local,TRUE);
   1.200 +			mObject->resetChildrenPosition(old_position_local - new_position_local, TRUE);
   1.201  		}
   1.202  
   1.203 -		if(!btn_down)
   1.204 +		if (!btn_down)
   1.205  		{
   1.206  			LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION);
   1.207  		}
   1.208  
   1.209  		LLSelectMgr::getInstance()->updateSelectionCenter();
   1.210  	}
   1.211 -	// ## Zi: Building spin controls for attachments
   1.212 +	// </FS:Zi> Building spin controls for attachments
   1.213  	else if (LLWorld::getInstance()->positionRegionValidGlobal(new_pos_global) )
   1.214  	{
   1.215  		// send only if the position is changed, that is, the delta vector is not zero
     2.1 --- a/indra/newview/llpanelobject.h	Thu Nov 30 23:02:50 2017 +0100
     2.2 +++ b/indra/newview/llpanelobject.h	Fri Dec 01 10:20:48 2017 +0100
     2.3 @@ -68,7 +68,7 @@
     2.4  	static void 	onCommitPhantom(		LLUICtrl* ctrl, void* userdata);
     2.5  	static void 	onCommitPhysics(		LLUICtrl* ctrl, void* userdata);
     2.6  	//<FS:Beq> FIRE-21445 - Display specific LOD
     2.7 -	static void		onCommitLOD(			LLUICtrl* ctrl, void* userdata);
     2.8 +	void			onCommitLOD();
     2.9  	//</FS:Beq>
    2.10  	void 	onCopyPos(				const LLSD& data);
    2.11  	void 	onPastePos(				const LLSD& data);
     3.1 --- a/indra/newview/skins/default/xui/de/floater_tools.xml	Thu Nov 30 23:02:50 2017 +0100
     3.2 +++ b/indra/newview/skins/default/xui/de/floater_tools.xml	Fri Dec 01 10:20:48 2017 +0100
     3.3 @@ -418,7 +418,7 @@
     3.4  			<text name="mesh_info_label">
     3.5  				Mesh-Information:
     3.6  			</text>
     3.7 -			<text name="lod_label" value="LOD:"/>
     3.8 +			<text name="lod_label" value="LOD"/>
     3.9  			<text name="lod_num_tris" value="Anz. Dreiecke"/>
    3.10  			<text name="mesh_lod_label">
    3.11  				Hoch:
     4.1 --- a/indra/newview/skins/default/xui/en/floater_tools.xml	Thu Nov 30 23:02:50 2017 +0100
     4.2 +++ b/indra/newview/skins/default/xui/en/floater_tools.xml	Fri Dec 01 10:20:48 2017 +0100
     4.3 @@ -2557,7 +2557,7 @@
     4.4            left="125"
     4.5            name="object_radius"
     4.6            top_delta="0"
     4.7 -          value="Object radius : "
     4.8 +          value="Object radius:"
     4.9            visible="false"
    4.10            width="80" />
    4.11          <text
     5.1 --- a/indra/newview/skins/starlight/xui/en/floater_tools.xml	Thu Nov 30 23:02:50 2017 +0100
     5.2 +++ b/indra/newview/skins/starlight/xui/en/floater_tools.xml	Fri Dec 01 10:20:48 2017 +0100
     5.3 @@ -2615,7 +2615,7 @@
     5.4            left="125"
     5.5            name="object_radius"
     5.6            top_delta="0"
     5.7 -          value="Object radius : "
     5.8 +          value="Object radius:"
     5.9            visible="false"
    5.10            width="80" />
    5.11          <text
     6.1 --- a/indra/newview/skins/starlightcui/xui/en/floater_tools.xml	Thu Nov 30 23:02:50 2017 +0100
     6.2 +++ b/indra/newview/skins/starlightcui/xui/en/floater_tools.xml	Fri Dec 01 10:20:48 2017 +0100
     6.3 @@ -2615,7 +2615,7 @@
     6.4            left="125"
     6.5            name="object_radius"
     6.6            top_delta="0"
     6.7 -          value="Object radius : "
     6.8 +          value="Object radius:"
     6.9            visible="false"
    6.10            width="80" />
    6.11          <text
     7.1 --- a/indra/newview/skins/vintage/xui/en/floater_tools.xml	Thu Nov 30 23:02:50 2017 +0100
     7.2 +++ b/indra/newview/skins/vintage/xui/en/floater_tools.xml	Fri Dec 01 10:20:48 2017 +0100
     7.3 @@ -2549,7 +2549,7 @@
     7.4            left="125"
     7.5            name="object_radius"
     7.6            top_delta="0"
     7.7 -          value="Object radius : "
     7.8 +          value="Object radius:"
     7.9            visible="false"
    7.10            width="80" />
    7.11          <text

mercurial