diff options
| author | Todd Stinson <stinson@lindenlab.com> | 2012-01-31 16:30:16 -0800 | 
|---|---|---|
| committer | Todd Stinson <stinson@lindenlab.com> | 2012-01-31 16:30:16 -0800 | 
| commit | a376d6314d0ce2a15858d2890534a8a010f0c5eb (patch) | |
| tree | 2152a306843ea97d49d02d252492454f0f9f48a3 /indra | |
| parent | 9e1479d610af1edd799a790ff18155fbb6ec5c89 (diff) | |
PATH-243: Refactoring the implementation for the render mode buttons on the console.  Removing the warning messages for methods that now have implementations.
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 65 | ||||
| -rw-r--r-- | indra/newview/llfloaterpathfindingconsole.h | 6 | ||||
| -rw-r--r-- | indra/newview/llviewerdisplay.cpp | 28 | 
3 files changed, 53 insertions, 46 deletions
| diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 6c5e1f1f4b..a39869eddd 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -445,7 +445,7 @@ void LLFloaterPathfindingConsole::onShowExcludeVolumesToggle()  	LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();  	if (llPathingLibInstance != NULL)  	{ -		llPathingLibInstance->setRenderNavMeshandShapes(checkBoxValue); +		llPathingLibInstance->setRenderShapes(checkBoxValue);  	}  	else  	{ @@ -458,15 +458,33 @@ void LLFloaterPathfindingConsole::onShowPathToggle()  {  	BOOL checkBoxValue = mShowPathCheckBox->get(); -	llwarns << "functionality has not yet been implemented to toggle '" -		<< mShowPathCheckBox->getLabel() << "' to " -		<< (checkBoxValue ? "ON" : "OFF") << llendl; +	LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance(); +	if (llPathingLibInstance != NULL) +	{ +		llPathingLibInstance->setRenderPath(checkBoxValue); +	} +	else +	{ +		mShowPathCheckBox->set(FALSE); +		llwarns << "cannot find LLPathingLib instance" << llendl; +	}  }  void LLFloaterPathfindingConsole::onShowWaterPlaneToggle()  {  	BOOL checkBoxValue = mShowWaterPlaneCheckBox->get(); +	LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance(); +	if (llPathingLibInstance != NULL) +	{ +		llPathingLibInstance->setRenderWaterPlane(checkBoxValue); +	} +	else +	{ +		mShowWaterPlaneCheckBox->set(FALSE); +		llwarns << "cannot find LLPathingLib instance" << llendl; +	} +  	llwarns << "functionality has not yet been implemented to toggle '"  		<< mShowWaterPlaneCheckBox->getLabel() << "' to "  		<< (checkBoxValue ? "ON" : "OFF") << llendl; @@ -474,21 +492,27 @@ void LLFloaterPathfindingConsole::onShowWaterPlaneToggle()  void LLFloaterPathfindingConsole::onRegionOverlayDisplaySwitch()  { -	switch (getRegionOverlayDisplay()) +	LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance(); +	if (llPathingLibInstance != NULL)  	{ -	case kRenderOverlayOnFixedPhysicsGeometry : -		llwarns << "functionality has not yet been implemented to toggle '" -			<< mRegionOverlayDisplayRadioGroup->getName() << "' to RenderOverlayOnFixedPhysicsGeometry" -			<< llendl; -		break; -	case kRenderOverlayOnAllRenderableGeometry : -		llwarns << "functionality has not yet been implemented to toggle '" -			<< mRegionOverlayDisplayRadioGroup->getName() << "' to RenderOverlayOnAllRenderableGeometry" -			<< llendl; -		break; -	default : -		llassert(0); -		break; +		switch (getRegionOverlayDisplay()) +		{ +		case kRenderOverlayOnFixedPhysicsGeometry : +			llPathingLibInstance->setRenderOverlayMode(false); +			break; +		case kRenderOverlayOnAllRenderableGeometry : +			llPathingLibInstance->setRenderOverlayMode(true); +			break; +		default : +			llPathingLibInstance->setRenderOverlayMode(false); +			llassert(0); +			break; +		} +	} +	else +	{ +		this->setRegionOverlayDisplay(kRenderOverlayOnFixedPhysicsGeometry); +		llwarns << "cannot find LLPathingLib instance" << llendl;  	}  } @@ -599,11 +623,6 @@ void LLFloaterPathfindingConsole::onTerrainMaterialDSet()  } -BOOL LLFloaterPathfindingConsole::allowAllRenderables() const -{ -	return getRegionOverlayDisplay() == kRenderOverlayOnAllRenderableGeometry ? true : false; -} -  void LLFloaterPathfindingConsole::providePathingData( const LLVector3& point1, const LLVector3& point2 )  {  	switch (getPathSelectionState()) diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index e3f58eca10..e97e4d0933 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -31,13 +31,13 @@  #include "llfloater.h"  #include "llnavmeshstation.h"  #include "LLPathingLib.h" -#include "llcheckboxctrl.h"  class LLSD;  class LLRadioGroup;  class LLSliderCtrl;  class LLLineEditor;  class LLTextBase; +class LLCheckBoxCtrl;  class LLFloaterPathfindingConsole  :	public LLFloater @@ -67,8 +67,6 @@ public:  	} ECharacterType;  	virtual BOOL postBuild(); -	//Accessor to determine whether renderables are allowed -	BOOL allowAllRenderables() const;  	//Populates a data packet that is forwarded onto the LLPathingSystem  	void providePathingData( const LLVector3& point1, const LLVector3& point2 ); @@ -96,8 +94,6 @@ public:      F32                   getTerrainMaterialD() const;      void                  setTerrainMaterialD(F32 pTerrainMaterial); -	BOOL				  getShowPathToggle() const {return mShowPathCheckBox->get(); } -  	void setHasNavMeshReceived();  	void setHasNoNavMesh(); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index e8029293fc..3e21334cd4 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -885,7 +885,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)  		LLAppViewer::instance()->pingMainloopTimeout("Display:RenderGeom");  		bool exclusiveDraw = false;  		BOOL allowRenderables = false; -		BOOL allowPathToBeDrawn = false;  		if (!(LLAppViewer::instance()->logoutRequestSent() && LLAppViewer::instance()->hasSavedFinalSnapshot())  				&& !gRestoreGL)  		{ @@ -899,38 +898,31 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)  			else  			{  				//Render any navmesh geometry	 -				if ( LLPathingLib::getInstance() )  +				LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance(); +				if ( llPathingLibInstance != NULL )   				{	  					//Determine if we can should overlay the navmesh ontop of the scenes typical renderables -					LLFloaterPathfindingConsole* pFloater = LLFloaterReg::getTypedInstance<LLFloaterPathfindingConsole>("pathfinding_console"); -					if ( pFloater && pFloater->allowAllRenderables() ) -					{ -						allowRenderables = true; -					} -					//Determine if we should also draw a user supplied path on top of the scene -					if ( pFloater && pFloater->getShowPathToggle() ) -					{ -						allowPathToBeDrawn = true; -					} +					allowRenderables = llPathingLibInstance->getRenderOverlayMode(); +  					//NavMesh -					if ( LLPathingLib::getInstance()->getRenderNavMeshState() ) +					if ( llPathingLibInstance->getRenderNavMeshState() )  					{  						glClearColor(0.0f, 0.0f, 0.0f, 0.5f);          												  						glEnable(GL_DEPTH_TEST);                          						gGL.setAmbientLightColor( LLColor4::white ); -						LLPathingLib::getInstance()->renderNavMesh( allowRenderables ); +						llPathingLibInstance->renderNavMesh();  						exclusiveDraw = true;  					}  					//physics/exclusion shapes -					if ( LLPathingLib::getInstance()->getRenderShapeState() ) +					if ( llPathingLibInstance->getRenderShapesState() )  					{						 -						LLPathingLib::getInstance()->renderNavMeshShapesVBO(); +						llPathingLibInstance->renderNavMeshShapesVBO();  						exclusiveDraw = true;  					}	  					//User designated path -					if ( allowPathToBeDrawn ) +					if ( llPathingLibInstance->getRenderPathState() )  					{ -						LLPathingLib::getInstance()->renderPath(); +						llPathingLibInstance->renderPath();  					}  				}			  			} | 
