From a9520ba18fcecf2b0acd74968896ce3dd33308bb Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 27 Jan 2012 16:51:34 -0800 Subject: PATH-187 : Renaming the walkability parameters to be more descriptive. --- indra/newview/llfloaterpathfindinglinksets.cpp | 16 +-- indra/newview/llpathfindinglinksets.cpp | 136 ++++++++++++------------- indra/newview/llpathfindinglinksets.h | 24 ++--- 3 files changed, 88 insertions(+), 88 deletions(-) diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 6c4d958f14..ed3b06e6de 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -778,19 +778,19 @@ void LLFloaterPathfindingLinksets::updateLinksetsList() columns[5]["font"] = "SANSSERIF"; columns[6]["column"] = "a_percent"; - columns[6]["value"] = llformat("%3d", linkset.getA()); + columns[6]["value"] = llformat("%3d", linkset.getWalkabilityCoefficientA()); columns[6]["font"] = "SANSSERIF"; columns[7]["column"] = "b_percent"; - columns[7]["value"] = llformat("%3d", linkset.getB()); + columns[7]["value"] = llformat("%3d", linkset.getWalkabilityCoefficientB()); columns[7]["font"] = "SANSSERIF"; columns[8]["column"] = "c_percent"; - columns[8]["value"] = llformat("%3d", linkset.getC()); + columns[8]["value"] = llformat("%3d", linkset.getWalkabilityCoefficientC()); columns[8]["font"] = "SANSSERIF"; columns[9]["column"] = "d_percent"; - columns[9]["value"] = llformat("%3d", linkset.getD()); + columns[9]["value"] = llformat("%3d", linkset.getWalkabilityCoefficientD()); columns[9]["font"] = "SANSSERIF"; LLSD element; @@ -910,10 +910,10 @@ void LLFloaterPathfindingLinksets::updateEditFields() const LLPathfindingLinkset &linkset(linksetIter->second); setPathState(linkset.getPathState()); - mEditA->setValue(LLSD(linkset.getA())); - mEditB->setValue(LLSD(linkset.getB())); - mEditC->setValue(LLSD(linkset.getC())); - mEditD->setValue(LLSD(linkset.getD())); + mEditA->setValue(LLSD(linkset.getWalkabilityCoefficientA())); + mEditB->setValue(LLSD(linkset.getWalkabilityCoefficientB())); + mEditC->setValue(LLSD(linkset.getWalkabilityCoefficientC())); + mEditD->setValue(LLSD(linkset.getWalkabilityCoefficientD())); mEditPhantom->set(linkset.isPhantom()); setEnableEditFields(true); diff --git a/indra/newview/llpathfindinglinksets.cpp b/indra/newview/llpathfindinglinksets.cpp index bc898e8eb7..0d9abb289f 100644 --- a/indra/newview/llpathfindinglinksets.cpp +++ b/indra/newview/llpathfindinglinksets.cpp @@ -49,10 +49,10 @@ LLPathfindingLinkset::LLPathfindingLinkset(const std::string &pUUID, const LLSD& #ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE mIsWalkabilityCoefficientsF32(false), #endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mA(MIN_WALKABILITY_VALUE), - mB(MIN_WALKABILITY_VALUE), - mC(MIN_WALKABILITY_VALUE), - mD(MIN_WALKABILITY_VALUE) + mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE), + mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE), + mWalkabilityCoefficientC(MIN_WALKABILITY_VALUE), + mWalkabilityCoefficientD(MIN_WALKABILITY_VALUE) { llassert(pNavMeshItem.has("name")); llassert(pNavMeshItem.get("name").isString()); @@ -87,69 +87,69 @@ LLPathfindingLinkset::LLPathfindingLinkset(const std::string &pUUID, const LLSD& if (mIsWalkabilityCoefficientsF32) { // Old server-side storage was real - mA = llround(pNavMeshItem.get("A").asReal() * 100.0f); + mWalkabilityCoefficientA = llround(pNavMeshItem.get("A").asReal() * 100.0f); llassert(pNavMeshItem.has("B")); llassert(pNavMeshItem.get("B").isReal()); - mB = llround(pNavMeshItem.get("B").asReal() * 100.0f); + mWalkabilityCoefficientB = llround(pNavMeshItem.get("B").asReal() * 100.0f); llassert(pNavMeshItem.has("C")); llassert(pNavMeshItem.get("C").isReal()); - mC = llround(pNavMeshItem.get("C").asReal() * 100.0f); + mWalkabilityCoefficientC = llround(pNavMeshItem.get("C").asReal() * 100.0f); llassert(pNavMeshItem.has("D")); llassert(pNavMeshItem.get("D").isReal()); - mD = llround(pNavMeshItem.get("D").asReal() * 100.0f); + mWalkabilityCoefficientD = llround(pNavMeshItem.get("D").asReal() * 100.0f); } else { // New server-side storage will be integer llassert(pNavMeshItem.get("A").isInteger()); - mA = pNavMeshItem.get("A").asInteger(); - llassert(mA >= MIN_WALKABILITY_VALUE); - llassert(mA <= MAX_WALKABILITY_VALUE); + mWalkabilityCoefficientA = pNavMeshItem.get("A").asInteger(); + llassert(mWalkabilityCoefficientA >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientA <= MAX_WALKABILITY_VALUE); llassert(pNavMeshItem.has("B")); llassert(pNavMeshItem.get("B").isInteger()); - mB = pNavMeshItem.get("B").asInteger(); - llassert(mB >= MIN_WALKABILITY_VALUE); - llassert(mB <= MAX_WALKABILITY_VALUE); + mWalkabilityCoefficientB = pNavMeshItem.get("B").asInteger(); + llassert(mWalkabilityCoefficientB >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientB <= MAX_WALKABILITY_VALUE); llassert(pNavMeshItem.has("C")); llassert(pNavMeshItem.get("C").isInteger()); - mC = pNavMeshItem.get("C").asInteger(); - llassert(mC >= MIN_WALKABILITY_VALUE); - llassert(mC <= MAX_WALKABILITY_VALUE); + mWalkabilityCoefficientC = pNavMeshItem.get("C").asInteger(); + llassert(mWalkabilityCoefficientC >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientC <= MAX_WALKABILITY_VALUE); llassert(pNavMeshItem.has("D")); llassert(pNavMeshItem.get("D").isInteger()); - mD = pNavMeshItem.get("D").asInteger(); - llassert(mD >= MIN_WALKABILITY_VALUE); - llassert(mD <= MAX_WALKABILITY_VALUE); + mWalkabilityCoefficientD = pNavMeshItem.get("D").asInteger(); + llassert(mWalkabilityCoefficientD >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientD <= MAX_WALKABILITY_VALUE); } #else // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE llassert(pNavMeshItem.get("A").isInteger()); - mA = pNavMeshItem.get("A").asInteger(); - llassert(mA >= MIN_WALKABILITY_VALUE); - llassert(mA <= MAX_WALKABILITY_VALUE); + mWalkabilityCoefficientA = pNavMeshItem.get("A").asInteger(); + llassert(mWalkabilityCoefficientA >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientA <= MAX_WALKABILITY_VALUE); llassert(pNavMeshItem.has("B")); llassert(pNavMeshItem.get("B").isInteger()); - mB = pNavMeshItem.get("B").asInteger(); - llassert(mB >= MIN_WALKABILITY_VALUE); - llassert(mB <= MAX_WALKABILITY_VALUE); + mWalkabilityCoefficientB = pNavMeshItem.get("B").asInteger(); + llassert(mWalkabilityCoefficientB >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientB <= MAX_WALKABILITY_VALUE); llassert(pNavMeshItem.has("C")); llassert(pNavMeshItem.get("C").isInteger()); - mC = pNavMeshItem.get("C").asInteger(); - llassert(mC >= MIN_WALKABILITY_VALUE); - llassert(mC <= MAX_WALKABILITY_VALUE); + mWalkabilityCoefficientC = pNavMeshItem.get("C").asInteger(); + llassert(mWalkabilityCoefficientC >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientC <= MAX_WALKABILITY_VALUE); llassert(pNavMeshItem.has("D")); llassert(pNavMeshItem.get("D").isInteger()); - mD = pNavMeshItem.get("D").asInteger(); - llassert(mD >= MIN_WALKABILITY_VALUE); - llassert(mD <= MAX_WALKABILITY_VALUE); + mWalkabilityCoefficientD = pNavMeshItem.get("D").asInteger(); + llassert(mWalkabilityCoefficientD >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientD <= MAX_WALKABILITY_VALUE); #endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE llassert(pNavMeshItem.has("position")); @@ -168,10 +168,10 @@ LLPathfindingLinkset::LLPathfindingLinkset(const LLPathfindingLinkset& pOther) #ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE mIsWalkabilityCoefficientsF32(pOther.mIsWalkabilityCoefficientsF32), #endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mA(pOther.mA), - mB(pOther.mB), - mC(pOther.mC), - mD(pOther.mD) + mWalkabilityCoefficientA(pOther.mWalkabilityCoefficientA), + mWalkabilityCoefficientB(pOther.mWalkabilityCoefficientB), + mWalkabilityCoefficientC(pOther.mWalkabilityCoefficientC), + mWalkabilityCoefficientD(pOther.mWalkabilityCoefficientD) { } @@ -191,10 +191,10 @@ LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkse #ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE mIsWalkabilityCoefficientsF32 = pOther.mIsWalkabilityCoefficientsF32; #endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mA = pOther.mA; - mB = pOther.mB; - mC = pOther.mC; - mD = pOther.mD; + mWalkabilityCoefficientA = pOther.mWalkabilityCoefficientA; + mWalkabilityCoefficientB = pOther.mWalkabilityCoefficientB; + mWalkabilityCoefficientC = pOther.mWalkabilityCoefficientC; + mWalkabilityCoefficientD = pOther.mWalkabilityCoefficientD; return *this; } @@ -293,44 +293,44 @@ void LLPathfindingLinkset::setPhantom(BOOL pIsPhantom) mIsPhantom = pIsPhantom; } -S32 LLPathfindingLinkset::getA() const +S32 LLPathfindingLinkset::getWalkabilityCoefficientA() const { - return mA; + return mWalkabilityCoefficientA; } -void LLPathfindingLinkset::setA(S32 pA) +void LLPathfindingLinkset::setWalkabilityCoefficientA(S32 pA) { - mA = pA; + mWalkabilityCoefficientA = pA; } -S32 LLPathfindingLinkset::getB() const +S32 LLPathfindingLinkset::getWalkabilityCoefficientB() const { - return mB; + return mWalkabilityCoefficientB; } -void LLPathfindingLinkset::setB(S32 pB) +void LLPathfindingLinkset::setWalkabilityCoefficientB(S32 pB) { - mB = pB; + mWalkabilityCoefficientB = pB; } -S32 LLPathfindingLinkset::getC() const +S32 LLPathfindingLinkset::getWalkabilityCoefficientC() const { - return mC; + return mWalkabilityCoefficientC; } -void LLPathfindingLinkset::setC(S32 pC) +void LLPathfindingLinkset::setWalkabilityCoefficientC(S32 pC) { - mC = pC; + mWalkabilityCoefficientC = pC; } -S32 LLPathfindingLinkset::getD() const +S32 LLPathfindingLinkset::getWalkabilityCoefficientD() const { - return mD; + return mWalkabilityCoefficientD; } -void LLPathfindingLinkset::setD(S32 pD) +void LLPathfindingLinkset::setWalkabilityCoefficientD(S32 pD) { - mD = pD; + mWalkabilityCoefficientD = pD; } LLSD LLPathfindingLinkset::getAlteredFields(EPathState pPathState, S32 pA, S32 pB, S32 pC, S32 pD, BOOL pIsPhantom) const @@ -345,56 +345,56 @@ LLSD LLPathfindingLinkset::getAlteredFields(EPathState pPathState, S32 pA, S32 p #ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE if (mIsWalkabilityCoefficientsF32) { - if (mA != pA) + if (mWalkabilityCoefficientA != pA) { itemData["A"] = llclamp(static_cast(pA) / 100.0f, 0.0f, 1.0f); } - if (mB != pB) + if (mWalkabilityCoefficientB != pB) { itemData["B"] = llclamp(static_cast(pB) / 100.0f, 0.0f, 1.0f); } - if (mC != pC) + if (mWalkabilityCoefficientC != pC) { itemData["C"] = llclamp(static_cast(pC) / 100.0f, 0.0f, 1.0f); } - if (mD != pD) + if (mWalkabilityCoefficientD != pD) { itemData["D"] = llclamp(static_cast(pD) / 100.0f, 0.0f, 1.0f); } } else { - if (mA != pA) + if (mWalkabilityCoefficientA != pA) { itemData["A"] = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); } - if (mB != pB) + if (mWalkabilityCoefficientB != pB) { itemData["B"] = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); } - if (mC != pC) + if (mWalkabilityCoefficientC != pC) { itemData["C"] = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); } - if (mD != pD) + if (mWalkabilityCoefficientD != pD) { itemData["D"] = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); } } #else // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - if (mA != pA) + if (mWalkabilityCoefficientA != pA) { itemData["A"] = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); } - if (mB != pB) + if (mWalkabilityCoefficientB != pB) { itemData["B"] = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); } - if (mC != pC) + if (mWalkabilityCoefficientC != pC) { itemData["C"] = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); } - if (mD != pD) + if (mWalkabilityCoefficientD != pD) { itemData["D"] = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); } diff --git a/indra/newview/llpathfindinglinksets.h b/indra/newview/llpathfindinglinksets.h index be909677b6..42f19b5872 100644 --- a/indra/newview/llpathfindinglinksets.h +++ b/indra/newview/llpathfindinglinksets.h @@ -67,17 +67,17 @@ public: BOOL isPhantom() const; void setPhantom(BOOL pIsPhantom); - S32 getA() const; - void setA(S32 pA); + S32 getWalkabilityCoefficientA() const; + void setWalkabilityCoefficientA(S32 pA); - S32 getB() const; - void setB(S32 pB); + S32 getWalkabilityCoefficientB() const; + void setWalkabilityCoefficientB(S32 pB); - S32 getC() const; - void setC(S32 pC); + S32 getWalkabilityCoefficientC() const; + void setWalkabilityCoefficientC(S32 pC); - S32 getD() const; - void setD(S32 pD); + S32 getWalkabilityCoefficientD() const; + void setWalkabilityCoefficientD(S32 pD); LLSD getAlteredFields(EPathState pPathState, S32 pA, S32 pB, S32 pC, S32 pD, BOOL pIsPhantom) const; @@ -97,10 +97,10 @@ private: #ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE BOOL mIsWalkabilityCoefficientsF32; #endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - S32 mA; - S32 mB; - S32 mC; - S32 mD; + S32 mWalkabilityCoefficientA; + S32 mWalkabilityCoefficientB; + S32 mWalkabilityCoefficientC; + S32 mWalkabilityCoefficientD; }; #endif // LL_LLFLOATERPATHFINDINGLINKSETS_H -- cgit v1.2.3