From 9480a98cffaafa5826b8daad20020cf399bbbefc Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 16 Feb 2024 00:07:58 +0100 Subject: [PATCH 1/7] Replace most of BOOL with bool in llmath --- indra/llcommon/llstring.cpp | 4 +- indra/llcommon/llstring.h | 2 +- indra/llmath/llcoordframe.h | 2 +- indra/llmath/llinterp.h | 53 ++++++++------- indra/llmath/llmath.h | 58 ++++++++-------- indra/llmath/lloctree.h | 10 +-- indra/llmath/llquaternion.cpp | 2 +- indra/llmath/llquaternion.h | 14 ++-- indra/llmath/llrect.h | 8 +-- indra/llmath/llvolume.cpp | 57 +++++----------- indra/llmath/llvolume.h | 17 ++--- indra/llmath/llvolumeoctree.cpp | 2 +- indra/llmath/raytrace.cpp | 113 +++++++++++++++----------------- indra/llmath/raytrace.h | 25 ++++--- indra/llmath/v2math.cpp | 14 ++-- indra/llmath/v2math.h | 16 ++--- indra/llmath/v3dmath.cpp | 36 +++++----- indra/llmath/v3dmath.h | 27 ++++---- indra/llmath/v3math.cpp | 60 ++++++++--------- indra/llmath/v3math.h | 24 +++---- indra/llmath/v4color.cpp | 20 +++--- indra/llmath/v4color.h | 6 +- indra/llmath/v4coloru.cpp | 12 ++-- indra/llmath/v4coloru.h | 3 +- indra/llmath/v4math.cpp | 40 +++-------- indra/llmath/v4math.h | 14 ++-- indra/llui/llfolderview.cpp | 6 +- 27 files changed, 290 insertions(+), 355 deletions(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index f6629803ee..4358e80125 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -308,10 +308,10 @@ S32 wstring_utf16_length(const LLWString &wstr, const S32 woffset, const S32 wle // Given a wstring and an offset in it, returns the length as wstring (i.e., // number of llwchars) of the longest substring that starts at the offset // and whose equivalent utf-16 string does not exceeds the given utf16_length. -S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, const S32 woffset, const S32 utf16_length, BOOL *unaligned) +S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, const S32 woffset, const S32 utf16_length, bool *unaligned) { const auto end = wstr.length(); - BOOL u = FALSE; + bool u = FALSE; S32 n = woffset + utf16_length; S32 i = woffset; while (i < end) diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 3620a5b211..47dbf967cf 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -687,7 +687,7 @@ LL_COMMON_API S32 utf16str_wstring_length(const llutf16string &utf16str, S32 len LL_COMMON_API S32 wstring_utf16_length(const LLWString & wstr, S32 woffset, S32 wlen); // Length in wstring (i.e., llwchar count) of a part of a wstring specified by utf16 length (i.e., utf16 units.) -LL_COMMON_API S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, S32 woffset, S32 utf16_length, BOOL *unaligned = NULL); +LL_COMMON_API S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, S32 woffset, S32 utf16_length, bool *unaligned = nullptr); /** * @brief Properly truncate a utf8 string to a maximum byte count. diff --git a/indra/llmath/llcoordframe.h b/indra/llmath/llcoordframe.h index 909adf260c..1d3f4f7e3e 100644 --- a/indra/llmath/llcoordframe.h +++ b/indra/llmath/llcoordframe.h @@ -61,7 +61,7 @@ public: //LLCoordFrame(const F32 *origin, const F32 *rotation); // Assumes "origin" is 1x3 and "rotation" is 1x9 array //LLCoordFrame(const F32 *origin_and_rotation); // Assumes "origin_and_rotation" is 1x12 array - BOOL isFinite() { return mOrigin.isFinite() && mXAxis.isFinite() && mYAxis.isFinite() && mZAxis.isFinite(); } + bool isFinite() { return mOrigin.isFinite() && mXAxis.isFinite() && mYAxis.isFinite() && mZAxis.isFinite(); } void reset(); void resetAxes(); diff --git a/indra/llmath/llinterp.h b/indra/llmath/llinterp.h index 5187646179..a107d301d8 100644 --- a/indra/llmath/llinterp.h +++ b/indra/llmath/llinterp.h @@ -41,7 +41,6 @@ class LLInterpVal { public: virtual ~LLInterpVal() {} - virtual void interp(LLInterpVal &target, const F32 frac); // Linear interpolation for each type }; template @@ -52,7 +51,7 @@ public: virtual ~LLInterp() {} virtual void start(); - void update(const F32 time); + virtual void update(const F32 time) = 0; const Type &getCurVal() const; void setStartVal(const Type &start_val); @@ -67,15 +66,15 @@ public: void setEndTime(const F32 time); F32 getEndTime() const; - BOOL isActive() const; - BOOL isDone() const; + bool isActive() const; + bool isDone() const; protected: F32 mStartTime; F32 mEndTime; F32 mDuration; - BOOL mActive; - BOOL mDone; + bool mActive; + bool mDone; Type mStartVal; Type mEndVal; @@ -88,8 +87,8 @@ template class LLInterpLinear : public LLInterp { public: - /*virtual*/ void start(); - void update(const F32 time); + void start() override; + void update(const F32 time) override; F32 getCurFrac() const; protected: F32 mCurFrac; @@ -108,10 +107,10 @@ class LLInterpAttractor : public LLInterp { public: LLInterpAttractor(); - /*virtual*/ void start(); + void start() override; void setStartVel(const Type &vel); void setForce(const F32 force); - void update(const F32 time); + void update(const F32 time) override; protected: F32 mForce; Type mStartVel; @@ -123,7 +122,7 @@ class LLInterpFunc : public LLInterp { public: LLInterpFunc(); - void update(const F32 time); + void update(const F32 time) override; void setFunc(Type (*)(const F32, void *data), void *data); protected: @@ -151,8 +150,8 @@ LLInterp::LLInterp() mEndTime = 1.f; mDuration = 1.f; mCurTime = 0.f; - mDone = FALSE; - mActive = FALSE; + mDone = false; + mActive = false; } template @@ -166,8 +165,8 @@ void LLInterp::start() { mCurVal = mStartVal; mCurTime = mStartTime; - mDone = FALSE; - mActive = FALSE; + mDone = false; + mActive = false; } template @@ -225,13 +224,13 @@ F32 LLInterp::getEndTime() const template -BOOL LLInterp::isDone() const +bool LLInterp::isDone() const { return mDone; } template -BOOL LLInterp::isActive() const +bool LLInterp::isActive() const { return mActive; } @@ -254,7 +253,7 @@ void LLInterpLinear::update(const F32 time) F32 dfrac = target_frac - this->mCurFrac; if (target_frac >= 0.f) { - this->mActive = TRUE; + this->mActive = true; } if (target_frac > 1.f) @@ -262,7 +261,7 @@ void LLInterpLinear::update(const F32 time) this->mCurVal = this->mEndVal; this->mCurFrac = 1.f; this->mCurTime = time; - this->mDone = TRUE; + this->mDone = true; return; } @@ -332,7 +331,7 @@ void LLInterpAttractor::update(const F32 time) { if (time > this->mStartTime) { - this->mActive = TRUE; + this->mActive = true; } else { @@ -340,7 +339,7 @@ void LLInterpAttractor::update(const F32 time) } if (time > this->mEndTime) { - this->mDone = TRUE; + this->mDone = true; return; } @@ -362,8 +361,8 @@ void LLInterpAttractor::update(const F32 time) template LLInterpFunc::LLInterpFunc() : LLInterp() { - mFunc = NULL; - mData = NULL; + mFunc = nullptr; + mData = nullptr; } template @@ -378,7 +377,7 @@ void LLInterpFunc::update(const F32 time) { if (time > this->mStartTime) { - this->mActive = TRUE; + this->mActive = true; } else { @@ -386,7 +385,7 @@ void LLInterpFunc::update(const F32 time) } if (time > this->mEndTime) { - this->mDone = TRUE; + this->mDone = true; return; } @@ -405,7 +404,7 @@ void LLInterpExp::update(const F32 time) F32 target_frac = (time - this->mStartTime) / this->mDuration; if (target_frac >= 0.f) { - this->mActive = TRUE; + this->mActive = true; } if (target_frac > 1.f) @@ -413,7 +412,7 @@ void LLInterpExp::update(const F32 time) this->mCurVal = this->mEndVal; this->mCurFrac = 1.f; this->mCurTime = time; - this->mDone = TRUE; + this->mDone = true; return; } diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index e4ccd81faf..efcc3882fc 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -59,34 +59,34 @@ #define tanf(x) ((F32)tan((F64)(x))) #endif*/ -const F32 GRAVITY = -9.8f; +constexpr F32 GRAVITY = -9.8f; // mathematical constants -const F32 F_PI = 3.1415926535897932384626433832795f; -const F32 F_TWO_PI = 6.283185307179586476925286766559f; -const F32 F_PI_BY_TWO = 1.5707963267948966192313216916398f; -const F32 F_SQRT_TWO_PI = 2.506628274631000502415765284811f; -const F32 F_E = 2.71828182845904523536f; -const F32 F_SQRT2 = 1.4142135623730950488016887242097f; -const F32 F_SQRT3 = 1.73205080756888288657986402541f; -const F32 OO_SQRT2 = 0.7071067811865475244008443621049f; -const F32 OO_SQRT3 = 0.577350269189625764509f; -const F32 DEG_TO_RAD = 0.017453292519943295769236907684886f; -const F32 RAD_TO_DEG = 57.295779513082320876798154814105f; -const F32 F_APPROXIMATELY_ZERO = 0.00001f; -const F32 F_LN10 = 2.3025850929940456840179914546844f; -const F32 OO_LN10 = 0.43429448190325182765112891891661; -const F32 F_LN2 = 0.69314718056f; -const F32 OO_LN2 = 1.4426950408889634073599246810019f; +constexpr F32 F_PI = 3.1415926535897932384626433832795f; +constexpr F32 F_TWO_PI = 6.283185307179586476925286766559f; +constexpr F32 F_PI_BY_TWO = 1.5707963267948966192313216916398f; +constexpr F32 F_SQRT_TWO_PI = 2.506628274631000502415765284811f; +constexpr F32 F_E = 2.71828182845904523536f; +constexpr F32 F_SQRT2 = 1.4142135623730950488016887242097f; +constexpr F32 F_SQRT3 = 1.73205080756888288657986402541f; +constexpr F32 OO_SQRT2 = 0.7071067811865475244008443621049f; +constexpr F32 OO_SQRT3 = 0.577350269189625764509f; +constexpr F32 DEG_TO_RAD = 0.017453292519943295769236907684886f; +constexpr F32 RAD_TO_DEG = 57.295779513082320876798154814105f; +constexpr F32 F_APPROXIMATELY_ZERO = 0.00001f; +constexpr F32 F_LN10 = 2.3025850929940456840179914546844f; +constexpr F32 OO_LN10 = 0.43429448190325182765112891891661; +constexpr F32 F_LN2 = 0.69314718056f; +constexpr F32 OO_LN2 = 1.4426950408889634073599246810019f; -const F32 F_ALMOST_ZERO = 0.0001f; -const F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO; +constexpr F32 F_ALMOST_ZERO = 0.0001f; +constexpr F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO; -const F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees +constexpr F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees // formula: GIMBAL_THRESHOLD = sin(DEG_TO_RAD * gimbal_threshold_angle); // BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above? -const F32 FP_MAG_THRESHOLD = 0.0000001f; +constexpr F32 FP_MAG_THRESHOLD = 0.0000001f; // TODO: Replace with logic like is_approx_equal inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f < F_APPROXIMATELY_ZERO); } @@ -123,13 +123,13 @@ inline bool is_zero(F32 x) inline bool is_approx_equal(F32 x, F32 y) { - const S32 COMPARE_MANTISSA_UP_TO_BIT = 0x02; + constexpr S32 COMPARE_MANTISSA_UP_TO_BIT = 0x02; return (std::abs((S32) ((U32&)x - (U32&)y) ) < COMPARE_MANTISSA_UP_TO_BIT); } inline bool is_approx_equal(F64 x, F64 y) { - const S64 COMPARE_MANTISSA_UP_TO_BIT = 0x02; + constexpr S64 COMPARE_MANTISSA_UP_TO_BIT = 0x02; return (std::abs((S32) ((U64&)x - (U64&)y) ) < COMPARE_MANTISSA_UP_TO_BIT); } @@ -272,8 +272,8 @@ inline F64 ll_round( F64 val, F64 nearest ) // peak error = -31.4 dB // RMS error = -28.1 dB -const F32 FAST_MAG_ALPHA = 0.960433870103f; -const F32 FAST_MAG_BETA = 0.397824734759f; +constexpr F32 FAST_MAG_ALPHA = 0.960433870103f; +constexpr F32 FAST_MAG_BETA = 0.397824734759f; // these provide minimum RMS error // @@ -281,8 +281,8 @@ const F32 FAST_MAG_BETA = 0.397824734759f; // peak error = -32.6 dB // RMS error = -25.7 dB // -//const F32 FAST_MAG_ALPHA = 0.948059448969f; -//const F32 FAST_MAG_BETA = 0.392699081699f; +//constexpr F32 FAST_MAG_ALPHA = 0.948059448969f; +//constexpr F32 FAST_MAG_BETA = 0.392699081699f; inline F32 fastMagnitude(F32 a, F32 b) { @@ -299,8 +299,8 @@ inline F32 fastMagnitude(F32 a, F32 b) // // Culled from www.stereopsis.com/FPU.html -const F64 LL_DOUBLE_TO_FIX_MAGIC = 68719476736.0*1.5; //2^36 * 1.5, (52-_shiftamt=36) uses limited precisicion to floor -const S32 LL_SHIFT_AMOUNT = 16; //16.16 fixed point representation, +constexpr F64 LL_DOUBLE_TO_FIX_MAGIC = 68719476736.0*1.5; //2^36 * 1.5, (52-_shiftamt=36) uses limited precisicion to floor +constexpr S32 LL_SHIFT_AMOUNT = 16; //16.16 fixed point representation, // Endian dependent code #ifdef LL_LITTLE_ENDIAN diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 318ee65cc0..2e9625fff7 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -548,7 +548,7 @@ public: } } - void addChild(oct_node* child, BOOL silent = FALSE) + void addChild(oct_node* child, bool silent = false) { #if LL_OCTREE_PARANOIA_CHECK @@ -591,7 +591,7 @@ public: } } - void removeChild(S32 index, BOOL destroy = FALSE) + void removeChild(S32 index, bool destroy = false) { for (U32 i = 0; i < this->getListenerCount(); i++) { @@ -638,7 +638,7 @@ public: { if (getChild(i) == node) { - removeChild(i, TRUE); + removeChild(i, true); return; } } @@ -707,7 +707,7 @@ public: //(don't notify listeners of addition) for (U32 i = 0; i < child->getChildCount(); i++) { - this->addChild(child->getChild(i), TRUE); + this->addChild(child->getChild(i), true); } //destroy child @@ -723,7 +723,7 @@ public: // LLOctreeRoot::insert bool insert(T* data) override { - if (data == NULL) + if (data == nullptr) { OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE ROOT !!!" << LL_ENDL; return false; diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index 1e7c39df65..0d1ffa5857 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -959,7 +959,7 @@ void LLQuaternion::unpackFromVector3( const LLVector3& vec ) } } -BOOL LLQuaternion::parseQuat(const std::string& buf, LLQuaternion* value) +bool LLQuaternion::parseQuat(const std::string& buf, LLQuaternion* value) { if( buf.empty() || value == NULL) { diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h index 51ce163b4e..1c9da7c342 100644 --- a/indra/llmath/llquaternion.h +++ b/indra/llmath/llquaternion.h @@ -69,9 +69,9 @@ public: LLSD getValue() const; void setValue(const LLSD& sd); - BOOL isIdentity() const; - BOOL isNotIdentity() const; - BOOL isFinite() const; // checks to see if all values of LLQuaternion are finite + bool isIdentity() const; + bool isNotIdentity() const; + bool isFinite() const; // checks to see if all values of LLQuaternion are finite void quantize16(F32 lower, F32 upper); // changes the vector to reflect quatization void quantize8(F32 lower, F32 upper); // changes the vector to reflect quatization void loadIdentity(); // Loads the quaternion that represents the identity rotation @@ -167,7 +167,7 @@ public: friend const char *OrderToString( const Order order ); friend Order StringToOrder( const char *str ); - static BOOL parseQuat(const std::string& buf, LLQuaternion* value); + static bool parseQuat(const std::string& buf, LLQuaternion* value); // For debugging, only //static U32 mMultCount; @@ -192,12 +192,12 @@ inline void LLQuaternion::setValue(const LLSD& sd) } // checker -inline BOOL LLQuaternion::isFinite() const +inline bool LLQuaternion::isFinite() const { return (llfinite(mQ[VX]) && llfinite(mQ[VY]) && llfinite(mQ[VZ]) && llfinite(mQ[VS])); } -inline BOOL LLQuaternion::isIdentity() const +inline bool LLQuaternion::isIdentity() const { return ( mQ[VX] == 0.f ) && @@ -206,7 +206,7 @@ inline BOOL LLQuaternion::isIdentity() const ( mQ[VS] == 1.f ); } -inline BOOL LLQuaternion::isNotIdentity() const +inline bool LLQuaternion::isNotIdentity() const { return ( mQ[VX] != 0.f ) || diff --git a/indra/llmath/llrect.h b/indra/llmath/llrect.h index 58f02d4d2b..4da29482fd 100644 --- a/indra/llmath/llrect.h +++ b/indra/llmath/llrect.h @@ -83,14 +83,14 @@ public: } // Note: follows GL_QUAD conventions: the top and right edges are not considered part of the rect - BOOL pointInRect(const Type x, const Type y) const + bool pointInRect(const Type x, const Type y) const { return mLeft <= x && x < mRight && mBottom <= y && y < mTop; } //// Note: follows GL_QUAD conventions: the top and right edges are not considered part of the rect - BOOL localPointInRect(const Type x, const Type y) const + bool localPointInRect(const Type x, const Type y) const { return 0 <= x && x < getWidth() && 0 <= y && y < getHeight(); @@ -138,7 +138,7 @@ public: // Note: Does NOT follow GL_QUAD conventions: the top and right edges ARE considered part of the rect // returns TRUE if any part of rect is is inside this LLRect - BOOL overlaps(const LLRectBase& rect) const + bool overlaps(const LLRectBase& rect) const { return !(mLeft > rect.mRight || mRight < rect.mLeft @@ -146,7 +146,7 @@ public: || mTop < rect.mBottom); } - BOOL contains(const LLRectBase& rect) const + bool contains(const LLRectBase& rect) const { return mLeft <= rect.mLeft && mRight >= rect.mRight diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 838eb9c653..f9306d6bce 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -97,31 +97,31 @@ const S32 SCULPT_MIN_AREA_DETAIL = 1; BOOL gDebugGL = FALSE; // See settings.xml "RenderDebugGL" -BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm) -{ +bool check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm) +{ LLVector3 test = (pt2-pt1)%(pt3-pt2); //answer if(test * norm < 0) { - return FALSE; + return false; } else { - return TRUE; + return true; } } -BOOL LLLineSegmentBoxIntersect(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size) +bool LLLineSegmentBoxIntersect(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size) { return LLLineSegmentBoxIntersect(start.mV, end.mV, center.mV, size.mV); } -BOOL LLLineSegmentBoxIntersect(const F32* start, const F32* end, const F32* center, const F32* size) +bool LLLineSegmentBoxIntersect(const F32* start, const F32* end, const F32* center, const F32* size) { - F32 fAWdU[3]; - F32 dir[3]; - F32 diff[3]; + F32 fAWdU[3]{}; + F32 dir[3]{}; + F32 diff[3]{}; for (U32 i = 0; i < 3; i++) { @@ -223,7 +223,7 @@ void calc_tangent_from_triangle( // and returns the intersection point along dir in intersection_t. // Moller-Trumbore algorithm -BOOL LLTriangleRayIntersect(const LLVector4a& vert0, const LLVector4a& vert1, const LLVector4a& vert2, const LLVector4a& orig, const LLVector4a& dir, +bool LLTriangleRayIntersect(const LLVector4a& vert0, const LLVector4a& vert1, const LLVector4a& vert2, const LLVector4a& orig, const LLVector4a& dir, F32& intersection_a, F32& intersection_b, F32& intersection_t) { @@ -285,15 +285,15 @@ BOOL LLTriangleRayIntersect(const LLVector4a& vert0, const LLVector4a& vert1, co intersection_a = u[0]; intersection_b = v[0]; intersection_t = t[0]; - return TRUE; + return true; } } } - return FALSE; + return false; } -BOOL LLTriangleRayIntersectTwoSided(const LLVector4a& vert0, const LLVector4a& vert1, const LLVector4a& vert2, const LLVector4a& orig, const LLVector4a& dir, +bool LLTriangleRayIntersectTwoSided(const LLVector4a& vert0, const LLVector4a& vert1, const LLVector4a& vert2, const LLVector4a& orig, const LLVector4a& dir, F32& intersection_a, F32& intersection_b, F32& intersection_t) { F32 u, v, t; @@ -316,7 +316,7 @@ BOOL LLTriangleRayIntersectTwoSided(const LLVector4a& vert0, const LLVector4a& v if (det > -F_APPROXIMATELY_ZERO && det < F_APPROXIMATELY_ZERO) { - return FALSE; + return false; } F32 inv_det = 1.f / det; @@ -329,7 +329,7 @@ BOOL LLTriangleRayIntersectTwoSided(const LLVector4a& vert0, const LLVector4a& v u = (tvec.dot3(pvec).getF32()) * inv_det; if (u < 0.f || u > 1.f) { - return FALSE; + return false; } /* prepare to test V parameter */ @@ -340,7 +340,7 @@ BOOL LLTriangleRayIntersectTwoSided(const LLVector4a& vert0, const LLVector4a& v if (v < 0.f || u + v > 1.f) { - return FALSE; + return false; } /* calculate t, ray intersects triangle */ @@ -351,32 +351,9 @@ BOOL LLTriangleRayIntersectTwoSided(const LLVector4a& vert0, const LLVector4a& v intersection_t = t; - return TRUE; + return true; } -//helper for non-aligned vectors -BOOL LLTriangleRayIntersect(const LLVector3& vert0, const LLVector3& vert1, const LLVector3& vert2, const LLVector3& orig, const LLVector3& dir, - F32& intersection_a, F32& intersection_b, F32& intersection_t, BOOL two_sided) -{ - LLVector4a vert0a, vert1a, vert2a, origa, dira; - vert0a.load3(vert0.mV); - vert1a.load3(vert1.mV); - vert2a.load3(vert2.mV); - origa.load3(orig.mV); - dira.load3(dir.mV); - - if (two_sided) - { - return LLTriangleRayIntersectTwoSided(vert0a, vert1a, vert2a, origa, dira, - intersection_a, intersection_b, intersection_t); - } - else - { - return LLTriangleRayIntersect(vert0a, vert1a, vert2a, origa, dira, - intersection_a, intersection_b, intersection_t); - } -} - class LLVolumeOctreeRebound : public LLOctreeTravelerDepthFirst { public: diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 9048118243..c27bc5e821 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -1098,9 +1098,7 @@ private: F32 sculptGetSurfaceArea(); void sculptGenerateEmptyPlaceholder(); void sculptGenerateSpherePlaceholder(); - void sculptCalcMeshResolution(U16 width, U16 height, U8 type, S32& s, S32& t); - protected: BOOL generate(); void createVolumeFaces(); @@ -1142,18 +1140,13 @@ public: std::ostream& operator<<(std::ostream &s, const LLVolumeParams &volume_params); -BOOL LLLineSegmentBoxIntersect(const F32* start, const F32* end, const F32* center, const F32* size); -BOOL LLLineSegmentBoxIntersect(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size); -BOOL LLLineSegmentBoxIntersect(const LLVector4a& start, const LLVector4a& end, const LLVector4a& center, const LLVector4a& size); +bool LLLineSegmentBoxIntersect(const F32* start, const F32* end, const F32* center, const F32* size); +bool LLLineSegmentBoxIntersect(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size); +bool LLLineSegmentBoxIntersect(const LLVector4a& start, const LLVector4a& end, const LLVector4a& center, const LLVector4a& size); -//BOOL LLTriangleRayIntersect(const LLVector3& vert0, const LLVector3& vert1, const LLVector3& vert2, const LLVector3& orig, const LLVector3& dir, -// F32& intersection_a, F32& intersection_b, F32& intersection_t, BOOL two_sided); - -BOOL LLTriangleRayIntersect(const LLVector4a& vert0, const LLVector4a& vert1, const LLVector4a& vert2, const LLVector4a& orig, const LLVector4a& dir, +bool LLTriangleRayIntersect(const LLVector4a& vert0, const LLVector4a& vert1, const LLVector4a& vert2, const LLVector4a& orig, const LLVector4a& dir, F32& intersection_a, F32& intersection_b, F32& intersection_t); -BOOL LLTriangleRayIntersectTwoSided(const LLVector4a& vert0, const LLVector4a& vert1, const LLVector4a& vert2, const LLVector4a& orig, const LLVector4a& dir, +bool LLTriangleRayIntersectTwoSided(const LLVector4a& vert0, const LLVector4a& vert1, const LLVector4a& vert2, const LLVector4a& orig, const LLVector4a& dir, F32& intersection_a, F32& intersection_b, F32& intersection_t); - - #endif diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp index 6894d04d3c..cef4d66c04 100644 --- a/indra/llmath/llvolumeoctree.cpp +++ b/indra/llmath/llvolumeoctree.cpp @@ -27,7 +27,7 @@ #include "llvolumeoctree.h" #include "llvector4a.h" -BOOL LLLineSegmentBoxIntersect(const LLVector4a& start, const LLVector4a& end, const LLVector4a& center, const LLVector4a& size) +bool LLLineSegmentBoxIntersect(const LLVector4a& start, const LLVector4a& end, const LLVector4a& center, const LLVector4a& size) { LLVector4a fAWdU; LLVector4a dir; diff --git a/indra/llmath/raytrace.cpp b/indra/llmath/raytrace.cpp index 314255374a..c3956e9995 100644 --- a/indra/llmath/raytrace.cpp +++ b/indra/llmath/raytrace.cpp @@ -710,7 +710,7 @@ U32 ray_box(const LLVector3 &ray_point, const LLVector3 &ray_direction, } -BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &prism_center, const LLVector3 &prism_scale, const LLQuaternion &prism_rotation, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -751,7 +751,7 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, point5 = (point5 * prism_rotation) + prism_center; // test ray intersection for each face - BOOL b_hit = FALSE; + bool b_hit = false; LLVector3 face_intersection, face_normal; F32 distance_squared = 0.0f; F32 temp; @@ -761,14 +761,14 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, ray_quadrangle(ray_point, ray_direction, point5, point2, point0, intersection, intersection_normal)) { distance_squared = (ray_point - intersection).magVecSquared(); - b_hit = TRUE; + b_hit = true; } // face 1 if (ray_direction * ( (point0 - point3) % (point2 - point3)) < 0.0f && ray_triangle(ray_point, ray_direction, point2, point3, point0, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -783,7 +783,7 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, distance_squared = (ray_point - face_intersection).magVecSquared(); intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -791,7 +791,7 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, if (ray_direction * ( (point1 - point4) % (point3 - point4)) < 0.0f && ray_quadrangle(ray_point, ray_direction, point3, point4, point1, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -806,7 +806,7 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, distance_squared = (ray_point - face_intersection).magVecSquared(); intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -814,7 +814,7 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, if (ray_direction * ( (point5 - point4) % (point1 - point4)) < 0.0f && ray_triangle(ray_point, ray_direction, point1, point4, point5, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -829,7 +829,7 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, distance_squared = (ray_point - face_intersection).magVecSquared(); intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -837,7 +837,7 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, if (ray_direction * ( (point4 - point5) % (point2 - point5)) < 0.0f && ray_quadrangle(ray_point, ray_direction, point2, point5, point4, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -852,7 +852,7 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, distance_squared = (ray_point - face_intersection).magVecSquared(); intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -860,7 +860,7 @@ BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, } -BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &t_center, const LLVector3 &t_scale, const LLQuaternion &t_rotation, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -890,7 +890,7 @@ BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, point3 = (point3 * t_rotation) + t_center; // test ray intersection for each face - BOOL b_hit = FALSE; + bool b_hit = false; LLVector3 face_intersection, face_normal; F32 distance_squared = 1.0e12f; F32 temp; @@ -900,14 +900,14 @@ BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, ray_triangle(ray_point, ray_direction, point1, point2, point0, intersection, intersection_normal)) { distance_squared = (ray_point - intersection).magVecSquared(); - b_hit = TRUE; + b_hit = true; } // face 1 if (ray_direction * ( (point3 - point2) % (point0 - point2)) < 0.0f && ray_triangle(ray_point, ray_direction, point2, point3, point0, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -922,7 +922,7 @@ BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, distance_squared = (ray_point - face_intersection).magVecSquared(); intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -930,7 +930,7 @@ BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, if (ray_direction * ( (point1 - point3) % (point0 - point3)) < 0.0f && ray_triangle(ray_point, ray_direction, point3, point1, point0, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -945,7 +945,7 @@ BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, distance_squared = (ray_point - face_intersection).magVecSquared(); intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -953,7 +953,7 @@ BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, if (ray_direction * ( (point2 - point3) % (point1 - point3)) < 0.0f && ray_triangle(ray_point, ray_direction, point3, point2, point1, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -966,7 +966,7 @@ BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, { intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -974,7 +974,7 @@ BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, } -BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &p_center, const LLVector3 &p_scale, const LLQuaternion &p_rotation, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -997,7 +997,7 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, point4 = (point4 * p_rotation) + p_center; // test ray intersection for each face - BOOL b_hit = FALSE; + bool b_hit = false; LLVector3 face_intersection, face_normal; F32 distance_squared = 1.0e12f; F32 temp; @@ -1007,14 +1007,14 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, ray_triangle(ray_point, ray_direction, point4, point1, point0, intersection, intersection_normal)) { distance_squared = (ray_point - intersection).magVecSquared(); - b_hit = TRUE; + b_hit = true; } // face 1 if (ray_direction * ( (point2 - point1) % (point0 - point1)) < 0.0f && ray_triangle(ray_point, ray_direction, point1, point2, point0, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -1029,7 +1029,7 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, distance_squared = (ray_point - face_intersection).magVecSquared(); intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -1037,7 +1037,7 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, if (ray_direction * ( (point3 - point2) % (point0 - point2)) < 0.0f && ray_triangle(ray_point, ray_direction, point2, point3, point0, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -1052,7 +1052,7 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, distance_squared = (ray_point - face_intersection).magVecSquared(); intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -1060,7 +1060,7 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, if (ray_direction * ( (point4 - point3) % (point0 - point3)) < 0.0f && ray_triangle(ray_point, ray_direction, point3, point4, point0, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -1075,7 +1075,7 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, distance_squared = (ray_point - face_intersection).magVecSquared(); intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -1083,7 +1083,7 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, if (ray_direction * ( (point3 - point4) % (point2 - point4)) < 0.0f && ray_quadrangle(ray_point, ray_direction, point4, point3, point2, face_intersection, face_normal)) { - if (TRUE == b_hit) + if (b_hit) { temp = (ray_point - face_intersection).magVecSquared(); if (temp < distance_squared) @@ -1096,7 +1096,7 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, { intersection = face_intersection; intersection_normal = face_normal; - b_hit = TRUE; + b_hit = true; } } @@ -1104,7 +1104,7 @@ BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, } -BOOL linesegment_circle(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_circle(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &circle_center, const LLVector3 plane_normal, F32 circle_radius, LLVector3 &intersection) { @@ -1115,14 +1115,14 @@ BOOL linesegment_circle(const LLVector3 &point_a, const LLVector3 &point_b, { if (segment_length >= (point_a - intersection).magVec()) { - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL linesegment_triangle(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_triangle(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &point_0, const LLVector3 &point_1, const LLVector3 &point_2, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -1133,14 +1133,14 @@ BOOL linesegment_triangle(const LLVector3 &point_a, const LLVector3 &point_b, { if (segment_length >= (point_a - intersection).magVec()) { - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL linesegment_quadrangle(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_quadrangle(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &point_0, const LLVector3 &point_1, const LLVector3 &point_2, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -1151,14 +1151,14 @@ BOOL linesegment_quadrangle(const LLVector3 &point_a, const LLVector3 &point_b, { if (segment_length >= (point_a - intersection).magVec()) { - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL linesegment_sphere(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_sphere(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &sphere_center, F32 sphere_radius, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -1169,14 +1169,14 @@ BOOL linesegment_sphere(const LLVector3 &point_a, const LLVector3 &point_b, { if (segment_length >= (point_a - intersection).magVec()) { - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL linesegment_cylinder(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_cylinder(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &cyl_center, const LLVector3 &cyl_scale, const LLQuaternion &cyl_rotation, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -1187,10 +1187,10 @@ BOOL linesegment_cylinder(const LLVector3 &point_a, const LLVector3 &point_b, { if (segment_length >= (point_a - intersection).magVec()) { - return TRUE; + return true; } } - return FALSE; + return false; } @@ -1215,7 +1215,7 @@ U32 linesegment_box(const LLVector3 &point_a, const LLVector3 &point_b, } -BOOL linesegment_prism(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_prism(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &prism_center, const LLVector3 &prism_scale, const LLQuaternion &prism_rotation, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -1229,11 +1229,11 @@ BOOL linesegment_prism(const LLVector3 &point_a, const LLVector3 &point_b, return true; } } - return FALSE; + return false; } -BOOL linesegment_tetrahedron(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_tetrahedron(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &t_center, const LLVector3 &t_scale, const LLQuaternion &t_rotation, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -1244,14 +1244,14 @@ BOOL linesegment_tetrahedron(const LLVector3 &point_a, const LLVector3 &point_b, { if (segment_length >= (point_a - intersection).magVec()) { - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL linesegment_pyramid(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_pyramid(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &p_center, const LLVector3 &p_scale, const LLQuaternion &p_rotation, LLVector3 &intersection, LLVector3 &intersection_normal) { @@ -1262,13 +1262,8 @@ BOOL linesegment_pyramid(const LLVector3 &point_a, const LLVector3 &point_b, { if (segment_length >= (point_a - intersection).magVec()) { - return TRUE; + return true; } } - return FALSE; + return false; } - - - - - diff --git a/indra/llmath/raytrace.h b/indra/llmath/raytrace.h index 92bca45566..3f7014c1b9 100644 --- a/indra/llmath/raytrace.h +++ b/indra/llmath/raytrace.h @@ -129,17 +129,17 @@ BOOL ray_cone(const LLVector3 &ray_point, const LLVector3 &ray_direction, */ -BOOL ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_prism(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &prism_center, const LLVector3 &prism_scale, const LLQuaternion &prism_rotation, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_tetrahedron(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &t_center, const LLVector3 &t_scale, const LLQuaternion &t_rotation, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &p_center, const LLVector3 &p_scale, const LLQuaternion &p_rotation, LLVector3 &intersection, LLVector3 &intersection_normal); @@ -170,13 +170,13 @@ BOOL ray_hemicone(const LLVector3 &ray_point, const LLVector3 &ray_direction, */ -BOOL linesegment_circle(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_circle(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &circle_center, const LLVector3 plane_normal, F32 circle_radius, LLVector3 &intersection); // point_0 through point_2 define the plane_normal via the right-hand rule: // circle from point_0 to point_2 with fingers ==> thumb points in direction of normal -BOOL linesegment_triangle(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_triangle(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &point_0, const LLVector3 &point_1, const LLVector3 &point_2, LLVector3 &intersection, LLVector3 &intersection_normal); @@ -185,19 +185,19 @@ BOOL linesegment_triangle(const LLVector3 &point_a, const LLVector3 &point_b, // right-hand-rule... curl fingers from lower-left toward lower-right then toward upper-right // ==> thumb points in direction of normal // assumes a parallelogram, so point_3 is determined by the other points -BOOL linesegment_quadrangle(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_quadrangle(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &point_0, const LLVector3 &point_1, const LLVector3 &point_2, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL linesegment_sphere(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_sphere(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &sphere_center, F32 sphere_radius, LLVector3 &intersection, LLVector3 &intersection_normal); // finite right cylinder is defined by end centers: "cyl_top", "cyl_bottom", // and by the cylinder radius "cyl_radius" -BOOL linesegment_cylinder(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_cylinder(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &cyl_center, const LLVector3 &cyl_scale, const LLQuaternion &cyl_rotation, LLVector3 &intersection, LLVector3 &intersection_normal); @@ -213,20 +213,17 @@ U32 linesegment_box(const LLVector3 &point_a, const LLVector3 &point_b, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL linesegment_prism(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_prism(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &prism_center, const LLVector3 &prism_scale, const LLQuaternion &prism_rotation, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL linesegment_tetrahedron(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_tetrahedron(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &t_center, const LLVector3 &t_scale, const LLQuaternion &t_rotation, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL linesegment_pyramid(const LLVector3 &point_a, const LLVector3 &point_b, +bool linesegment_pyramid(const LLVector3 &point_a, const LLVector3 &point_b, const LLVector3 &p_center, const LLVector3 &p_scale, const LLQuaternion &p_rotation, LLVector3 &intersection, LLVector3 &intersection_normal); - - #endif - diff --git a/indra/llmath/v2math.cpp b/indra/llmath/v2math.cpp index a24571f2c8..e86d8723a3 100644 --- a/indra/llmath/v2math.cpp +++ b/indra/llmath/v2math.cpp @@ -43,12 +43,12 @@ LLVector2 LLVector2::zero(0,0); // Sets all values to absolute value of their original values // Returns TRUE if data changed -BOOL LLVector2::abs() +bool LLVector2::abs() { - BOOL ret = FALSE; + bool ret{ false }; - if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = TRUE; } - if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = TRUE; } + if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; } + if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; } return ret; } @@ -67,7 +67,7 @@ F32 angle_between(const LLVector2& a, const LLVector2& b) return angle; } -BOOL are_parallel(const LLVector2 &a, const LLVector2 &b, float epsilon) +bool are_parallel(const LLVector2 &a, const LLVector2 &b, float epsilon) { LLVector2 an = a; LLVector2 bn = b; @@ -76,9 +76,9 @@ BOOL are_parallel(const LLVector2 &a, const LLVector2 &b, float epsilon) F32 dot = an * bn; if ( (1.0f - fabs(dot)) < epsilon) { - return TRUE; + return true; } - return FALSE; + return false; } diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index 2335a2e327..e455b8742c 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -78,12 +78,12 @@ class LLVector2 F32 magVecSquared() const; // deprecated F32 normVec(); // deprecated - BOOL abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed + bool abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed const LLVector2& scaleVec(const LLVector2& vec); // scales per component by vec - BOOL isNull(); // Returns TRUE if vector has a _very_small_ length - BOOL isExactlyZero() const { return !mV[VX] && !mV[VY]; } + bool isNull(); // Returns TRUE if vector has a _very_small_ length + bool isExactlyZero() const { return !mV[VX] && !mV[VY]; } F32 operator[](int idx) const { return mV[idx]; } F32 &operator[](int idx) { return mV[idx]; } @@ -114,7 +114,7 @@ class LLVector2 // Non-member functions F32 angle_between(const LLVector2 &a, const LLVector2 &b); // Returns angle (radians) between a and b -BOOL are_parallel(const LLVector2 &a, const LLVector2 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns TRUE if a and b are very close to parallel +bool are_parallel(const LLVector2 &a, const LLVector2 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns TRUE if a and b are very close to parallel F32 dist_vec(const LLVector2 &a, const LLVector2 &b); // Returns distance between a and b F32 dist_vec_squared(const LLVector2 &a, const LLVector2 &b);// Returns distance squared between a and b F32 dist_vec_squared2D(const LLVector2 &a, const LLVector2 &b);// Returns distance squared between a and b ignoring Z component @@ -232,7 +232,7 @@ inline F32 LLVector2::lengthSquared(void) const return mV[0]*mV[0] + mV[1]*mV[1]; } -inline F32 LLVector2::normalize(void) +inline F32 LLVector2::normalize(void) { F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]); F32 oomag; @@ -299,13 +299,13 @@ inline const LLVector2& LLVector2::scaleVec(const LLVector2& vec) return *this; } -inline BOOL LLVector2::isNull() +inline bool LLVector2::isNull() { if ( F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY] ) { - return TRUE; + return true; } - return FALSE; + return false; } diff --git a/indra/llmath/v3dmath.cpp b/indra/llmath/v3dmath.cpp index a50cb3c6ca..1be989d991 100644 --- a/indra/llmath/v3dmath.cpp +++ b/indra/llmath/v3dmath.cpp @@ -53,30 +53,30 @@ const LLVector3d LLVector3d::z_axis_neg(0, 0, -1); // Clamps each values to range (min,max). // Returns TRUE if data changed. -BOOL LLVector3d::clamp(F64 min, F64 max) +bool LLVector3d::clamp(F64 min, F64 max) { - BOOL ret = FALSE; + bool ret{ false }; - if (mdV[0] < min) { mdV[0] = min; ret = TRUE; } - if (mdV[1] < min) { mdV[1] = min; ret = TRUE; } - if (mdV[2] < min) { mdV[2] = min; ret = TRUE; } + if (mdV[0] < min) { mdV[0] = min; ret = true; } + if (mdV[1] < min) { mdV[1] = min; ret = true; } + if (mdV[2] < min) { mdV[2] = min; ret = true; } - if (mdV[0] > max) { mdV[0] = max; ret = TRUE; } - if (mdV[1] > max) { mdV[1] = max; ret = TRUE; } - if (mdV[2] > max) { mdV[2] = max; ret = TRUE; } + if (mdV[0] > max) { mdV[0] = max; ret = true; } + if (mdV[1] > max) { mdV[1] = max; ret = true; } + if (mdV[2] > max) { mdV[2] = max; ret = true; } return ret; } // Sets all values to absolute value of their original values // Returns TRUE if data changed -BOOL LLVector3d::abs() +bool LLVector3d::abs() { - BOOL ret = FALSE; + bool ret{ false }; - if (mdV[0] < 0.0) { mdV[0] = -mdV[0]; ret = TRUE; } - if (mdV[1] < 0.0) { mdV[1] = -mdV[1]; ret = TRUE; } - if (mdV[2] < 0.0) { mdV[2] = -mdV[2]; ret = TRUE; } + if (mdV[0] < 0.0) { mdV[0] = -mdV[0]; ret = true; } + if (mdV[1] < 0.0) { mdV[1] = -mdV[1]; ret = true; } + if (mdV[2] < 0.0) { mdV[2] = -mdV[2]; ret = true; } return ret; } @@ -127,11 +127,11 @@ const LLVector3d& LLVector3d::rotVec(F64 angle, F64 x, F64 y, F64 z) } -BOOL LLVector3d::parseVector3d(const std::string& buf, LLVector3d* value) +bool LLVector3d::parseVector3d(const std::string& buf, LLVector3d* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { - return FALSE; + return false; } LLVector3d v; @@ -139,9 +139,9 @@ BOOL LLVector3d::parseVector3d(const std::string& buf, LLVector3d* value) if( 3 == count ) { value->setVec( v ); - return TRUE; + return true; } - return FALSE; + return false; } diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index 4938273d5b..1d1a7c7512 100644 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h @@ -68,9 +68,9 @@ class LLVector3d return ret; } - inline BOOL isFinite() const; // checks to see if all values of LLVector3d are finite - BOOL clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns TRUE if data changed - BOOL abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed + inline bool isFinite() const; // checks to see if all values of LLVector3d are finite + bool clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns TRUE if data changed + bool abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1) inline const LLVector3d& clearVec(); // deprecated @@ -98,8 +98,8 @@ class LLVector3d const LLVector3d& rotVec(const LLMatrix3 &mat); // Rotates by LLMatrix4 mat const LLVector3d& rotVec(const LLQuaternion &q); // Rotates by LLQuaternion q - BOOL isNull() const; // Returns TRUE if vector has a _very_small_ length - BOOL isExactlyZero() const { return !mdV[VX] && !mdV[VY] && !mdV[VZ]; } + bool isNull() const; // Returns TRUE if vector has a _very_small_ length + bool isExactlyZero() const { return !mdV[VX] && !mdV[VY] && !mdV[VZ]; } const LLVector3d& operator=(const LLVector4 &a); @@ -126,7 +126,7 @@ class LLVector3d friend std::ostream& operator<<(std::ostream& s, const LLVector3d& a); // Stream a - static BOOL parseVector3d(const std::string& buf, LLVector3d* value); + static bool parseVector3d(const std::string& buf, LLVector3d* value); }; @@ -189,7 +189,7 @@ inline LLVector3d::LLVector3d(const LLVector3d ©) // Destructors // checker -inline BOOL LLVector3d::isFinite() const +inline bool LLVector3d::isFinite() const { return (llfinite(mdV[VX]) && llfinite(mdV[VY]) && llfinite(mdV[VZ])); } @@ -472,13 +472,13 @@ inline LLVector3d lerp(const LLVector3d& a, const LLVector3d& b, const F64 u) } -inline BOOL LLVector3d::isNull() const +inline bool LLVector3d::isNull() const { if ( F_APPROXIMATELY_ZERO > mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ] ) { - return TRUE; + return true; } - return FALSE; + return false; } @@ -495,7 +495,7 @@ inline F64 angle_between(const LLVector3d& a, const LLVector3d& b) return angle; } -inline BOOL are_parallel(const LLVector3d& a, const LLVector3d& b, const F64 epsilon) +inline bool are_parallel(const LLVector3d& a, const LLVector3d& b, const F64 epsilon) { LLVector3d an = a; LLVector3d bn = b; @@ -504,10 +504,9 @@ inline BOOL are_parallel(const LLVector3d& a, const LLVector3d& b, const F64 eps F64 dot = an * bn; if ( (1.0f - fabs(dot)) < epsilon) { - return TRUE; + return true; } - return FALSE; - + return false; } inline LLVector3d projected_vec(const LLVector3d& a, const LLVector3d& b) diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp index 93010d2250..4a82051f2e 100644 --- a/indra/llmath/v3math.cpp +++ b/indra/llmath/v3math.cpp @@ -54,26 +54,26 @@ const LLVector3 LLVector3::all_one(1.f,1.f,1.f); // Clamps each values to range (min,max). // Returns TRUE if data changed. -BOOL LLVector3::clamp(F32 min, F32 max) +bool LLVector3::clamp(F32 min, F32 max) { - BOOL ret = FALSE; + bool ret{ false }; - if (mV[0] < min) { mV[0] = min; ret = TRUE; } - if (mV[1] < min) { mV[1] = min; ret = TRUE; } - if (mV[2] < min) { mV[2] = min; ret = TRUE; } + if (mV[0] < min) { mV[0] = min; ret = true; } + if (mV[1] < min) { mV[1] = min; ret = true; } + if (mV[2] < min) { mV[2] = min; ret = true; } - if (mV[0] > max) { mV[0] = max; ret = TRUE; } - if (mV[1] > max) { mV[1] = max; ret = TRUE; } - if (mV[2] > max) { mV[2] = max; ret = TRUE; } + if (mV[0] > max) { mV[0] = max; ret = true; } + if (mV[1] > max) { mV[1] = max; ret = true; } + if (mV[2] > max) { mV[2] = max; ret = true; } return ret; } // Clamps length to an upper limit. // Returns TRUE if the data changed -BOOL LLVector3::clampLength( F32 length_limit ) +bool LLVector3::clampLength( F32 length_limit ) { - BOOL changed = FALSE; + bool changed{ false }; F32 len = length(); if (llfinite(len)) @@ -88,7 +88,7 @@ BOOL LLVector3::clampLength( F32 length_limit ) mV[0] *= length_limit; mV[1] *= length_limit; mV[2] *= length_limit; - changed = TRUE; + changed = true; } } else @@ -108,7 +108,7 @@ BOOL LLVector3::clampLength( F32 length_limit ) { // no it can't be salvaged --> clear it clear(); - changed = TRUE; + changed = true; break; } } @@ -134,17 +134,17 @@ BOOL LLVector3::clampLength( F32 length_limit ) return changed; } -BOOL LLVector3::clamp(const LLVector3 &min_vec, const LLVector3 &max_vec) +bool LLVector3::clamp(const LLVector3 &min_vec, const LLVector3 &max_vec) { - BOOL ret = FALSE; + bool ret{ false }; - if (mV[0] < min_vec[0]) { mV[0] = min_vec[0]; ret = TRUE; } - if (mV[1] < min_vec[1]) { mV[1] = min_vec[1]; ret = TRUE; } - if (mV[2] < min_vec[2]) { mV[2] = min_vec[2]; ret = TRUE; } + if (mV[0] < min_vec[0]) { mV[0] = min_vec[0]; ret = true; } + if (mV[1] < min_vec[1]) { mV[1] = min_vec[1]; ret = true; } + if (mV[2] < min_vec[2]) { mV[2] = min_vec[2]; ret = true; } - if (mV[0] > max_vec[0]) { mV[0] = max_vec[0]; ret = TRUE; } - if (mV[1] > max_vec[1]) { mV[1] = max_vec[1]; ret = TRUE; } - if (mV[2] > max_vec[2]) { mV[2] = max_vec[2]; ret = TRUE; } + if (mV[0] > max_vec[0]) { mV[0] = max_vec[0]; ret = true; } + if (mV[1] > max_vec[1]) { mV[1] = max_vec[1]; ret = true; } + if (mV[2] > max_vec[2]) { mV[2] = max_vec[2]; ret = true; } return ret; } @@ -152,13 +152,13 @@ BOOL LLVector3::clamp(const LLVector3 &min_vec, const LLVector3 &max_vec) // Sets all values to absolute value of their original values // Returns TRUE if data changed -BOOL LLVector3::abs() +bool LLVector3::abs() { - BOOL ret = FALSE; + bool ret{ false }; - if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = TRUE; } - if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = TRUE; } - if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = TRUE; } + if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; } + if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; } + if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = true; } return ret; } @@ -358,11 +358,11 @@ const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot) } // static -BOOL LLVector3::parseVector3(const std::string& buf, LLVector3* value) +bool LLVector3::parseVector3(const std::string& buf, LLVector3* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { - return FALSE; + return false; } LLVector3 v; @@ -370,10 +370,10 @@ BOOL LLVector3::parseVector3(const std::string& buf, LLVector3* value) if( 3 == count ) { value->setVec( v ); - return TRUE; + return true; } - return FALSE; + return false; } // Displacement from query point to nearest neighbor point on bounding box. diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 31abf433a0..3d2365e04b 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -71,16 +71,16 @@ class LLVector3 void setValue(const LLSD& sd); - inline BOOL isFinite() const; // checks to see if all values of LLVector3 are finite - BOOL clamp(F32 min, F32 max); // Clamps all values to (min,max), returns TRUE if data changed - BOOL clamp(const LLVector3 &min_vec, const LLVector3 &max_vec); // Scales vector by another vector - BOOL clampLength( F32 length_limit ); // Scales vector to limit length to a value + inline bool isFinite() const; // checks to see if all values of LLVector3 are finite + bool clamp(F32 min, F32 max); // Clamps all values to (min,max), returns TRUE if data changed + bool clamp(const LLVector3 &min_vec, const LLVector3 &max_vec); // Scales vector by another vector + bool clampLength( F32 length_limit ); // Scales vector to limit length to a value void quantize16(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz); // changes the vector to reflect quatization void quantize8(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz); // changes the vector to reflect quatization void snap(S32 sig_digits); // snaps x,y,z to sig_digits decimal places - BOOL abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed + bool abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed inline void clear(); // Clears LLVector3 to (0, 0, 0) inline void setZero(); // Clears LLVector3 to (0, 0, 0) @@ -108,7 +108,7 @@ class LLVector3 inline F32 normalize(); // Normalizes and returns the magnitude of LLVector3 inline F32 normVec(); // deprecated - inline BOOL inRange( F32 min, F32 max ) const; // Returns true if all values of the vector are between min and max + inline bool inRange( F32 min, F32 max ) const; // Returns true if all values of the vector are between min and max const LLVector3& rotVec(F32 angle, const LLVector3 &vec); // Rotates about vec by angle radians const LLVector3& rotVec(F32 angle, F32 x, F32 y, F32 z); // Rotates about x,y,z by angle radians @@ -120,7 +120,7 @@ class LLVector3 LLVector3 scaledVec(const LLVector3& vec) const; // get a copy of this vector scaled by vec bool isNull() const; // Returns TRUE if vector has a _very_small_ length - BOOL isExactlyZero() const { return !mV[VX] && !mV[VY] && !mV[VZ]; } + bool isExactlyZero() const { return !mV[VX] && !mV[VY] && !mV[VZ]; } F32 operator[](int idx) const { return mV[idx]; } F32 &operator[](int idx) { return mV[idx]; } @@ -149,7 +149,7 @@ class LLVector3 friend std::ostream& operator<<(std::ostream& s, const LLVector3 &a); // Stream a - static BOOL parseVector3(const std::string& buf, LLVector3* value); + static bool parseVector3(const std::string& buf, LLVector3* value); }; typedef LLVector3 LLSimLocalVec; @@ -157,7 +157,7 @@ typedef LLVector3 LLSimLocalVec; // Non-member functions F32 angle_between(const LLVector3 &a, const LLVector3 &b); // Returns angle (radians) between a and b -BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns TRUE if a and b are very close to parallel +bool are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns TRUE if a and b are very close to parallel F32 dist_vec(const LLVector3 &a, const LLVector3 &b); // Returns distance between a and b F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b ignoring Z component @@ -202,7 +202,7 @@ inline LLVector3::LLVector3(const LLVector3 ©) // Destructors // checker -inline BOOL LLVector3::isFinite() const +inline bool LLVector3::isFinite() const { return (llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ])); } @@ -350,7 +350,7 @@ inline F32 LLVector3::magVecSquared(void) const return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]; } -inline BOOL LLVector3::inRange( F32 min, F32 max ) const +inline bool LLVector3::inRange( F32 min, F32 max ) const { return mV[0] >= min && mV[0] <= max && mV[1] >= min && mV[1] <= max && @@ -589,7 +589,7 @@ inline F32 angle_between(const LLVector3& a, const LLVector3& b) return atan2f(sqrtf(c * c), ab); // return the angle } -inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon) +inline bool are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon) { LLVector3 an = a; LLVector3 bn = b; diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index a8768bda35..81d18285b9 100644 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp @@ -385,18 +385,18 @@ void LLColor4::calcHSL(F32* hue, F32* saturation, F32* luminance) const } // static -BOOL LLColor4::parseColor(const std::string& buf, LLColor4* color) +bool LLColor4::parseColor(const std::string& buf, LLColor4* color) { - if( buf.empty() || color == NULL) + if( buf.empty() || color == nullptr) { - return FALSE; + return false; } boost_tokenizer tokens(buf, boost::char_separator(", ")); boost_tokenizer::iterator token_iter = tokens.begin(); if (token_iter == tokens.end()) { - return FALSE; + return false; } // Grab the first token into a string, since we don't know @@ -708,15 +708,15 @@ BOOL LLColor4::parseColor(const std::string& buf, LLColor4* color) } } - return TRUE; + return true; } // static -BOOL LLColor4::parseColor4(const std::string& buf, LLColor4* value) +bool LLColor4::parseColor4(const std::string& buf, LLColor4* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { - return FALSE; + return false; } LLColor4 v; @@ -729,10 +729,10 @@ BOOL LLColor4::parseColor4(const std::string& buf, LLColor4* value) if( 4 == count ) { value->setVec( v ); - return TRUE; + return true; } - return FALSE; + return false; } // EOF diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index daa61594fb..498d4f7734 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -111,7 +111,7 @@ class LLColor4 F32 lengthSquared() const; // Returns magnitude squared of LLColor4 F32 normalize(); // deprecated -- use normalize() - BOOL isOpaque() { return mV[VALPHA] == 1.f; } + bool isOpaque() { return mV[VALPHA] == 1.f; } F32 operator[](int idx) const { return mV[idx]; } F32 &operator[](int idx) { return mV[idx]; } @@ -226,8 +226,8 @@ class LLColor4 static LLColor4 cyan5; static LLColor4 cyan6; - static BOOL parseColor(const std::string& buf, LLColor4* color); - static BOOL parseColor4(const std::string& buf, LLColor4* color); + static bool parseColor(const std::string& buf, LLColor4* color); + static bool parseColor4(const std::string& buf, LLColor4* color); inline void clamp(); }; diff --git a/indra/llmath/v4coloru.cpp b/indra/llmath/v4coloru.cpp index f1a2518cf3..d238d609b4 100644 --- a/indra/llmath/v4coloru.cpp +++ b/indra/llmath/v4coloru.cpp @@ -88,11 +88,11 @@ std::ostream& operator<<(std::ostream& s, const LLColor4U &a) } // static -BOOL LLColor4U::parseColor4U(const std::string& buf, LLColor4U* value) +bool LLColor4U::parseColor4U(const std::string& buf, LLColor4U* value) { - if( buf.empty() || value == NULL) + if( buf.empty() || value == nullptr) { - return FALSE; + return false; } U32 v[4]; @@ -104,17 +104,17 @@ BOOL LLColor4U::parseColor4U(const std::string& buf, LLColor4U* value) } if( 4 != count ) { - return FALSE; + return false; } for( S32 i = 0; i < 4; i++ ) { if( v[i] > U8_MAX ) { - return FALSE; + return false; } } value->set( U8(v[0]), U8(v[1]), U8(v[2]), U8(v[3]) ); - return TRUE; + return true; } diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 0f2eff3d14..ca6a5425f9 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -112,12 +112,11 @@ public: LLColor4U addClampMax(const LLColor4U &color); // Add and clamp the max LLColor4U multAll(const F32 k); // Multiply ALL channels by scalar k - const LLColor4U& combine(); inline void setVecScaleClamp(const LLColor3 &color); inline void setVecScaleClamp(const LLColor4 &color); - static BOOL parseColor4U(const std::string& buf, LLColor4U* value); + static bool parseColor4U(const std::string& buf, LLColor4U* value); // conversion operator LLColor4() const diff --git a/indra/llmath/v4math.cpp b/indra/llmath/v4math.cpp index 2782cf2966..8388fbdbc4 100644 --- a/indra/llmath/v4math.cpp +++ b/indra/llmath/v4math.cpp @@ -36,28 +36,6 @@ // LLVector4 // Axis-Angle rotations - -/* -const LLVector4& LLVector4::rotVec(F32 angle, const LLVector4 &vec) -{ - if ( !vec.isExactlyZero() && angle ) - { - *this = *this * LLMatrix4(angle, vec); - } - return *this; -} - -const LLVector4& LLVector4::rotVec(F32 angle, F32 x, F32 y, F32 z) -{ - LLVector3 vec(x, y, z); - if ( !vec.isExactlyZero() && angle ) - { - *this = *this * LLMatrix4(angle, vec); - } - return *this; -} -*/ - const LLVector4& LLVector4::rotVec(const LLMatrix4 &mat) { *this = *this * mat; @@ -82,14 +60,14 @@ const LLVector4& LLVector4::scaleVec(const LLVector4& vec) // Sets all values to absolute value of their original values // Returns TRUE if data changed -BOOL LLVector4::abs() +bool LLVector4::abs() { - BOOL ret = FALSE; + bool ret{ false }; - if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = TRUE; } - if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = TRUE; } - if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = TRUE; } - if (mV[3] < 0.f) { mV[3] = -mV[3]; ret = TRUE; } + if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; } + if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; } + if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = true; } + if (mV[3] < 0.f) { mV[3] = -mV[3]; ret = true; } return ret; } @@ -117,7 +95,7 @@ F32 angle_between( const LLVector4& a, const LLVector4& b ) return angle; } -BOOL are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon) +bool are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon) { LLVector4 an = a; LLVector4 bn = b; @@ -125,8 +103,8 @@ BOOL are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon) bn.normalize(); F32 dot = an * bn; if ( (1.0f - fabs(dot)) < epsilon) - return TRUE; - return FALSE; + return true; + return false; } diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index b8835ba2e4..8a0a882cf0 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -74,7 +74,7 @@ class LLVector4 } - inline BOOL isFinite() const; // checks to see if all values of LLVector3 are finite + inline bool isFinite() const; // checks to see if all values of LLVector3 are finite inline void clear(); // Clears LLVector4 to (0, 0, 0, 1) inline void clearVec(); // deprecated @@ -102,13 +102,11 @@ class LLVector4 // Sets all values to absolute value of their original values // Returns TRUE if data changed - BOOL abs(); + bool abs(); - BOOL isExactlyClear() const { return (mV[VW] == 1.0f) && !mV[VX] && !mV[VY] && !mV[VZ]; } - BOOL isExactlyZero() const { return !mV[VW] && !mV[VX] && !mV[VY] && !mV[VZ]; } + bool isExactlyClear() const { return (mV[VW] == 1.0f) && !mV[VX] && !mV[VY] && !mV[VZ]; } + bool isExactlyZero() const { return !mV[VW] && !mV[VX] && !mV[VY] && !mV[VZ]; } - const LLVector4& rotVec(F32 angle, const LLVector4 &vec); // Rotates about vec by angle radians - const LLVector4& rotVec(F32 angle, F32 x, F32 y, F32 z); // Rotates about x,y,z by angle radians const LLVector4& rotVec(const LLMatrix4 &mat); // Rotates by MAT4 mat const LLVector4& rotVec(const LLQuaternion &q); // Rotates by QUAT q @@ -139,7 +137,7 @@ class LLVector4 // Non-member functions F32 angle_between(const LLVector4 &a, const LLVector4 &b); // Returns angle (radians) between a and b -BOOL are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns TRUE if a and b are very close to parallel +bool are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon = F_APPROXIMATELY_ZERO); // Returns TRUE if a and b are very close to parallel F32 dist_vec(const LLVector4 &a, const LLVector4 &b); // Returns distance between a and b F32 dist_vec_squared(const LLVector4 &a, const LLVector4 &b); // Returns distance squared between a and b LLVector3 vec4to3(const LLVector4 &vec); @@ -226,7 +224,7 @@ inline LLVector4::LLVector4(const LLSD &sd) } -inline BOOL LLVector4::isFinite() const +inline bool LLVector4::isFinite() const { return (llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ]) && llfinite(mV[VW])); } diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 650ae9ae75..8033eaa00f 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1476,10 +1476,10 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) } } - BOOL item_clicked = FALSE; - for (selected_items_t::iterator item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) + bool item_clicked{ false }; + for (const auto item : mSelectedItems) { - item_clicked |= (*item_it)->getRect().pointInRect(x, y); + item_clicked |= item->getRect().pointInRect(x, y); } if(!item_clicked && mSingleFolderMode) { From 07f54e72766d903292fec985e7c5eb46a6a325ca Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 16 Feb 2024 00:12:57 +0100 Subject: [PATCH 2/7] Replaced one overlooked FALSE --- indra/llcommon/llstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 4358e80125..ef77b0b1c8 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -311,7 +311,7 @@ S32 wstring_utf16_length(const LLWString &wstr, const S32 woffset, const S32 wle S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, const S32 woffset, const S32 utf16_length, bool *unaligned) { const auto end = wstr.length(); - bool u = FALSE; + bool u{ false }; S32 n = woffset + utf16_length; S32 i = woffset; while (i < end) From d0e82ca55670645eacc61fca39bf8667c0840de9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 16 Feb 2024 00:02:04 +0200 Subject: [PATCH 3/7] jira-archive-internal#67837 Windows' bulk export of snapshots and textures SL-17661 Viewer was silently failing to 'save selection as' --- indra/llcommon/threadpool.cpp | 4 ++ indra/newview/lldirpicker.cpp | 88 ++++++++++++++++++++++------------- indra/newview/lldirpicker.h | 10 +--- 3 files changed, 61 insertions(+), 41 deletions(-) diff --git a/indra/llcommon/threadpool.cpp b/indra/llcommon/threadpool.cpp index 3a9a5a2062..e22013312d 100644 --- a/indra/llcommon/threadpool.cpp +++ b/indra/llcommon/threadpool.cpp @@ -99,6 +99,10 @@ void LL::ThreadPoolBase::start() LL::ThreadPoolBase::~ThreadPoolBase() { close(); + if (!LLEventPumps::wasDeleted()) + { + LLEventPumps::instance().obtain("LLApp").stopListening(mName); + } } void LL::ThreadPoolBase::close() diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index 01790ad19e..cad6da0ef0 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -41,12 +41,6 @@ # include "llfilepicker.h" #endif -// -// Globals -// - -LLDirPicker LLDirPicker::sInstance; - #if LL_WINDOWS #include #endif @@ -75,21 +69,24 @@ bool LLDirPicker::check_local_file_access_enabled() LLDirPicker::LLDirPicker() : mFileName(NULL), - mLocked(false) + mLocked(false), + pDialog(NULL) { - bi.hwndOwner = NULL; - bi.pidlRoot = NULL; - bi.pszDisplayName = NULL; - bi.lpszTitle = NULL; - bi.ulFlags = BIF_USENEWUI; - bi.lpfn = NULL; - bi.lParam = NULL; - bi.iImage = 0; } LLDirPicker::~LLDirPicker() { - // nothing + mEventListener.disconnect(); +} + +void LLDirPicker::reset() +{ + if (pDialog) + { + IFileDialog* p_file_dialog = (IFileDialog*)pDialog; + p_file_dialog->Close(S_FALSE); + pDialog = NULL; + } } BOOL LLDirPicker::getDir(std::string* filename, bool blocking) @@ -113,26 +110,51 @@ BOOL LLDirPicker::getDir(std::string* filename, bool blocking) // Modal, so pause agent send_agent_pause(); } - - bi.hwndOwner = (HWND)gViewerWindow->getPlatformWindow(); + else if (!mEventListener.connected()) + { + mEventListener = LLEventPumps::instance().obtain("LLApp").listen( + "DirPicker", + [this](const LLSD& stat) + { + std::string status(stat["status"]); + if (status != "running") + { + reset(); + } + return false; + }); + } ::OleInitialize(NULL); - LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi); - if(pIDL != NULL) - { - WCHAR buffer[_MAX_PATH] = {'\0'}; - - if(::SHGetPathFromIDList(pIDL, buffer) != 0) - { - // Set the string value. - - mDir = utf16str_to_utf8str(llutf16string(buffer)); - success = TRUE; - } - // free the item id list - CoTaskMemFree(pIDL); - } + IFileDialog* p_file_dialog; + if (SUCCEEDED(CoCreateInstance(CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&p_file_dialog)))) + { + DWORD dwOptions; + if (SUCCEEDED(p_file_dialog->GetOptions(&dwOptions))) + { + p_file_dialog->SetOptions(dwOptions | FOS_PICKFOLDERS); + } + HWND owner = (HWND)gViewerWindow->getPlatformWindow(); + pDialog = p_file_dialog; + if (SUCCEEDED(p_file_dialog->Show(owner))) + { + IShellItem* psi; + if (SUCCEEDED(p_file_dialog->GetResult(&psi))) + { + wchar_t* pwstr = NULL; + if (SUCCEEDED(psi->GetDisplayName(SIGDN_FILESYSPATH, &pwstr))) + { + mDir = ll_convert_wide_to_string(pwstr); + CoTaskMemFree(pwstr); + success = TRUE; + } + psi->Release(); + } + } + pDialog = NULL; + p_file_dialog->Release(); + } ::OleUninitialize(); diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index 52febe4523..bdf7b4ddba 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -57,9 +57,6 @@ class LLFilePicker; class LLDirPicker { public: - // calling this before main() is undefined - static LLDirPicker& instance( void ) { return sInstance; } - BOOL getDir(std::string* filename, bool blocking = true); std::string getDirName(); @@ -87,12 +84,9 @@ private: std::string* mFileName; std::string mDir; bool mLocked; + void *pDialog; + boost::signals2::connection mEventListener; - static LLDirPicker sInstance; -#if LL_WINDOWS - BROWSEINFO bi; -#endif - public: // don't call these directly please. LLDirPicker(); From 9e854b697a06abed2a0917fb6120445f176764f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Fri, 16 Feb 2024 19:29:51 +0100 Subject: [PATCH 4/7] misc: BOOL to bool --- indra/llappearance/llavatarappearance.cpp | 44 ++--- indra/llappearance/llavatarappearance.h | 16 +- .../llavatarappearancedefines.cpp | 90 +++++----- .../llappearance/llavatarappearancedefines.h | 6 +- indra/llappearance/llavatarjoint.cpp | 30 ++-- indra/llappearance/llavatarjoint.h | 24 +-- indra/llappearance/llavatarjointmesh.cpp | 2 +- indra/llappearance/llavatarjointmesh.h | 4 +- indra/llappearance/lldriverparam.cpp | 4 +- indra/llappearance/lllocaltextureobject.cpp | 6 +- indra/llappearance/lllocaltextureobject.h | 4 +- indra/llappearance/llpolymesh.cpp | 10 +- indra/llappearance/llpolymesh.h | 12 +- indra/llappearance/llpolymorph.cpp | 12 +- indra/llappearance/llpolymorph.h | 12 +- .../llappearance/llpolyskeletaldistortion.cpp | 2 +- indra/llappearance/llpolyskeletaldistortion.h | 6 +- indra/llappearance/lltexglobalcolor.cpp | 2 +- indra/llappearance/lltexlayer.cpp | 162 +++++++++--------- indra/llappearance/lltexlayer.h | 70 ++++---- indra/llappearance/lltexlayerparams.cpp | 42 ++--- indra/llappearance/lltexlayerparams.h | 20 +-- indra/llappearance/llviewervisualparam.cpp | 8 +- indra/llappearance/llviewervisualparam.h | 12 +- indra/llappearance/llwearable.cpp | 8 +- indra/llappearance/llwearable.h | 6 +- indra/llappearance/llwearabledata.cpp | 14 +- indra/llappearance/llwearabledata.h | 8 +- indra/llappearance/llwearabletype.cpp | 42 ++--- indra/llappearance/llwearabletype.h | 12 +- indra/llcharacter/llanimationstates.cpp | 4 +- indra/llcharacter/llanimationstates.h | 2 +- indra/llcharacter/llbvhloader.cpp | 62 +++---- indra/llcharacter/llbvhloader.h | 46 ++--- indra/llcharacter/llcharacter.cpp | 16 +- indra/llcharacter/llcharacter.h | 18 +- indra/llcharacter/lleditingmotion.cpp | 6 +- indra/llcharacter/lleditingmotion.h | 10 +- indra/llcharacter/llgesture.cpp | 16 +- indra/llcharacter/llgesture.h | 8 +- indra/llcharacter/llhandmotion.cpp | 4 +- indra/llcharacter/llhandmotion.h | 12 +- indra/llcharacter/llheadrotmotion.cpp | 18 +- indra/llcharacter/llheadrotmotion.h | 22 +-- indra/llcharacter/lljoint.cpp | 8 +- indra/llcharacter/lljoint.h | 4 +- indra/llcharacter/lljointsolverrp3.cpp | 6 +- indra/llcharacter/lljointsolverrp3.h | 4 +- indra/llcharacter/lljointstate.h | 2 +- indra/llcharacter/llkeyframefallmotion.cpp | 6 +- indra/llcharacter/llkeyframefallmotion.h | 4 +- indra/llcharacter/llkeyframemotion.cpp | 46 ++--- indra/llcharacter/llkeyframemotion.h | 26 +-- indra/llcharacter/llkeyframemotionparam.cpp | 12 +- indra/llcharacter/llkeyframemotionparam.h | 14 +- indra/llcharacter/llkeyframestandmotion.cpp | 18 +- indra/llcharacter/llkeyframestandmotion.h | 8 +- indra/llcharacter/llkeyframewalkmotion.cpp | 12 +- indra/llcharacter/llkeyframewalkmotion.h | 12 +- indra/llcharacter/llmotion.cpp | 14 +- indra/llcharacter/llmotion.h | 42 ++--- indra/llcharacter/llmotioncontroller.cpp | 60 +++---- indra/llcharacter/llmotioncontroller.h | 22 +-- indra/llcharacter/llmultigesture.cpp | 40 ++--- indra/llcharacter/llmultigesture.h | 32 ++-- indra/llcharacter/llpose.cpp | 18 +- indra/llcharacter/llpose.h | 16 +- indra/llcharacter/llstatemachine.cpp | 20 +-- indra/llcharacter/llstatemachine.h | 16 +- indra/llcharacter/lltargetingmotion.cpp | 6 +- indra/llcharacter/lltargetingmotion.h | 10 +- indra/llcharacter/llvisualparam.cpp | 14 +- indra/llcharacter/llvisualparam.h | 18 +- indra/llcommon/llstring.cpp | 2 +- indra/llcommon/llstring.h | 4 +- indra/llinventory/llparcel.cpp | 58 +++---- indra/llinventory/llparcel.h | 64 +++---- indra/llinventory/llpermissions.cpp | 87 +++++----- indra/llinventory/llpermissions.h | 26 +-- indra/llmath/llvolume.cpp | 58 +++---- indra/llmath/llvolume.h | 14 +- indra/llmessage/llassetstorage.cpp | 2 +- indra/llmessage/llmessagereader.h | 2 +- indra/llmessage/llsdmessagereader.cpp | 2 +- indra/llmessage/llsdmessagereader.h | 2 +- indra/llmessage/lltemplatemessagereader.cpp | 2 +- indra/llmessage/lltemplatemessagereader.h | 2 +- indra/llmessage/llxfermanager.cpp | 4 +- indra/llmessage/message.cpp | 4 +- indra/llmessage/message.h | 4 +- indra/llxml/llcontrol.cpp | 6 +- indra/llxml/llxmltree.cpp | 4 +- indra/llxml/llxmltree.h | 4 +- indra/newview/llagent.cpp | 6 +- indra/newview/llagent.h | 2 +- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llagentwearables.h | 2 +- indra/newview/llavatarpropertiesprocessor.h | 4 +- indra/newview/llbreastmotion.h | 4 +- indra/newview/llcommandlineparser.cpp | 2 +- indra/newview/llemote.cpp | 8 +- indra/newview/llemote.h | 4 +- indra/newview/llfloaterbuycontents.cpp | 2 +- indra/newview/llfloaterland.cpp | 6 +- indra/newview/llfloaterpay.cpp | 4 +- indra/newview/llfloaterregioninfo.cpp | 2 +- indra/newview/llgroupmgr.cpp | 18 +- indra/newview/llgroupmgr.h | 2 +- indra/newview/llpanelgroupnotices.cpp | 2 +- indra/newview/llphysicsmotion.cpp | 30 ++-- indra/newview/llphysicsmotion.h | 4 +- indra/newview/llpreviewscript.cpp | 4 +- indra/newview/llregioninfomodel.h | 2 +- indra/newview/llselectmgr.cpp | 12 +- indra/newview/llsettingsvo.cpp | 4 +- indra/newview/llsidepaneliteminfo.cpp | 2 +- indra/newview/llviewergesture.cpp | 28 +-- indra/newview/llviewergesture.h | 12 +- indra/newview/llviewerjoint.cpp | 12 +- indra/newview/llviewerjoint.h | 4 +- indra/newview/llviewerjointattachment.cpp | 28 +-- indra/newview/llviewerjointattachment.h | 22 +-- indra/newview/llviewerjointmesh.cpp | 4 +- indra/newview/llviewerjointmesh.h | 8 +- indra/newview/llviewermessage.cpp | 18 +- indra/newview/llviewerparcelmgr.cpp | 20 +-- indra/newview/llviewerregion.cpp | 2 +- indra/newview/llviewertexlayer.cpp | 6 +- indra/newview/llviewertexlayer.h | 4 +- indra/newview/llvoavatar.cpp | 22 +-- indra/newview/llvoavatar.h | 4 +- indra/newview/llvoavatarself.cpp | 10 +- indra/newview/llvoavatarself.h | 6 +- 133 files changed, 1065 insertions(+), 1068 deletions(-) diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 7d9d2ba24c..43ee78519d 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -78,7 +78,7 @@ class LLAvatarBoneInfo friend class LLAvatarAppearance; friend class LLAvatarSkeletonInfo; public: - LLAvatarBoneInfo() : mIsJoint(FALSE) {} + LLAvatarBoneInfo() : mIsJoint(false) {} ~LLAvatarBoneInfo() { std::for_each(mChildren.begin(), mChildren.end(), DeletePointer()); @@ -178,7 +178,7 @@ LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAv LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) : LLCharacter(), - mIsDummy(FALSE), + mIsDummy(false), mTexSkinColor( NULL ), mTexHairColor( NULL ), mTexEyeColor( NULL ), @@ -189,7 +189,7 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) : mNumBones(0), mNumCollisionVolumes(0), mCollisionVolumes(NULL), - mIsBuilt(FALSE), + mIsBuilt(false), mInitFlags(0) { llassert_always(mWearableData); @@ -236,14 +236,14 @@ void LLAvatarAppearance::initInstance() mesh->setName(mesh_name); mesh->setMeshID(mesh_index); mesh->setPickName(mesh_dict->mPickName); - mesh->setIsTransparent(FALSE); + mesh->setIsTransparent(false); switch((S32)mesh_index) { case MESH_ID_HAIR: - mesh->setIsTransparent(TRUE); + mesh->setIsTransparent(true); break; case MESH_ID_SKIRT: - mesh->setIsTransparent(TRUE); + mesh->setIsTransparent(true); break; case MESH_ID_EYEBALL_LEFT: case MESH_ID_EYEBALL_RIGHT: @@ -345,7 +345,7 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons avatar_file_name = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR + "_lad.xml"); } LLXmlTree xml_tree; - bool success = xml_tree.parseFile( avatar_file_name, FALSE ); + bool success = xml_tree.parseFile( avatar_file_name, false ); if (!success) { LL_ERRS() << "Problem reading avatar configuration file:" << avatar_file_name << LL_ENDL; @@ -580,7 +580,7 @@ bool LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTre //------------------------------------------------------------------------- // parse the file //------------------------------------------------------------------------- - bool parsesuccess = skeleton_xml_tree.parseFile( filename, FALSE ); + bool parsesuccess = skeleton_xml_tree.parseFile( filename, false ); if (!parsesuccess) { @@ -804,7 +804,7 @@ void LLAvatarAppearance::buildCharacter() //------------------------------------------------------------------------- mRoot->removeAllChildren(); mJointMap.clear(); - mIsBuilt = FALSE; + mIsBuilt = false; //------------------------------------------------------------------------- // clear mesh data @@ -825,7 +825,7 @@ void LLAvatarAppearance::buildCharacter() bool status = loadAvatar(); stop_glerror(); -// gPrintMessagesThisFrame = TRUE; +// gPrintMessagesThisFrame = true; LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL; if (!status) @@ -895,7 +895,7 @@ void LLAvatarAppearance::buildCharacter() // SL-315 mPelvisp->setPosition( LLVector3(0.0f, 0.0f, 0.0f) ); - mIsBuilt = TRUE; + mIsBuilt = true; stop_glerror(); } @@ -1041,7 +1041,7 @@ bool LLAvatarAppearance::loadSkeletonNode () // make meshes children before calling parent version of the function for (LLAvatarJoint* joint : mMeshLOD) { - joint->mUpdateXform = FALSE; + joint->mUpdateXform = false; joint->setMeshesToChildren(); } @@ -1104,7 +1104,7 @@ bool LLAvatarAppearance::loadMeshNodes() LLAvatarJointMesh* mesh = NULL; U8 mesh_id = 0; - bool found_mesh_id = FALSE; + bool found_mesh_id = false; /* if (type == "hairMesh") switch(lod) @@ -1117,7 +1117,7 @@ bool LLAvatarAppearance::loadMeshNodes() if (type.compare(mesh_dict->mName) == 0) { mesh_id = mesh_index; - found_mesh_id = TRUE; + found_mesh_id = true; break; } } @@ -1257,12 +1257,12 @@ bool LLAvatarAppearance::loadLayersets() LLTexLayerInterface* layer = layer_set->findLayerByName(morph->mLayer); if (layer) { - layer->setHasMorph(TRUE); + layer->setHasMorph(true); } else { LL_WARNS() << "Could not find layer named " << morph->mLayer << " to set morph flag" << LL_ENDL; - success = FALSE; + success = false; } } } @@ -1564,7 +1564,7 @@ bool LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node) { if (node->hasName("bone")) { - mIsJoint = TRUE; + mIsJoint = true; static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); if (!node->getFastAttributeString(name_string, mName)) { @@ -1577,7 +1577,7 @@ bool LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node) } else if (node->hasName("collision_volume")) { - mIsJoint = FALSE; + mIsJoint = false; static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); if (!node->getFastAttributeString(name_string, mName)) { @@ -1810,13 +1810,13 @@ bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro static LLStdStringHandle position_string = LLXmlTree::addAttributeString("position"); if (child->getFastAttributeVector3(position_string, info->mPosition)) { - info->mHasPosition = TRUE; + info->mHasPosition = true; } static LLStdStringHandle rotation_string = LLXmlTree::addAttributeString("rotation"); if (child->getFastAttributeVector3(rotation_string, info->mRotationEuler)) { - info->mHasRotation = TRUE; + info->mHasRotation = true; } static LLStdStringHandle group_string = LLXmlTree::addAttributeString("group"); if (child->getFastAttributeS32(group_string, info->mGroup)) @@ -1926,7 +1926,7 @@ bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root) delete info; return false; } - BOOL shared = false; + bool shared = false; static LLStdStringHandle shared_string = LLXmlTree::addAttributeString("shared"); child->getFastAttributeBOOL(shared_string, shared); @@ -2107,7 +2107,7 @@ bool LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root } //virtual -LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer) : +LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, bool invert, std::string layer) : mMorphTarget(morph_target), mInvert(invert), mLayer(layer) diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index f3c74c052f..dd16a27a3c 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -381,7 +381,7 @@ protected: struct LLAvatarMeshInfo { - typedef std::pair morph_info_pair_t; // LLPolyMorphTargetInfo stored here + typedef std::pair morph_info_pair_t; // LLPolyMorphTargetInfo stored here typedef std::vector morph_info_list_t; LLAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {} @@ -410,8 +410,8 @@ protected: struct LLAvatarAttachmentInfo { LLAvatarAttachmentInfo() - : mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(FALSE), - mIsHUDAttachment(FALSE), mHasPosition(FALSE), mHasRotation(FALSE) {} + : mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(false), + mIsHUDAttachment(false), mHasPosition(false), mHasRotation(false) {} std::string mName; std::string mJointName; LLVector3 mPosition; @@ -419,8 +419,8 @@ protected: S32 mGroup; S32 mAttachmentID; S32 mPieMenuSlice; - BOOL mVisibleFirstPerson; - BOOL mIsHUDAttachment; + bool mVisibleFirstPerson; + bool mIsHUDAttachment; bool mHasPosition; bool mHasRotation; }; @@ -440,11 +440,11 @@ protected: struct LLAvatarMorphInfo { LLAvatarMorphInfo() - : mInvert(FALSE) {} + : mInvert(false) {} std::string mName; std::string mRegion; std::string mLayer; - BOOL mInvert; + bool mInvert; }; typedef std::vector morph_info_list_t; @@ -455,7 +455,7 @@ protected: class LLMaskedMorph { public: - LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer); + LLMaskedMorph(LLVisualParam *morph_target, bool invert, std::string layer); LLVisualParam *mMorphTarget; bool mInvert; diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index f3f26be4b9..7af1c37824 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -39,56 +39,56 @@ using namespace LLAvatarAppearanceDefines; LLAvatarAppearanceDictionary::Textures::Textures() { - addEntry(TEX_HEAD_BODYPAINT, new TextureEntry("head_bodypaint", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN)); - addEntry(TEX_UPPER_SHIRT, new TextureEntry("upper_shirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShirtUUID", LLWearableType::WT_SHIRT)); - addEntry(TEX_LOWER_PANTS, new TextureEntry("lower_pants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultPantsUUID", LLWearableType::WT_PANTS)); - addEntry(TEX_EYES_IRIS, new TextureEntry("eyes_iris", TRUE, BAKED_NUM_INDICES, "UIImgDefaultEyesUUID", LLWearableType::WT_EYES)); - addEntry(TEX_HAIR, new TextureEntry("hair_grain", TRUE, BAKED_NUM_INDICES, "UIImgDefaultHairUUID", LLWearableType::WT_HAIR)); - addEntry(TEX_UPPER_BODYPAINT, new TextureEntry("upper_bodypaint", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN)); - addEntry(TEX_LOWER_BODYPAINT, new TextureEntry("lower_bodypaint", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN)); - addEntry(TEX_LOWER_SHOES, new TextureEntry("lower_shoes", TRUE, BAKED_NUM_INDICES, "UIImgDefaultShoesUUID", LLWearableType::WT_SHOES)); - addEntry(TEX_LOWER_SOCKS, new TextureEntry("lower_socks", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSocksUUID", LLWearableType::WT_SOCKS)); - addEntry(TEX_UPPER_JACKET, new TextureEntry("upper_jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET)); - addEntry(TEX_LOWER_JACKET, new TextureEntry("lower_jacket", TRUE, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET)); - addEntry(TEX_UPPER_GLOVES, new TextureEntry("upper_gloves", TRUE, BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID", LLWearableType::WT_GLOVES)); - addEntry(TEX_UPPER_UNDERSHIRT, new TextureEntry("upper_undershirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERSHIRT)); - addEntry(TEX_LOWER_UNDERPANTS, new TextureEntry("lower_underpants", TRUE, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERPANTS)); - addEntry(TEX_SKIRT, new TextureEntry("skirt", TRUE, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", LLWearableType::WT_SKIRT)); + addEntry(TEX_HEAD_BODYPAINT, new TextureEntry("head_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN)); + addEntry(TEX_UPPER_SHIRT, new TextureEntry("upper_shirt", true, BAKED_NUM_INDICES, "UIImgDefaultShirtUUID", LLWearableType::WT_SHIRT)); + addEntry(TEX_LOWER_PANTS, new TextureEntry("lower_pants", true, BAKED_NUM_INDICES, "UIImgDefaultPantsUUID", LLWearableType::WT_PANTS)); + addEntry(TEX_EYES_IRIS, new TextureEntry("eyes_iris", true, BAKED_NUM_INDICES, "UIImgDefaultEyesUUID", LLWearableType::WT_EYES)); + addEntry(TEX_HAIR, new TextureEntry("hair_grain", true, BAKED_NUM_INDICES, "UIImgDefaultHairUUID", LLWearableType::WT_HAIR)); + addEntry(TEX_UPPER_BODYPAINT, new TextureEntry("upper_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN)); + addEntry(TEX_LOWER_BODYPAINT, new TextureEntry("lower_bodypaint", true, BAKED_NUM_INDICES, "", LLWearableType::WT_SKIN)); + addEntry(TEX_LOWER_SHOES, new TextureEntry("lower_shoes", true, BAKED_NUM_INDICES, "UIImgDefaultShoesUUID", LLWearableType::WT_SHOES)); + addEntry(TEX_LOWER_SOCKS, new TextureEntry("lower_socks", true, BAKED_NUM_INDICES, "UIImgDefaultSocksUUID", LLWearableType::WT_SOCKS)); + addEntry(TEX_UPPER_JACKET, new TextureEntry("upper_jacket", true, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET)); + addEntry(TEX_LOWER_JACKET, new TextureEntry("lower_jacket", true, BAKED_NUM_INDICES, "UIImgDefaultJacketUUID", LLWearableType::WT_JACKET)); + addEntry(TEX_UPPER_GLOVES, new TextureEntry("upper_gloves", true, BAKED_NUM_INDICES, "UIImgDefaultGlovesUUID", LLWearableType::WT_GLOVES)); + addEntry(TEX_UPPER_UNDERSHIRT, new TextureEntry("upper_undershirt", true, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERSHIRT)); + addEntry(TEX_LOWER_UNDERPANTS, new TextureEntry("lower_underpants", true, BAKED_NUM_INDICES, "UIImgDefaultUnderwearUUID", LLWearableType::WT_UNDERPANTS)); + addEntry(TEX_SKIRT, new TextureEntry("skirt", true, BAKED_NUM_INDICES, "UIImgDefaultSkirtUUID", LLWearableType::WT_SKIRT)); - addEntry(TEX_LOWER_ALPHA, new TextureEntry("lower_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); - addEntry(TEX_UPPER_ALPHA, new TextureEntry("upper_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); - addEntry(TEX_HEAD_ALPHA, new TextureEntry("head_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); - addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); - addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); + addEntry(TEX_LOWER_ALPHA, new TextureEntry("lower_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); + addEntry(TEX_UPPER_ALPHA, new TextureEntry("upper_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); + addEntry(TEX_HEAD_ALPHA, new TextureEntry("head_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); + addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); + addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", true, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", LLWearableType::WT_ALPHA)); - addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); - addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); - addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); - addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", true, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); - addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD, "head")); - addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER, "upper")); - addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", FALSE, BAKED_LOWER, "lower")); - addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", FALSE, BAKED_EYES, "eyes")); - addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", FALSE, BAKED_HAIR, "hair")); - addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", FALSE, BAKED_SKIRT, "skirt")); - addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", FALSE, BAKED_LEFT_ARM, "leftarm")); - addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", FALSE, BAKED_LEFT_LEG, "leftleg")); - addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", FALSE, BAKED_AUX1, "aux1")); - addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", FALSE, BAKED_AUX2, "aux2")); - addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", FALSE, BAKED_AUX3, "aux3")); + addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", false, BAKED_HEAD, "head")); + addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", false, BAKED_UPPER, "upper")); + addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", false, BAKED_LOWER, "lower")); + addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", false, BAKED_EYES, "eyes")); + addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", false, BAKED_HAIR, "hair")); + addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", false, BAKED_SKIRT, "skirt")); + addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", false, BAKED_LEFT_ARM, "leftarm")); + addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", false, BAKED_LEFT_LEG, "leftleg")); + addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", false, BAKED_AUX1, "aux1")); + addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", false, BAKED_AUX2, "aux2")); + addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", false, BAKED_AUX3, "aux3")); } LLAvatarAppearanceDictionary::BakedTextures::BakedTextures() diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index b90c6664cc..21c0dedeba 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -167,10 +167,10 @@ public: const std::string mDefaultImageName; const LLWearableType::EType mWearableType; // It's either a local texture xor baked - BOOL mIsLocalTexture; - BOOL mIsBakedTexture; + bool mIsLocalTexture; + bool mIsBakedTexture; // If it's a local texture, it may be used by a baked texture - BOOL mIsUsedByBakedTexture; + bool mIsUsedByBakedTexture; EBakedTextureIndex mBakedTextureIndex; }; diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp index e7bd831b49..579381958c 100644 --- a/indra/llappearance/llavatarjoint.cpp +++ b/indra/llappearance/llavatarjoint.cpp @@ -40,7 +40,7 @@ const F32 DEFAULT_AVATAR_JOINT_LOD = 0.0f; //----------------------------------------------------------------------------- // Static Data //----------------------------------------------------------------------------- -BOOL LLAvatarJoint::sDisableLOD = FALSE; +bool LLAvatarJoint::sDisableLOD = false; //----------------------------------------------------------------------------- // LLAvatarJoint() @@ -66,13 +66,13 @@ LLAvatarJoint::LLAvatarJoint(const std::string &name, LLJoint *parent) : void LLAvatarJoint::init() { - mValid = FALSE; + mValid = false; mComponents = SC_JOINT | SC_BONE | SC_AXES; mMinPixelArea = DEFAULT_AVATAR_JOINT_LOD; mPickName = PN_DEFAULT; - mVisible = TRUE; + mVisible = true; mMeshID = 0; - mIsTransparent = FALSE; + mIsTransparent = false; } @@ -88,7 +88,7 @@ LLAvatarJoint::~LLAvatarJoint() //-------------------------------------------------------------------- // setValid() //-------------------------------------------------------------------- -void LLAvatarJoint::setValid( BOOL valid, BOOL recursive ) +void LLAvatarJoint::setValid( bool valid, bool recursive ) { //---------------------------------------------------------------- // set visibility for this joint @@ -103,7 +103,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive ) for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast(child); - joint->setValid(valid, TRUE); + joint->setValid(valid, true); } } @@ -112,7 +112,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive ) //-------------------------------------------------------------------- // setSkeletonComponents() //-------------------------------------------------------------------- -void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive ) +void LLAvatarJoint::setSkeletonComponents( U32 comp, bool recursive ) { mComponents = comp; if (recursive) @@ -125,7 +125,7 @@ void LLAvatarJoint::setSkeletonComponents( U32 comp, BOOL recursive ) } } -void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive) +void LLAvatarJoint::setVisible(bool visible, bool recursive) { mVisible = visible; @@ -148,7 +148,7 @@ void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix } } -void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) +void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind, bool terse_update) { for (LLJoint* child : mChildren) { @@ -180,18 +180,18 @@ bool LLAvatarJoint::updateLOD(F32 pixel_area, bool activate) if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD) { // we've already found a joint to enable, so enable the rest as alternatives - lod_changed |= joint->updateLOD(pixel_area, TRUE); + lod_changed |= joint->updateLOD(pixel_area, true); } else { if (pixel_area >= jointLOD || sDisableLOD) { - lod_changed |= joint->updateLOD(pixel_area, TRUE); + lod_changed |= joint->updateLOD(pixel_area, true); found_lod = true; } else { - lod_changed |= joint->updateLOD(pixel_area, FALSE); + lod_changed |= joint->updateLOD(pixel_area, false); } } } @@ -222,11 +222,11 @@ void LLAvatarJoint::setMeshesToChildren() LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume() { - mUpdateXform = FALSE; + mUpdateXform = false; } /*virtual*/ -U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) +U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, bool first_pass, bool is_dummy ) { LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL; return 0; @@ -234,7 +234,7 @@ U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL i LLVector3 LLAvatarJointCollisionVolume::getVolumePos(LLVector3 &offset) { - mUpdateXform = TRUE; + mUpdateXform = true; LLVector3 result = offset; result.scaleVec(getScale()); diff --git a/indra/llappearance/llavatarjoint.h b/indra/llappearance/llavatarjoint.h index 052852fa3d..09269bbc3f 100644 --- a/indra/llappearance/llavatarjoint.h +++ b/indra/llappearance/llavatarjoint.h @@ -52,14 +52,14 @@ public: virtual ~LLAvatarJoint(); // Gets the validity of this joint - BOOL getValid() { return mValid; } + bool getValid() { return mValid; } // Sets the validity of this joint - virtual void setValid( BOOL valid, BOOL recursive=FALSE ); + virtual void setValid( bool valid, bool recursive=false ); // Returns true if this object is transparent. // This is used to determine in which order to draw objects. - virtual BOOL isTransparent() { return mIsTransparent; } + virtual bool isTransparent() { return mIsTransparent; } // Returns true if this object should inherit scale modifiers from its immediate parent virtual bool inheritScale() { return false; } @@ -72,7 +72,7 @@ public: }; // Selects which skeleton components to draw - void setSkeletonComponents( U32 comp, BOOL recursive = TRUE ); + void setSkeletonComponents( U32 comp, bool recursive = true ); // Returns which skeleton components are enables for drawing U32 getSkeletonComponents() { return mComponents; } @@ -90,34 +90,34 @@ public: void setPickName(LLJointPickName name) { mPickName = name; } LLJointPickName getPickName() { return mPickName; } - void setVisible( BOOL visible, BOOL recursive ); + void setVisible( bool visible, bool recursive ); // Takes meshes in mMeshParts and sets each one as a child joint void setMeshesToChildren(); // LLViewerJoint interface - virtual U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ) = 0; + virtual U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) = 0; virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); + virtual void updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind = false, bool terse_update = false); virtual bool updateLOD(F32 pixel_area, bool activate); virtual void updateJointGeometry(); virtual void dump(); public: - static BOOL sDisableLOD; + static bool sDisableLOD; avatar_joint_mesh_list_t mMeshParts; //LLViewerJointMesh* void setMeshID( S32 id ) {mMeshID = id;} protected: void init(); - BOOL mValid; - BOOL mIsTransparent; + bool mValid; + bool mIsTransparent; U32 mComponents; F32 mMinPixelArea; LLJointPickName mPickName; - BOOL mVisible; + bool mVisible; S32 mMeshID; }; @@ -128,7 +128,7 @@ public: virtual ~LLAvatarJointCollisionVolume() {}; /*virtual*/ bool inheritScale() { return true; } - /*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ); + /*virtual*/ U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ); void renderCollision(); diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp index f34e23a966..9b2a1d9b4c 100644 --- a/indra/llappearance/llavatarjointmesh.cpp +++ b/indra/llappearance/llavatarjointmesh.cpp @@ -247,7 +247,7 @@ void LLAvatarJointMesh::setTexture( LLGLTexture *texture ) { mLayerSet = NULL; //texture->bindTexture(0); - //texture->setClamp(TRUE, TRUE); + //texture->setClamp(true, true); } } diff --git a/indra/llappearance/llavatarjointmesh.h b/indra/llappearance/llavatarjointmesh.h index a3f6a61218..57cf5a26f8 100644 --- a/indra/llappearance/llavatarjointmesh.h +++ b/indra/llappearance/llavatarjointmesh.h @@ -69,7 +69,7 @@ protected: LLTexLayerSet* mLayerSet; // ptr to a layer set owned by the avatar U32 mTestImageName; // handle to a temporary texture for previewing uploads LLPolyMesh* mMesh; // ptr to a global polymesh - BOOL mCullBackFaces; // true by default + bool mCullBackFaces; // true by default LLFace* mFace; // ptr to a face w/ AGP copy of mesh U32 mFaceIndexCount; @@ -131,7 +131,7 @@ public: // Gets ID for picking S32 getMeshID() { return mMeshID; } - void setIsTransparent(BOOL is_transparent) { mIsTransparent = is_transparent; } + void setIsTransparent(bool is_transparent) { mIsTransparent = is_transparent; } private: // Allocate skin data diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp index 83f2ab1266..e832176ae8 100644 --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -461,14 +461,14 @@ void LLDriverParam::stopAnimating() for(LLDrivenEntry& driven : mDriven) { - driven.mParam->setAnimating(FALSE); + driven.mParam->setAnimating(false); } } /*virtual*/ bool LLDriverParam::linkDrivenParams(visual_param_mapper mapper, bool only_cross_params) { - BOOL success = true; + bool success = true; for (LLDrivenEntryInfo& driven_info : getInfo()->mDrivenInfoList) { S32 driven_id = driven_info.mDrivenID; diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp index ff82e4e8e3..84c0fd8380 100644 --- a/indra/llappearance/lllocaltextureobject.cpp +++ b/indra/llappearance/lllocaltextureobject.cpp @@ -36,14 +36,14 @@ LLLocalTextureObject::LLLocalTextureObject() : - mIsBakedReady(FALSE), + mIsBakedReady(false), mDiscard(MAX_DISCARD_LEVEL+1) { mImage = NULL; } LLLocalTextureObject::LLLocalTextureObject(LLGLTexture* image, const LLUUID& id) : - mIsBakedReady(FALSE), + mIsBakedReady(false), mDiscard(MAX_DISCARD_LEVEL+1) { mImage = image; @@ -206,7 +206,7 @@ void LLLocalTextureObject::setDiscard(S32 new_discard) mDiscard = new_discard; } -void LLLocalTextureObject::setBakedReady(BOOL ready) +void LLLocalTextureObject::setBakedReady(bool ready) { mIsBakedReady = ready; } diff --git a/indra/llappearance/lllocaltextureobject.h b/indra/llappearance/lllocaltextureobject.h index 5ca503baf4..a5118ffde3 100644 --- a/indra/llappearance/lllocaltextureobject.h +++ b/indra/llappearance/lllocaltextureobject.h @@ -63,7 +63,7 @@ public: void setID(LLUUID new_id); void setDiscard(S32 new_discard); - void setBakedReady(BOOL ready); + void setBakedReady(bool ready); protected: @@ -78,7 +78,7 @@ private: LLUUID mID; - BOOL mIsBakedReady; + bool mIsBakedReady; S32 mDiscard; }; diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index a51d4dec7e..42a37c4e16 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -72,8 +72,8 @@ LLPolyMeshSharedData::LLPolyMeshSharedData() mTexCoords = NULL; mDetailTexCoords = NULL; mWeights = NULL; - mHasWeights = FALSE; - mHasDetailTexCoords = FALSE; + mHasWeights = false; + mHasDetailTexCoords = false; mNumFaces = 0; mFaces = NULL; @@ -615,7 +615,7 @@ bool LLPolyMeshSharedData::loadMesh( const std::string& fileName ) std::string morph_name(morphName); LLPolyMorphData* morph_data = new LLPolyMorphData(morph_name); - BOOL result = morph_data->loadBinary(fp, this); + bool result = morph_data->loadBinary(fp, this); if (!result) { @@ -705,12 +705,12 @@ bool LLPolyMeshSharedData::loadMesh( const std::string& fileName ) } } - status = TRUE; + status = true; } else { LL_ERRS() << "invalid mesh file header: " << fileName << LL_ENDL; - status = FALSE; + status = false; } if (0 == mNumJointNames) diff --git a/indra/llappearance/llpolymesh.h b/indra/llappearance/llpolymesh.h index 040868ea2a..e0822bf0e7 100644 --- a/indra/llappearance/llpolymesh.h +++ b/indra/llappearance/llpolymesh.h @@ -79,8 +79,8 @@ private: LLVector2 *mDetailTexCoords; F32 *mWeights; - BOOL mHasWeights; - BOOL mHasDetailTexCoords; + bool mHasWeights; + bool mHasDetailTexCoords; // face data S32 mNumFaces; @@ -138,7 +138,7 @@ public: const S32 *getSharedVert(S32 vert); - BOOL isLOD() { return (mReferenceData != NULL); } + bool isLOD() { return (mReferenceData != NULL); } }; @@ -204,13 +204,13 @@ public: } // Returns whether or not the mesh has detail texture coords - BOOL hasDetailTexCoords() { + bool hasDetailTexCoords() { llassert (mSharedData); return mSharedData->mHasDetailTexCoords; } // Returns whether or not the mesh has vertex weights - BOOL hasWeights() const{ + bool hasWeights() const{ llassert (mSharedData); return mSharedData->mHasWeights; } @@ -316,7 +316,7 @@ public: // Get indices U32* getIndices() { return mSharedData ? mSharedData->mTriangleIndices : NULL; } - BOOL isLOD() { return mSharedData && mSharedData->isLOD(); } + bool isLOD() { return mSharedData && mSharedData->isLOD(); } void setAvatar(LLAvatarAppearance* avatarp) { mAvatarp = avatarp; } LLAvatarAppearance* getAvatar() { return mAvatarp; } diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index 73811a550c..4b94ed48b1 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -256,7 +256,7 @@ void LLPolyMorphData::freeData() // LLPolyMorphTargetInfo() //----------------------------------------------------------------------------- LLPolyMorphTargetInfo::LLPolyMorphTargetInfo() - : mIsClothingMorph(FALSE) + : mIsClothingMorph(false) { } @@ -659,7 +659,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex ) //----------------------------------------------------------------------------- // applyMask() //----------------------------------------------------------------------------- -void LLPolyMorphTarget::applyMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert) +void LLPolyMorphTarget::applyMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, bool invert) { LLVector4a *clothing_weights = getInfo()->mIsClothingMorph ? mMesh->getWritableClothingWeights() : NULL; @@ -749,7 +749,7 @@ void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight) LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data) : mWeights(new F32[morph_data->mNumIndices]), mMorphData(morph_data), - mWeightsGenerated(FALSE) + mWeightsGenerated(false) { llassert(mMorphData != NULL); llassert(mMorphData->mNumIndices > 0); @@ -780,10 +780,10 @@ LLPolyVertexMask::~LLPolyVertexMask() //----------------------------------------------------------------------------- // generateMask() //----------------------------------------------------------------------------- -void LLPolyVertexMask::generateMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights) +void LLPolyVertexMask::generateMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, bool invert, LLVector4a *clothing_weights) { // RN debug output that uses Image Debugger (http://www.cs.unc.edu/~baxter/projects/imdebug/) -// BOOL debugImg = FALSE; +// bool debugImg = false; // if (debugImg) // { // if (invert) @@ -827,7 +827,7 @@ void LLPolyVertexMask::generateMask(const U8 *maskTextureData, S32 width, S32 he clothing_weights[vertIndex].getF32ptr()[VW] = mWeights[index]; } } - mWeightsGenerated = TRUE; + mWeightsGenerated = true; } //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index f52e9dce8d..5544344036 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -84,14 +84,14 @@ public: LLPolyVertexMask(const LLPolyVertexMask& pOther); ~LLPolyVertexMask(); - void generateMask(const U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights); + void generateMask(const U8 *maskData, S32 width, S32 height, S32 num_components, bool invert, LLVector4a *clothing_weights); F32* getMorphMaskWeights(); protected: F32* mWeights; LLPolyMorphData *mMorphData; - BOOL mWeightsGenerated; + bool mWeightsGenerated; }; @@ -133,7 +133,7 @@ public: protected: std::string mMorphName; - BOOL mIsClothingMorph; + bool mIsClothingMorph; typedef std::vector volume_info_list_t; volume_info_list_t mVolumeInfoList; }; @@ -159,7 +159,7 @@ public: /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; // LLVisualParam Virtual functions - ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); + ///*virtual*/ bool parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex sex ); // LLViewerVisualParam Virtual functions @@ -170,7 +170,7 @@ public: /*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh); /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh); - void applyMask(const U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert); + void applyMask(const U8 *maskData, S32 width, S32 height, S32 num_components, bool invert); void addPendingMorphMask() { mNumMorphMasksPending++; } void applyVolumeChanges(F32 delta_weight); // SL-315 - for resetSkeleton() @@ -183,7 +183,7 @@ protected: LLPolyVertexMask * mVertMask; ESex mLastSex; // number of morph masks that haven't been generated, must be 0 before this morph is applied - BOOL mNumMorphMasksPending; + BOOL mNumMorphMasksPending; typedef std::vector volume_list_t; volume_list_t mVolumeMorphs; diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index e8405ddb1f..3dd21ff62b 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -68,7 +68,7 @@ bool LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) std::string name; LLVector3 scale; LLVector3 pos; - BOOL haspos = false; + bool haspos = false; static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name"); if (!bone->getFastAttributeString(name_string, name)) diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index 83d9b90d69..4c69f7e70a 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -51,7 +51,7 @@ class LLAvatarAppearance; //----------------------------------------------------------------------------- struct LLPolySkeletalBoneInfo { - LLPolySkeletalBoneInfo(std::string &name, LLVector3 &scale, LLVector3 &pos, BOOL haspos) + LLPolySkeletalBoneInfo(std::string &name, LLVector3 &scale, LLVector3 &pos, bool haspos) : mBoneName(name), mScaleDeformation(scale), mPositionDeformation(pos), @@ -59,7 +59,7 @@ struct LLPolySkeletalBoneInfo std::string mBoneName; LLVector3 mScaleDeformation; LLVector3 mPositionDeformation; - BOOL mHasPositionDeformation; + bool mHasPositionDeformation; }; class alignas(16) LLPolySkeletalDistortionInfo : public LLViewerVisualParamInfo @@ -97,7 +97,7 @@ public: /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; // LLVisualParam Virtual functions - ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); + ///*virtual*/ bool parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex sex ); // LLViewerVisualParam Virtual functions diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index b450b1284e..cd416d6791 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -58,7 +58,7 @@ bool LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info) for (LLTexLayerParamColorInfo* color_info : mInfo->mParamColorInfoList) { LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this); - if (!param_color->setInfo(color_info, TRUE)) + if (!param_color->setInfo(color_info, true)) { mInfo = NULL; return false; diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 73ce5257e5..15a031f90c 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -60,16 +60,16 @@ public: ~LLTexLayerInfo(); bool parseXml(LLXmlTreeNode* node); - BOOL createVisualParams(LLAvatarAppearance *appearance); - BOOL isUserSettable() { return mLocalTexture != -1; } + bool createVisualParams(LLAvatarAppearance *appearance); + bool isUserSettable() { return mLocalTexture != -1; } S32 getLocalTexture() const { return mLocalTexture; } - BOOL getOnlyAlpha() const { return mUseLocalTextureAlphaOnly; } + bool getOnlyAlpha() const { return mUseLocalTextureAlphaOnly; } std::string getName() const { return mName; } private: std::string mName; - BOOL mWriteAllChannels; // Don't use masking. Just write RGBA into buffer, + bool mWriteAllChannels; // Don't use masking. Just write RGBA into buffer, LLTexLayerInterface::ERenderPass mRenderPass; std::string mGlobalColor; @@ -77,11 +77,11 @@ private: S32 mLocalTexture; std::string mStaticImageFileName; - BOOL mStaticImageIsMask; - BOOL mUseLocalTextureAlphaOnly; // Ignore RGB channels from the input texture. Use alpha as a mask - BOOL mIsVisibilityMask; + bool mStaticImageIsMask; + bool mUseLocalTextureAlphaOnly; // Ignore RGB channels from the input texture. Use alpha as a mask + bool mIsVisibilityMask; - typedef std::vector< std::pair< std::string,BOOL > > morph_name_list_t; + typedef std::vector< std::pair< std::string,bool > > morph_name_list_t; morph_name_list_t mMorphNameList; param_color_info_list_t mParamColorInfoList; param_alpha_info_list_t mParamAlphaInfoList; @@ -130,17 +130,17 @@ void LLTexLayerSetBuffer::preRenderTexLayerSet() } // virtual -void LLTexLayerSetBuffer::postRenderTexLayerSet(BOOL success) +void LLTexLayerSetBuffer::postRenderTexLayerSet(bool success) { popProjection(); } -BOOL LLTexLayerSetBuffer::renderTexLayerSet(LLRenderTarget* bound_target) +bool LLTexLayerSetBuffer::renderTexLayerSet(LLRenderTarget* bound_target) { // Default color mask for tex layer render gGL.setColorMask(true, true); - BOOL success = TRUE; + bool success = true; gAlphaMaskProgram.bind(); gAlphaMaskProgram.setMinimumAlpha(0.004f); @@ -175,7 +175,7 @@ LLTexLayerSetInfo::LLTexLayerSetInfo() : mBodyRegion( "" ), mWidth( 512 ), mHeight( 512 ), - mClearAlpha( TRUE ) + mClearAlpha( true ) { } @@ -252,11 +252,11 @@ void LLTexLayerSetInfo::createVisualParams(LLAvatarAppearance *appearance) // An ordered set of texture layers that get composited into a single texture. //----------------------------------------------------------------------------- -BOOL LLTexLayerSet::sHasCaches = FALSE; +bool LLTexLayerSet::sHasCaches = false; LLTexLayerSet::LLTexLayerSet(LLAvatarAppearance* const appearance) : mAvatarAppearance( appearance ), - mIsVisible( TRUE ), + mIsVisible( true ), mBakedTexIndex(LLAvatarAppearanceDefines::BAKED_HEAD), mInfo( NULL ) { @@ -277,7 +277,7 @@ LLTexLayerSet::~LLTexLayerSet() // setInfo //----------------------------------------------------------------------------- -BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) +bool LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) { llassert(mInfo == NULL); mInfo = info; @@ -323,7 +323,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) // parseData //----------------------------------------------------------------------------- -BOOL LLTexLayerSet::parseData(LLXmlTreeNode* node) +bool LLTexLayerSet::parseData(LLXmlTreeNode* node) { LLTexLayerSetInfo *info = new LLTexLayerSetInfo; @@ -354,10 +354,10 @@ void LLTexLayerSet::deleteCaches() } -BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target ) +bool LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target ) { - BOOL success = TRUE; - mIsVisible = TRUE; + bool success = true; + mIsVisible = true; if (mMaskLayerList.size() > 0) { @@ -365,7 +365,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* { if (layer->isInvisibleAlphaMask()) { - mIsVisible = FALSE; + mIsVisible = false; } } } @@ -425,8 +425,8 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* } -BOOL LLTexLayerSet::isBodyRegion(const std::string& region) const -{ +bool LLTexLayerSet::isBodyRegion(const std::string& region) const +{ return mInfo->mBodyRegion == region; } @@ -484,7 +484,7 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, { gGL.flush(); { - LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(info->mStaticAlphaFileName, TRUE); + LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(info->mStaticAlphaFileName, true); if( tex ) { LLGLSUIDefault gls_ui; @@ -533,7 +533,7 @@ void LLTexLayerSet::applyMorphMask(const U8* tex_data, S32 width, S32 height, S3 mAvatarAppearance->applyMorphMask(tex_data, width, height, num_components, mBakedTexIndex); } -BOOL LLTexLayerSet::isMorphValid() const +bool LLTexLayerSet::isMorphValid() const { for(const LLTexLayerInterface* layer : mLayerList) { @@ -561,13 +561,13 @@ void LLTexLayerSet::invalidateMorphMasks() // LLTexLayerInfo //----------------------------------------------------------------------------- LLTexLayerInfo::LLTexLayerInfo() : - mWriteAllChannels( FALSE ), + mWriteAllChannels( false ), mRenderPass(LLTexLayer::RP_COLOR), mFixedColor( 0.f, 0.f, 0.f, 0.f ), mLocalTexture( -1 ), - mStaticImageIsMask( FALSE ), - mUseLocalTextureAlphaOnly(FALSE), - mIsVisibilityMask(FALSE) + mStaticImageIsMask( false ), + mUseLocalTextureAlphaOnly(false), + mIsVisibilityMask(false) { } @@ -609,7 +609,7 @@ bool LLTexLayerInfo::parseXml(LLXmlTreeNode* node) node->getFastAttributeString( global_color_string, mGlobalColor ); // Visibility mask (optional) - BOOL is_visibility; + bool is_visibility; static LLStdStringHandle visibility_mask_string = LLXmlTree::addAttributeString("visibility_mask"); if (node->getFastAttributeBOOL(visibility_mask_string, is_visibility)) { @@ -675,10 +675,10 @@ bool LLTexLayerInfo::parseXml(LLXmlTreeNode* node) static LLStdStringHandle morph_name_string = LLXmlTree::addAttributeString("morph_name"); if (maskNode->getFastAttributeString(morph_name_string, morph_name)) { - BOOL invert = FALSE; + bool invert = false; static LLStdStringHandle invert_string = LLXmlTree::addAttributeString("invert"); maskNode->getFastAttributeBOOL(invert_string, invert); - mMorphNameList.push_back(std::pair(morph_name,invert)); + mMorphNameList.push_back(std::pair(morph_name,invert)); } } @@ -714,28 +714,28 @@ bool LLTexLayerInfo::parseXml(LLXmlTreeNode* node) return true; } -BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) +bool LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) { - BOOL success = true; + bool success = true; for (LLTexLayerParamColorInfo* color_info : mParamColorInfoList) { LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance); - if (!param_color->setInfo(color_info, TRUE)) + if (!param_color->setInfo(color_info, true)) { LL_WARNS() << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << LL_ENDL; delete param_color; - success = FALSE; + success = false; } } for (LLTexLayerParamAlphaInfo* alpha_info : mParamAlphaInfoList) { LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance); - if (!param_alpha->setInfo(alpha_info, TRUE)) + if (!param_alpha->setInfo(alpha_info, true)) { LL_WARNS() << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << LL_ENDL; delete param_alpha; - success = FALSE; + success = false; } } @@ -744,9 +744,9 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) LLTexLayerInterface::LLTexLayerInterface(LLTexLayerSet* const layer_set): mTexLayerSet( layer_set ), - mMorphMasksValid( FALSE ), + mMorphMasksValid( false ), mInfo(NULL), - mHasMorph(FALSE) + mHasMorph(false) { } @@ -760,7 +760,7 @@ LLTexLayerInterface::LLTexLayerInterface(const LLTexLayerInterface &layer, LLWea mHasMorph = layer.mHasMorph; } -BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearable ) // This sets mInfo and calls initialization functions +bool LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearable ) // This sets mInfo and calls initialization functions { // setInfo should only be called once. Code is not robust enough to handle redefinition of a texlayer. // Not a critical warning, but could be useful for debugging later issues. -Nyx @@ -778,7 +778,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab if (!wearable) { param_color = new LLTexLayerParamColor(this); - if (!param_color->setInfo(color_info, TRUE)) + if (!param_color->setInfo(color_info, true)) { mInfo = NULL; return false; @@ -803,7 +803,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab if (!wearable) { param_alpha = new LLTexLayerParamAlpha( this ); - if (!param_alpha->setInfo(alpha_info, TRUE)) + if (!param_alpha->setInfo(alpha_info, true)) { mInfo = NULL; return false; @@ -893,14 +893,14 @@ const std::string& LLTexLayerInterface::getGlobalColor() const return mInfo->mGlobalColor; } -BOOL LLTexLayerInterface::isVisibilityMask() const +bool LLTexLayerInterface::isVisibilityMask() const { return mInfo->mIsVisibilityMask; } void LLTexLayerInterface::invalidateMorphMasks() { - mMorphMasksValid = FALSE; + mMorphMasksValid = false; } LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const @@ -980,7 +980,7 @@ void LLTexLayer::asLLSD(LLSD& sd) const // setInfo //----------------------------------------------------------------------------- -BOOL LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable ) +bool LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable ) { return LLTexLayerInterface::setInfo(info, wearable); } @@ -1020,14 +1020,14 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL } } -BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) +bool LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) { // *TODO: Is this correct? //gPipeline.disableLights(); stop_glerror(); LLColor4 net_color; - BOOL color_specified = findNetColor(&net_color); + bool color_specified = findNetColor(&net_color); if (mTexLayerSet->getAvatarAppearance()->mIsDummy) { @@ -1035,7 +1035,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou net_color = LLAvatarAppearance::getDummyColor(); } - BOOL success = TRUE; + bool success = true; // If you can't see the layer, don't render it. if( is_approx_zero( net_color.mV[VW] ) ) @@ -1043,7 +1043,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou return success; } - BOOL alpha_mask_specified = FALSE; + bool alpha_mask_specified = false; param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); if( iter != mParamAlphaList.end() ) { @@ -1051,7 +1051,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou // However, we can't do this optimization if we have morph masks that need updating. /* if (!mHasMorph) { - BOOL skip_layer = TRUE; + bool skip_layer = true; while( iter != mParamAlphaList.end() ) { @@ -1059,7 +1059,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou if( !param->getSkip() ) { - skip_layer = FALSE; + skip_layer = false; break; } @@ -1074,7 +1074,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou const bool force_render = true; renderMorphMasks(x, y, width, height, net_color, bound_target, force_render); - alpha_mask_specified = TRUE; + alpha_mask_specified = true; gGL.flush(); gGL.blendFunc(LLRender::BF_DEST_ALPHA, LLRender::BF_ONE_MINUS_DEST_ALPHA); } @@ -1115,7 +1115,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode(); - gGL.getTexUnit(0)->bind(tex, TRUE); + gGL.getTexUnit(0)->bind(tex, true); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); gl_rect_2d_simple_tex( width, height ); @@ -1130,7 +1130,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou } // else // { -// success = FALSE; +// success = false; // } } } @@ -1141,13 +1141,13 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture(getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask); if( tex ) { - gGL.getTexUnit(0)->bind(tex, TRUE); + gGL.getTexUnit(0)->bind(tex, true); gl_rect_2d_simple_tex( width, height ); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } else { - success = FALSE; + success = false; } } } @@ -1199,7 +1199,7 @@ const U8* LLTexLayer::getAlphaData() const return (iter2 == mAlphaCache.end()) ? 0 : iter2->second; } -BOOL LLTexLayer::findNetColor(LLColor4* net_color) const +bool LLTexLayer::findNetColor(LLColor4* net_color) const { // Color is either: // * one or more color parameters (weighted colors) (which may make use of a global color or fixed color) @@ -1243,9 +1243,9 @@ BOOL LLTexLayer::findNetColor(LLColor4* net_color) const return false; // No need to draw a separate colored polygon } -BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) +bool LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) { - BOOL success = true; + bool success = true; gGL.flush(); @@ -1255,14 +1255,14 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) if( tex ) { gAlphaMaskProgram.setMinimumAlpha(0.f); - gGL.getTexUnit(0)->bind(tex, TRUE); + gGL.getTexUnit(0)->bind(tex, true); gl_rect_2d_simple_tex( width, height ); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gAlphaMaskProgram.setMinimumAlpha(0.004f); } else { - success = FALSE; + success = false; } } else @@ -1297,7 +1297,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC return; } LL_PROFILE_ZONE_SCOPED; - BOOL success = TRUE; + bool success = true; llassert( !mParamAlphaList.empty() ); @@ -1342,7 +1342,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC { LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode(); - gGL.getTexUnit(0)->bind(tex, TRUE); + gGL.getTexUnit(0)->bind(tex, true); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); gl_rect_2d_simple_tex( width, height ); @@ -1359,7 +1359,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC { if( (tex->getComponents() == 4) || (tex->getComponents() == 1) ) { - gGL.getTexUnit(0)->bind(tex, TRUE); + gGL.getTexUnit(0)->bind(tex, true); gl_rect_2d_simple_tex( width, height ); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } @@ -1480,7 +1480,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC getTexLayerSet()->getAvatarAppearance()->dirtyMesh(); - mMorphMasksValid = TRUE; + mMorphMasksValid = true; getTexLayerSet()->applyMorphMask(alpha_data, width, height, 1); } } @@ -1513,7 +1513,7 @@ void LLTexLayer::addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 } } -/*virtual*/ BOOL LLTexLayer::isInvisibleAlphaMask() const +/*virtual*/ bool LLTexLayer::isInvisibleAlphaMask() const { if (mLocalTextureObject) { @@ -1582,7 +1582,7 @@ LLTexLayerTemplate::~LLTexLayerTemplate() // setInfo //----------------------------------------------------------------------------- -/*virtual*/ BOOL LLTexLayerTemplate::setInfo(const LLTexLayerInfo* info, LLWearable* wearable ) +/*virtual*/ bool LLTexLayerTemplate::setInfo(const LLTexLayerInfo* info, LLWearable* wearable ) { return LLTexLayerInterface::setInfo(info, wearable); } @@ -1631,14 +1631,14 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const return layer; } -/*virtual*/ BOOL LLTexLayerTemplate::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) +/*virtual*/ bool LLTexLayerTemplate::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) { if(!mInfo) { - return FALSE ; + return false ; } - BOOL success = TRUE; + bool success = true; updateWearableCache(); for (LLWearable* wearable : mWearableCache) { @@ -1663,9 +1663,9 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const return success; } -/*virtual*/ BOOL LLTexLayerTemplate::blendAlphaTexture( S32 x, S32 y, S32 width, S32 height) // Multiplies a single alpha texture against the frame buffer +/*virtual*/ bool LLTexLayerTemplate::blendAlphaTexture( S32 x, S32 y, S32 width, S32 height) // Multiplies a single alpha texture against the frame buffer { - BOOL success = TRUE; + bool success = true; U32 num_wearables = updateWearableCache(); for (U32 i = 0; i < num_wearables; i++) { @@ -1689,8 +1689,8 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const } } -/*virtual*/ void LLTexLayerTemplate::setHasMorph(BOOL newval) -{ +/*virtual*/ void LLTexLayerTemplate::setHasMorph(bool newval) +{ mHasMorph = newval; U32 num_wearables = updateWearableCache(); for (U32 i = 0; i < num_wearables; i++) @@ -1716,7 +1716,7 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const } } -/*virtual*/ BOOL LLTexLayerTemplate::isInvisibleAlphaMask() const +/*virtual*/ bool LLTexLayerTemplate::isInvisibleAlphaMask() const { U32 num_wearables = updateWearableCache(); for (U32 i = 0; i < num_wearables; i++) @@ -1853,7 +1853,7 @@ LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name) // Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name. // Caches the result to speed identical subsequent requests. -LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, BOOL is_mask) +LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, bool is_mask) { LL_PROFILE_ZONE_SCOPED; LLPointer tex; @@ -1867,7 +1867,7 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, else { llassert(gTextureManagerBridgep); - tex = gTextureManagerBridgep->getLocalTexture( FALSE ); + tex = gTextureManagerBridgep->getLocalTexture( false ); LLPointer image_raw = new LLImageRaw; if( loadImageRaw( file_name, image_raw ) ) { @@ -1883,7 +1883,7 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black); } - tex->createGLTexture(0, image_raw, 0, TRUE, LLGLTexture::LOCAL); + tex->createGLTexture(0, image_raw, 0, true, LLGLTexture::LOCAL); gGL.getTexUnit(0)->bind(tex); tex->setAddressMode(LLTexUnit::TAM_CLAMP); @@ -1901,11 +1901,11 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, } // Reads a .tga file, decodes it, and puts the decoded data in image_raw. -// Returns TRUE if successful. -BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw) +// Returns true if successful. +bool LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw) { LL_PROFILE_ZONE_SCOPED; - BOOL success = FALSE; + bool success = false; std::string path; path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,file_name); LLPointer image_tga = new LLImageTGA( path ); diff --git a/indra/llappearance/lltexlayer.h b/indra/llappearance/lltexlayer.h index 2cca2b6b12..bc55db01fc 100644 --- a/indra/llappearance/lltexlayer.h +++ b/indra/llappearance/lltexlayer.h @@ -65,13 +65,13 @@ public: LLTexLayerInterface(const LLTexLayerInterface &layer, LLWearable *wearable); virtual ~LLTexLayerInterface() {} - virtual BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) = 0; + virtual bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) = 0; virtual void deleteCaches() = 0; - virtual BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) = 0; - virtual BOOL isInvisibleAlphaMask() const = 0; + virtual bool blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) = 0; + virtual bool isInvisibleAlphaMask() const = 0; const LLTexLayerInfo* getInfo() const { return mInfo; } - virtual BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // sets mInfo, calls initialization functions + virtual bool setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // sets mInfo, calls initialization functions LLWearableType::EType getWearableType() const; LLAvatarAppearanceDefines::ETextureIndex getLocalTextureIndex() const; @@ -80,16 +80,16 @@ public: LLTexLayerSet* const getTexLayerSet() { return mTexLayerSet; } void invalidateMorphMasks(); - virtual void setHasMorph(BOOL newval) { mHasMorph = newval; } - BOOL hasMorph() const { return mHasMorph; } - BOOL isMorphValid() const { return mMorphMasksValid; } + virtual void setHasMorph(bool newval) { mHasMorph = newval; } + bool hasMorph() const { return mHasMorph; } + bool isMorphValid() const { return mMorphMasksValid; } void requestUpdate(); virtual void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target) = 0; - BOOL hasAlphaParams() const { return !mParamAlphaList.empty(); } + bool hasAlphaParams() const { return !mParamAlphaList.empty(); } ERenderPass getRenderPass() const; - BOOL isVisibilityMask() const; + bool isVisibilityMask() const; virtual void asLLSD(LLSD& sd) const {} @@ -100,8 +100,8 @@ protected: protected: LLTexLayerSet* const mTexLayerSet; const LLTexLayerInfo* mInfo; - BOOL mMorphMasksValid; - BOOL mHasMorph; + bool mMorphMasksValid; + bool mHasMorph; // Layers can have either mParamColorList, mGlobalColor, or mFixedColor. They are looked for in that order. param_color_list_t mParamColorList; @@ -121,13 +121,13 @@ public: LLTexLayerTemplate(LLTexLayerSet* const layer_set, LLAvatarAppearance* const appearance); LLTexLayerTemplate(const LLTexLayerTemplate &layer); /*virtual*/ ~LLTexLayerTemplate(); - /*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target); - /*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions - /*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer + /*virtual*/ bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target); + /*virtual*/ bool setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions + /*virtual*/ bool blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer /*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target); - /*virtual*/ void setHasMorph(BOOL newval); + /*virtual*/ void setHasMorph(bool newval); /*virtual*/ void deleteCaches(); - /*virtual*/ BOOL isInvisibleAlphaMask() const; + /*virtual*/ bool isInvisibleAlphaMask() const; protected: U32 updateWearableCache() const; LLTexLayer* getLayer(U32 i) const; @@ -151,18 +151,18 @@ public: LLTexLayer(const LLTexLayerTemplate &layer_template, LLLocalTextureObject *lto, LLWearable *wearable); /*virtual*/ ~LLTexLayer(); - /*virtual*/ BOOL setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions - /*virtual*/ BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target); + /*virtual*/ bool setInfo(const LLTexLayerInfo *info, LLWearable* wearable); // This sets mInfo and calls initialization functions + /*virtual*/ bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target); /*virtual*/ void deleteCaches(); const U8* getAlphaData() const; - BOOL findNetColor(LLColor4* color) const; - /*virtual*/ BOOL blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer + bool findNetColor(LLColor4* color) const; + /*virtual*/ bool blendAlphaTexture(S32 x, S32 y, S32 width, S32 height); // Multiplies a single alpha texture against the frame buffer /*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target); void renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, LLRenderTarget* bound_target, bool force_render); void addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height, LLRenderTarget* bound_target); - /*virtual*/ BOOL isInvisibleAlphaMask() const; + /*virtual*/ bool isInvisibleAlphaMask() const; void setLTO(LLLocalTextureObject *lto) { mLocalTextureObject = lto; } LLLocalTextureObject* getLTO() { return mLocalTextureObject; } @@ -197,14 +197,14 @@ public: void gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height, LLRenderTarget* bound_target); const LLTexLayerSetInfo* getInfo() const { return mInfo; } - BOOL setInfo(const LLTexLayerSetInfo *info); // This sets mInfo and calls initialization functions + bool setInfo(const LLTexLayerSetInfo *info); // This sets mInfo and calls initialization functions - BOOL render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr); + bool render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr); void renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target = nullptr, bool forceClear = false); - BOOL isBodyRegion(const std::string& region) const; + bool isBodyRegion(const std::string& region) const; void applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components); - BOOL isMorphValid() const; + bool isMorphValid() const; virtual void requestUpdate() = 0; void invalidateMorphMasks(); void deleteCaches(); @@ -213,12 +213,12 @@ public: LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; } const std::string getBodyRegionName() const; - BOOL hasComposite() const { return (mComposite.notNull()); } + bool hasComposite() const { return (mComposite.notNull()); } LLAvatarAppearanceDefines::EBakedTextureIndex getBakedTexIndex() const { return mBakedTexIndex; } void setBakedTexIndex(LLAvatarAppearanceDefines::EBakedTextureIndex index) { mBakedTexIndex = index; } - BOOL isVisible() const { return mIsVisible; } + bool isVisible() const { return mIsVisible; } - static BOOL sHasCaches; + static bool sHasCaches; protected: typedef std::vector layer_list_t; @@ -226,7 +226,7 @@ protected: layer_list_t mMaskLayerList; LLPointer mComposite; LLAvatarAppearance* const mAvatarAppearance; // note: backlink only; don't make this an LLPointer. - BOOL mIsVisible; + bool mIsVisible; LLAvatarAppearanceDefines::EBakedTextureIndex mBakedTexIndex; const LLTexLayerSetInfo* mInfo; @@ -252,7 +252,7 @@ protected: S32 mWidth; S32 mHeight; std::string mStaticAlphaFileName; - BOOL mClearAlpha; // Set alpha to 1 for this layerset (if there is no mStaticAlphaFileName) + bool mClearAlpha; // Set alpha to 1 for this layerset (if there is no mStaticAlphaFileName) typedef std::vector layer_info_list_t; layer_info_list_t mLayerInfoList; }; @@ -274,13 +274,13 @@ protected: void pushProjection() const; void popProjection() const; virtual void preRenderTexLayerSet(); - virtual void midRenderTexLayerSet(BOOL success) {} - virtual void postRenderTexLayerSet(BOOL success); + virtual void midRenderTexLayerSet(bool success) {} + virtual void postRenderTexLayerSet(bool success); virtual S32 getCompositeOriginX() const = 0; virtual S32 getCompositeOriginY() const = 0; virtual S32 getCompositeWidth() const = 0; virtual S32 getCompositeHeight() const = 0; - BOOL renderTexLayerSet(LLRenderTarget* bound_target); + bool renderTexLayerSet(LLRenderTarget* bound_target); LLTexLayerSet* const mTexLayerSet; }; @@ -294,12 +294,12 @@ class LLTexLayerStaticImageList : public LLSingleton LLSINGLETON(LLTexLayerStaticImageList); ~LLTexLayerStaticImageList(); public: - LLGLTexture* getTexture(const std::string& file_name, BOOL is_mask); + LLGLTexture* getTexture(const std::string& file_name, bool is_mask); LLImageTGA* getImageTGA(const std::string& file_name); void deleteCachedImages(); void dumpByteCount() const; protected: - BOOL loadImageRaw(const std::string& file_name, LLImageRaw* image_raw); + bool loadImageRaw(const std::string& file_name, LLImageRaw* image_raw); private: LLStringTable mImageNames; typedef std::map > texture_map_t; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 4cfbdc01c1..8ad718a506 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -69,7 +69,7 @@ LLTexLayerParam::LLTexLayerParam(const LLTexLayerParam& pOther) { } -BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance) +bool LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, bool add_to_appearance) { LLViewerVisualParam::setInfo(info); @@ -123,8 +123,8 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) mCachedProcessedTexture(NULL), mStaticImageTGA(), mStaticImageRaw(), - mNeedsCreateTexture(FALSE), - mStaticImageInvalid(FALSE), + mNeedsCreateTexture(false), + mStaticImageInvalid(false), mAvgDistortionVec(1.f, 1.f, 1.f), mCachedEffectiveWeight(0.f) { @@ -136,8 +136,8 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) mCachedProcessedTexture(NULL), mStaticImageTGA(), mStaticImageRaw(), - mNeedsCreateTexture(FALSE), - mStaticImageInvalid(FALSE), + mNeedsCreateTexture(false), + mStaticImageInvalid(false), mAvgDistortionVec(1.f, 1.f, 1.f), mCachedEffectiveWeight(0.f) { @@ -173,10 +173,10 @@ void LLTexLayerParamAlpha::deleteCaches() mStaticImageTGA = NULL; // deletes image mCachedProcessedTexture = NULL; mStaticImageRaw = NULL; - mNeedsCreateTexture = FALSE; + mNeedsCreateTexture = false; } -BOOL LLTexLayerParamAlpha::getMultiplyBlend() const +bool LLTexLayerParamAlpha::getMultiplyBlend() const { return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend; } @@ -216,7 +216,7 @@ void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value) mTargetWeight = target_value; setWeight(target_value); - mIsAnimating = TRUE; + mIsAnimating = true; if (mNext) { mNext->setAnimationTarget(target_value); @@ -231,7 +231,7 @@ void LLTexLayerParamAlpha::animate(F32 delta) } } -BOOL LLTexLayerParamAlpha::getSkip() const +bool LLTexLayerParamAlpha::getSkip() const { if (!mTexLayer) { @@ -259,10 +259,10 @@ BOOL LLTexLayerParamAlpha::getSkip() const } -BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) +bool LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) { LL_PROFILE_ZONE_SCOPED; - BOOL success = true; + bool success = true; if (!mTexLayer) { @@ -270,7 +270,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) } F32 effective_weight = (mTexLayer->getTexLayerSet()->getAvatarAppearance()->getSex() & getSex()) ? mCurWeight : getDefaultWeight(); - BOOL weight_changed = effective_weight != mCachedEffectiveWeight; + bool weight_changed = effective_weight != mCachedEffectiveWeight; if (getSkip()) { return success; @@ -294,12 +294,12 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) // Don't load the image file until we actually need it the first time. Like now. mStaticImageTGA = LLTexLayerStaticImageList::getInstance()->getImageTGA(info->mStaticImageFileName); // We now have something in one of our caches - LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull() ? TRUE : FALSE; + LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull() ? true : false; if (mStaticImageTGA.isNull()) { LL_WARNS() << "Unable to load static file: " << info->mStaticImageFileName << LL_ENDL; - mStaticImageInvalid = TRUE; // don't try again. + mStaticImageInvalid = true; // don't try again. return false; } } @@ -316,10 +316,10 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) if (!mCachedProcessedTexture) { llassert(gTextureManagerBridgep); - mCachedProcessedTexture = gTextureManagerBridgep->getLocalTexture(image_tga_width, image_tga_height, 1, FALSE); + mCachedProcessedTexture = gTextureManagerBridgep->getLocalTexture(image_tga_width, image_tga_height, 1, false); // We now have something in one of our caches - LLTexLayerSet::sHasCaches |= mCachedProcessedTexture ? TRUE : FALSE; + LLTexLayerSet::sHasCaches |= mCachedProcessedTexture ? true : false; mCachedProcessedTexture->setExplicitFormat(GL_ALPHA8, GL_ALPHA); } @@ -328,7 +328,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) mStaticImageRaw = NULL; mStaticImageRaw = new LLImageRaw; mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight); - mNeedsCreateTexture = TRUE; + mNeedsCreateTexture = true; LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL; } @@ -339,7 +339,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) if (mNeedsCreateTexture) { mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw); - mNeedsCreateTexture = FALSE; + mNeedsCreateTexture = false; gGL.getTexUnit(0)->bind(mCachedProcessedTexture); mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP); } @@ -372,8 +372,8 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) // LLTexLayerParamAlphaInfo //----------------------------------------------------------------------------- LLTexLayerParamAlphaInfo::LLTexLayerParamAlphaInfo() : - mMultiplyBlend(FALSE), - mSkipIfZeroWeight(FALSE), + mMultiplyBlend(false), + mSkipIfZeroWeight(false), mDomain(0.f) { } @@ -514,7 +514,7 @@ void LLTexLayerParamColor::setAnimationTarget(F32 target_value) // set value first then set interpolating flag to ignore further updates mTargetWeight = target_value; setWeight(target_value); - mIsAnimating = TRUE; + mIsAnimating = true; if (mNext) { mNext->setAnimationTarget(target_value); diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index 1dbfd0b3d6..3767a9627f 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -48,7 +48,7 @@ class LLTexLayerParam : public LLViewerVisualParam public: LLTexLayerParam(LLTexLayerInterface *layer); LLTexLayerParam(LLAvatarAppearance *appearance); - /*virtual*/ BOOL setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance); + /*virtual*/ bool setInfo(LLViewerVisualParamInfo *info, bool add_to_appearance); /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0; protected: @@ -74,7 +74,7 @@ public: /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const; // LLVisualParam Virtual functions - ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); + ///*virtual*/ bool parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) {} /*virtual*/ void setWeight(F32 weight); /*virtual*/ void setAnimationTarget(F32 target_value); @@ -89,10 +89,10 @@ public: /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) { index = 0; poly_mesh = NULL; return NULL;}; // New functions - BOOL render( S32 x, S32 y, S32 width, S32 height ); - BOOL getSkip() const; + bool render( S32 x, S32 y, S32 width, S32 height ); + bool getSkip() const; void deleteCaches(); - BOOL getMultiplyBlend() const; + bool getMultiplyBlend() const; private: LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther); @@ -100,8 +100,8 @@ private: LLPointer mCachedProcessedTexture; LLPointer mStaticImageTGA; LLPointer mStaticImageRaw; - std::atomic mNeedsCreateTexture; - BOOL mStaticImageInvalid; + std::atomic mNeedsCreateTexture; + bool mStaticImageInvalid; LL_ALIGN_16(LLVector4a mAvgDistortionVec); F32 mCachedEffectiveWeight; @@ -124,8 +124,8 @@ public: private: std::string mStaticImageFileName; - BOOL mMultiplyBlend; - BOOL mSkipIfZeroWeight; + bool mMultiplyBlend; + bool mSkipIfZeroWeight; F32 mDomain; }; // @@ -157,7 +157,7 @@ public: /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const; // LLVisualParam Virtual functions - ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); + ///*virtual*/ bool parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) {} /*virtual*/ void setWeight(F32 weight); /*virtual*/ void setAnimationTarget(F32 target_value); diff --git a/indra/llappearance/llviewervisualparam.cpp b/indra/llappearance/llviewervisualparam.cpp index 43fb8fab5e..30a244be93 100644 --- a/indra/llappearance/llviewervisualparam.cpp +++ b/indra/llappearance/llviewervisualparam.cpp @@ -39,12 +39,12 @@ LLViewerVisualParamInfo::LLViewerVisualParamInfo() : mWearableType( LLWearableType::WT_INVALID ), - mCrossWearable(FALSE), + mCrossWearable(false), mCamDist( 0.5f ), mCamAngle( 0.f ), mCamElevation( 0.f ), mEditGroupDisplayOrder( 0 ), - mShowSimple(FALSE), + mShowSimple(false), mSimpleMin(0.f), mSimpleMax(100.f) { @@ -82,7 +82,7 @@ bool LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node) static LLStdStringHandle cross_wearable_string = LLXmlTree::addAttributeString("cross_wearable"); if (!node->getFastAttributeBOOL(cross_wearable_string, mCrossWearable)) { - mCrossWearable = FALSE; + mCrossWearable = false; } // Optional camera offsets from the current joint center. Used for generating "hints" (thumbnails). @@ -146,7 +146,7 @@ LLViewerVisualParam::~LLViewerVisualParam() // setInfo() //----------------------------------------------------------------------------- -BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info) +bool LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info) { llassert(mInfo == NULL); if (info->mID < 0) diff --git a/indra/llappearance/llviewervisualparam.h b/indra/llappearance/llviewervisualparam.h index 9ad3e6eae8..42c32aa319 100644 --- a/indra/llappearance/llviewervisualparam.h +++ b/indra/llappearance/llviewervisualparam.h @@ -49,13 +49,13 @@ public: protected: S32 mWearableType; - BOOL mCrossWearable; + bool mCrossWearable; std::string mEditGroup; F32 mCamDist; F32 mCamAngle; // degrees F32 mCamElevation; F32 mEditGroupDisplayOrder; - BOOL mShowSimple; // show edit controls when in "simple ui" mode? + bool mShowSimple; // show edit controls when in "simple ui" mode? F32 mSimpleMin; // when in simple UI, apply this minimum, range 0.f to 100.f F32 mSimpleMax; // when in simple UI, apply this maximum, range 0.f to 100.f }; @@ -75,12 +75,12 @@ public: // Special: These functions are overridden by child classes LLViewerVisualParamInfo *getInfo() const { return (LLViewerVisualParamInfo*)mInfo; }; // This sets mInfo and calls initialization functions - BOOL setInfo(LLViewerVisualParamInfo *info); + bool setInfo(LLViewerVisualParamInfo *info); virtual LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0; // LLVisualParam Virtual functions - ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); + ///*virtual*/ bool parseData(LLXmlTreeNode* node); // New Virtual functions virtual F32 getTotalDistortion() = 0; @@ -99,11 +99,11 @@ public: F32 getCameraAngle() const { return getInfo()->mCamAngle; } // degrees F32 getCameraElevation() const { return getInfo()->mCamElevation; } - BOOL getShowSimple() const { return getInfo()->mShowSimple; } + bool getShowSimple() const { return getInfo()->mShowSimple; } F32 getSimpleMin() const { return getInfo()->mSimpleMin; } F32 getSimpleMax() const { return getInfo()->mSimpleMax; } - BOOL getCrossWearable() const { return getInfo()->mCrossWearable; } + bool getCrossWearable() const { return getInfo()->mCrossWearable; } protected: LLViewerVisualParam(const LLViewerVisualParam& pOther); diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index db7db32b3e..853b850fed 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -86,14 +86,14 @@ LLAssetType::EType LLWearable::getAssetType() const return LLWearableType::getInstance()->getAssetType(mType); } -BOOL LLWearable::exportFile(const std::string& filename) const +bool LLWearable::exportFile(const std::string& filename) const { llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); return ofs.is_open() && exportStream(ofs); } // virtual -BOOL LLWearable::exportStream( std::ostream& output_stream ) const +bool LLWearable::exportStream( std::ostream& output_stream ) const { if (!output_stream.good()) return false; @@ -469,7 +469,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, return LLWearable::SUCCESS; } -BOOL LLWearable::getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size) +bool LLWearable::getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size) { if (!input_stream.good()) { @@ -636,7 +636,7 @@ void LLWearable::addVisualParam(LLVisualParam *param) { delete mVisualParamIndexMap[param->getID()]; } - param->setIsDummy(FALSE); + param->setIsDummy(false); param->setParamLocation(LOC_WEARABLE); mVisualParamIndexMap[param->getID()] = param; mSavedVisualParamMap[param->getID()] = param->getDefaultWeight(); diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h index d86db236a3..ccdb3273f2 100644 --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -80,9 +80,9 @@ public: SUCCESS, BAD_HEADER }; - BOOL exportFile(const std::string& filename) const; + bool exportFile(const std::string& filename) const; EImportResult importFile(const std::string& filename, LLAvatarAppearance* avatarp ); - virtual BOOL exportStream( std::ostream& output_stream ) const; + virtual bool exportStream( std::ostream& output_stream ) const; virtual EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ); static void setCurrentDefinitionVersion( S32 version ) { LLWearable::sCurrentDefinitionVersion = version; } @@ -118,7 +118,7 @@ protected: void destroyTextures(); void createVisualParams(LLAvatarAppearance *avatarp); void createLayers(S32 te, LLAvatarAppearance *avatarp); - BOOL getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size); + bool getNextPopulatedLine(std::istream& input_stream, char* buffer, U32 buffer_size); static S32 sCurrentDefinitionVersion; // Depends on the current state of the avatar_lad.xml. S32 mDefinitionVersion; // Depends on the state of the avatar_lad.xml when this asset was created. diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp index 2a0b77ee39..db5c93352a 100644 --- a/indra/llappearance/llwearabledata.cpp +++ b/indra/llappearance/llwearabledata.cpp @@ -86,7 +86,7 @@ void LLWearableData::setWearable(const LLWearableType::EType type, U32 index, LL { wearable_vec[index] = wearable; old_wearable->setUpdated(); - const BOOL removed = FALSE; + const bool removed = false; wearableUpdated(wearable, removed); } } @@ -105,14 +105,14 @@ void LLWearableData::pushWearable(const LLWearableType::EType type, mWearableDatas[type].push_back(wearable); if (trigger_updated) { - const BOOL removed = FALSE; + const bool removed = false; wearableUpdated(wearable, removed); } } } // virtual -void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed) +void LLWearableData::wearableUpdated(LLWearable *wearable, bool removed) { wearable->setUpdated(); if (!removed) @@ -144,7 +144,7 @@ void LLWearableData::eraseWearable(const LLWearableType::EType type, U32 index) if (wearable) { mWearableDatas[type].erase(mWearableDatas[type].begin() + index); - const BOOL removed = TRUE; + const bool removed = true; wearableUpdated(wearable, removed); } } @@ -200,7 +200,7 @@ void LLWearableData::pullCrossWearableValues(const LLWearableType::EType type) } -BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_found) const +bool LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_found) const { if (wearable == NULL) { @@ -242,7 +242,7 @@ U32 LLWearableData::getClothingLayerCount() const return count; } -BOOL LLWearableData::canAddWearable(const LLWearableType::EType type) const +bool LLWearableData::canAddWearable(const LLWearableType::EType type) const { LLAssetType::EType a_type = LLWearableType::getInstance()->getAssetType(type); if (a_type==LLAssetType::AT_CLOTHING) @@ -259,7 +259,7 @@ BOOL LLWearableData::canAddWearable(const LLWearableType::EType type) const } } -BOOL LLWearableData::isOnTop(LLWearable* wearable) const +bool LLWearableData::isOnTop(LLWearable* wearable) const { if (!wearable) return false; const LLWearableType::EType type = wearable->getType(); diff --git a/indra/llappearance/llwearabledata.h b/indra/llappearance/llwearabledata.h index b8e0bf8bd1..2fe9ae2302 100644 --- a/indra/llappearance/llwearabledata.h +++ b/indra/llappearance/llwearabledata.h @@ -60,11 +60,11 @@ public: const LLWearable* getBottomWearable(const LLWearableType::EType type) const; U32 getWearableCount(const LLWearableType::EType type) const; U32 getWearableCount(const U32 tex_index) const; - BOOL getWearableIndex(const LLWearable *wearable, U32& index) const; + bool getWearableIndex(const LLWearable *wearable, U32& index) const; U32 getClothingLayerCount() const; - BOOL canAddWearable(const LLWearableType::EType type) const; + bool canAddWearable(const LLWearableType::EType type) const; - BOOL isOnTop(LLWearable* wearable) const; + bool isOnTop(LLWearable* wearable) const; static const U32 MAX_CLOTHING_LAYERS = 60; @@ -76,7 +76,7 @@ protected: void setWearable(const LLWearableType::EType type, U32 index, LLWearable *wearable); void pushWearable(const LLWearableType::EType type, LLWearable *wearable, bool trigger_updated = true); - virtual void wearableUpdated(LLWearable *wearable, BOOL removed); + virtual void wearableUpdated(LLWearable *wearable, bool removed); void eraseWearable(LLWearable *wearable); void eraseWearable(const LLWearableType::EType type, U32 index); void clearWearableType(const LLWearableType::EType type); diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index 056f7cf888..c561502a3d 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -32,27 +32,27 @@ LLWearableType::LLWearableDictionary::LLWearableDictionary(LLTranslationBridge::ptr_t& trans) { - addEntry(LLWearableType::WT_SHAPE, new WearableEntry(trans, "shape", "New Shape", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SHAPE, FALSE, FALSE)); - addEntry(LLWearableType::WT_SKIN, new WearableEntry(trans, "skin", "New Skin", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SKIN, FALSE, FALSE)); - addEntry(LLWearableType::WT_HAIR, new WearableEntry(trans, "hair", "New Hair", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_HAIR, FALSE, FALSE)); - addEntry(LLWearableType::WT_EYES, new WearableEntry(trans, "eyes", "New Eyes", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_EYES, FALSE, FALSE)); - addEntry(LLWearableType::WT_SHIRT, new WearableEntry(trans, "shirt", "New Shirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHIRT, FALSE, TRUE)); - addEntry(LLWearableType::WT_PANTS, new WearableEntry(trans, "pants", "New Pants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PANTS, FALSE, TRUE)); - addEntry(LLWearableType::WT_SHOES, new WearableEntry(trans, "shoes", "New Shoes", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHOES, FALSE, TRUE)); - addEntry(LLWearableType::WT_SOCKS, new WearableEntry(trans, "socks", "New Socks", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SOCKS, FALSE, TRUE)); - addEntry(LLWearableType::WT_JACKET, new WearableEntry(trans, "jacket", "New Jacket", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_JACKET, FALSE, TRUE)); - addEntry(LLWearableType::WT_GLOVES, new WearableEntry(trans, "gloves", "New Gloves", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_GLOVES, FALSE, TRUE)); - addEntry(LLWearableType::WT_UNDERSHIRT, new WearableEntry(trans, "undershirt", "New Undershirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERSHIRT, FALSE, TRUE)); - addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry(trans, "underpants", "New Underpants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERPANTS, FALSE, TRUE)); - addEntry(LLWearableType::WT_SKIRT, new WearableEntry(trans, "skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SKIRT, FALSE, TRUE)); - addEntry(LLWearableType::WT_ALPHA, new WearableEntry(trans, "alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, FALSE, TRUE)); - addEntry(LLWearableType::WT_TATTOO, new WearableEntry(trans, "tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, FALSE, TRUE)); - addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry(trans, "universal", "New Universal", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, FALSE, TRUE)); + addEntry(LLWearableType::WT_SHAPE, new WearableEntry(trans, "shape", "New Shape", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SHAPE, false, false)); + addEntry(LLWearableType::WT_SKIN, new WearableEntry(trans, "skin", "New Skin", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_SKIN, false, false)); + addEntry(LLWearableType::WT_HAIR, new WearableEntry(trans, "hair", "New Hair", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_HAIR, false, false)); + addEntry(LLWearableType::WT_EYES, new WearableEntry(trans, "eyes", "New Eyes", LLAssetType::AT_BODYPART, LLInventoryType::ICONNAME_BODYPART_EYES, false, false)); + addEntry(LLWearableType::WT_SHIRT, new WearableEntry(trans, "shirt", "New Shirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHIRT, false, true)); + addEntry(LLWearableType::WT_PANTS, new WearableEntry(trans, "pants", "New Pants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PANTS, false, true)); + addEntry(LLWearableType::WT_SHOES, new WearableEntry(trans, "shoes", "New Shoes", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SHOES, false, true)); + addEntry(LLWearableType::WT_SOCKS, new WearableEntry(trans, "socks", "New Socks", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SOCKS, false, true)); + addEntry(LLWearableType::WT_JACKET, new WearableEntry(trans, "jacket", "New Jacket", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_JACKET, false, true)); + addEntry(LLWearableType::WT_GLOVES, new WearableEntry(trans, "gloves", "New Gloves", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_GLOVES, false, true)); + addEntry(LLWearableType::WT_UNDERSHIRT, new WearableEntry(trans, "undershirt", "New Undershirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERSHIRT, false, true)); + addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry(trans, "underpants", "New Underpants", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNDERPANTS, false, true)); + addEntry(LLWearableType::WT_SKIRT, new WearableEntry(trans, "skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SKIRT, false, true)); + addEntry(LLWearableType::WT_ALPHA, new WearableEntry(trans, "alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, false, true)); + addEntry(LLWearableType::WT_TATTOO, new WearableEntry(trans, "tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, false, true)); + addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry(trans, "universal", "New Universal", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, false, true)); - addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(trans, "physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, TRUE)); + addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(trans, "physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, true, true)); - addEntry(LLWearableType::WT_INVALID, new WearableEntry(trans, "invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_UNKNOWN, FALSE, FALSE)); - addEntry(LLWearableType::WT_NONE, new WearableEntry(trans, "none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, FALSE, FALSE)); + addEntry(LLWearableType::WT_INVALID, new WearableEntry(trans, "invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_UNKNOWN, false, false)); + addEntry(LLWearableType::WT_NONE, new WearableEntry(trans, "none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, false, false)); } @@ -112,14 +112,14 @@ LLInventoryType::EIconName LLWearableType::getIconName(LLWearableType::EType typ return entry->mIconName; } -BOOL LLWearableType::getDisableCameraSwitch(LLWearableType::EType type) +bool LLWearableType::getDisableCameraSwitch(LLWearableType::EType type) { const WearableEntry *entry = mDictionary.lookup(type); if (!entry) return false; return entry->mDisableCameraSwitch; } -BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type) +bool LLWearableType::getAllowMultiwear(LLWearableType::EType type) { const WearableEntry *entry = mDictionary.lookup(type); if (!entry) return false; diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index 793a33cc87..d2a85581bc 100644 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -72,8 +72,8 @@ public: LLAssetType::EType getAssetType(EType type); EType typeNameToType(const std::string& type_name); LLInventoryType::EIconName getIconName(EType type); - BOOL getDisableCameraSwitch(EType type); - BOOL getAllowMultiwear(EType type); + bool getDisableCameraSwitch(EType type); + bool getAllowMultiwear(EType type); static EType inventoryFlagsToWearableType(U32 flags); @@ -85,8 +85,8 @@ private: const std::string& default_new_name, LLAssetType::EType assetType, LLInventoryType::EIconName iconName, - BOOL disable_camera_switch = FALSE, - BOOL allow_multiwear = TRUE) : + bool disable_camera_switch = false, + bool allow_multiwear = true) : LLDictionaryEntry(name), mAssetType(assetType), mDefaultNewName(default_new_name), @@ -101,8 +101,8 @@ private: const std::string mLabel; const std::string mDefaultNewName; LLInventoryType::EIconName mIconName; - BOOL mDisableCameraSwitch; - BOOL mAllowMultiwear; + bool mDisableCameraSwitch; + bool mAllowMultiwear; }; class LLWearableDictionary : public LLDictionary diff --git a/indra/llcharacter/llanimationstates.cpp b/indra/llcharacter/llanimationstates.cpp index 2e78e30405..604c68a225 100644 --- a/indra/llcharacter/llanimationstates.cpp +++ b/indra/llcharacter/llanimationstates.cpp @@ -367,7 +367,7 @@ const char *LLAnimationLibrary::animStateToString( const LLUUID& state ) //----------------------------------------------------------------------------- // Return the animation state for a given name //----------------------------------------------------------------------------- -LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allow_ids ) +LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, bool allow_ids ) { std::string lower_case_name(name); LLStringUtil::toLower(lower_case_name); @@ -391,7 +391,7 @@ LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allo else if (allow_ids) { // try to convert string to LLUUID - id.set(name, FALSE); + id.set(name, false); } return id; diff --git a/indra/llcharacter/llanimationstates.h b/indra/llcharacter/llanimationstates.h index 79cbcabdc1..1757ce07a1 100644 --- a/indra/llcharacter/llanimationstates.h +++ b/indra/llcharacter/llanimationstates.h @@ -220,7 +220,7 @@ public: // Return the animation state for the given name. // Retun NULL if the name is invalid. //----------------------------------------------------------------------------- - LLUUID stringToAnimState( const std::string& name, BOOL allow_ids = TRUE ); + LLUUID stringToAnimState( const std::string& name, bool allow_ids = true ); //----------------------------------------------------------------------------- // Associate an anim state with a name diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 567bdb8c95..44e95c4e7f 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -184,7 +184,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error LL_DEBUGS("BVH") << "After translations and optimize" << LL_ENDL; dumpBVHInfo(); - mInitialized = TRUE; + mInitialized = true; } @@ -227,7 +227,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName) //-------------------------------------------------------------------- // load data one line at a time //-------------------------------------------------------------------- - BOOL loadingGlobals = FALSE; + bool loadingGlobals = false; while ( getLine(fp) ) { //---------------------------------------------------------------- @@ -251,7 +251,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName) if (strcmp(name, "GLOBALS")==0) { - loadingGlobals = TRUE; + loadingGlobals = true; continue; } } @@ -298,7 +298,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName) if ( sscanf(mLine, " %*s = %f %f", &loop_in, &loop_out) == 2 ) { - mLoop = TRUE; + mLoop = true; } else if ( sscanf(mLine, " %*s = %127s", trueFalse) == 1 ) /* Flawfinder: ignore */ { @@ -496,8 +496,8 @@ void LLBVHLoader::makeTranslation(std::string alias_name, std::string joint_name if (joint_name == "mPelvis") { - newTrans.mRelativePositionKey = TRUE; - newTrans.mRelativeRotationKey = TRUE; + newTrans.mRelativePositionKey = true; + newTrans.mRelativeRotationKey = true; } } @@ -609,7 +609,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 & //-------------------------------------------------------------------- // consume joints //-------------------------------------------------------------------- - while (TRUE) + while (true) { //---------------------------------------------------------------- // get next line @@ -969,7 +969,7 @@ void LLBVHLoader::applyTranslations() if ( trans.mIgnore ) { //LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL; - joint->mIgnore = TRUE; + joint->mIgnore = true; continue; } @@ -983,10 +983,10 @@ void LLBVHLoader::applyTranslations() } //Allow joint position changes as of SL-318 - joint->mIgnorePositions = FALSE; + joint->mIgnorePositions = false; if (joint->mNumChannels == 3) { - joint->mIgnorePositions = TRUE; + joint->mIgnorePositions = true; } //---------------------------------------------------------------- @@ -995,13 +995,13 @@ void LLBVHLoader::applyTranslations() if ( trans.mRelativePositionKey ) { // LL_INFOS() << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << LL_ENDL; - joint->mRelativePositionKey = TRUE; + joint->mRelativePositionKey = true; } if ( trans.mRelativeRotationKey ) { // LL_INFOS() << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << LL_ENDL; - joint->mRelativeRotationKey = TRUE; + joint->mRelativeRotationKey = true; } if ( trans.mRelativePosition.magVec() > 0.0f ) @@ -1065,8 +1065,8 @@ void LLBVHLoader::optimize() for (Joint* joint : mJoints) { - BOOL pos_changed = FALSE; - BOOL rot_changed = FALSE; + bool pos_changed = false; + bool rot_changed = false; if ( ! joint->mIgnore ) { @@ -1079,7 +1079,7 @@ void LLBVHLoader::optimize() // no keys? if (first_key == joint->mKeys.end()) { - joint->mIgnore = TRUE; + joint->mIgnore = true; continue; } @@ -1092,13 +1092,13 @@ void LLBVHLoader::optimize() { // *FIX: use single frame to move pelvis // if only one keyframe force output for this joint - rot_changed = TRUE; + rot_changed = true; } else { // if more than one keyframe, use first frame as reference and skip to second - first_key->mIgnorePos = TRUE; - first_key->mIgnoreRot = TRUE; + first_key->mIgnorePos = true; + first_key->mIgnoreRot = true; ++ki; } @@ -1119,7 +1119,7 @@ void LLBVHLoader::optimize() joint->mNumPosKeys++; if (dist_vec_squared(LLVector3(ki_prev->mPos), first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED) { - pos_changed = TRUE; + pos_changed = true; } } else @@ -1132,12 +1132,12 @@ void LLBVHLoader::optimize() if (dist_vec_squared(current_pos, first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED) { - pos_changed = TRUE; + pos_changed = true; } if (dist_vec_squared(interp_pos, test_pos) < POSITION_KEYFRAME_THRESHOLD_SQUARED) { - ki_prev->mIgnorePos = TRUE; + ki_prev->mIgnorePos = true; numPosFramesConsidered++; } else @@ -1158,7 +1158,7 @@ void LLBVHLoader::optimize() if (rot_test > ROTATION_MOTION_THRESHOLD) { - rot_changed = TRUE; + rot_changed = true; } } else @@ -1180,7 +1180,7 @@ void LLBVHLoader::optimize() rot_test = x_delta + y_delta; if (rot_test > ROTATION_MOTION_THRESHOLD) { - rot_changed = TRUE; + rot_changed = true; } x_delta = dist_vec(LLVector3::x_axis * interp_rot, LLVector3::x_axis * test_rot); y_delta = dist_vec(LLVector3::y_axis * interp_rot, LLVector3::y_axis * test_rot); @@ -1202,9 +1202,9 @@ void LLBVHLoader::optimize() // because it's significantly faster. if (diff_max > 0) { - if (ki_max->mIgnoreRot == TRUE) + if (ki_max->mIgnoreRot == true) { - ki_max->mIgnoreRot = FALSE; + ki_max->mIgnoreRot = false; joint->mNumRotKeys++; } diff_max = 0; @@ -1213,7 +1213,7 @@ void LLBVHLoader::optimize() else { // This keyframe isn't significant enough, throw it away. - ki_prev->mIgnoreRot = TRUE; + ki_prev->mIgnoreRot = true; numRotFramesConsidered++; // Store away the keyframe that has the largest deviation from the interpolated line, for insertion later. if (rot_test > diff_max) @@ -1232,7 +1232,7 @@ void LLBVHLoader::optimize() if (!(pos_changed || rot_changed)) { //LL_INFOS() << "Ignoring joint " << joint->mName << LL_ENDL; - joint->mIgnore = TRUE; + joint->mIgnore = true; } } } @@ -1245,13 +1245,13 @@ void LLBVHLoader::reset() mDuration = 0.0f; mPriority = 2; - mLoop = FALSE; + mLoop = false; mLoopInPoint = 0.f; mLoopOutPoint = 0.f; mEaseIn = 0.3f; mEaseOut = 0.3f; mHand = 1; - mInitialized = FALSE; + mInitialized = false; mEmoteName = ""; mLineNumber = 0; @@ -1262,7 +1262,7 @@ void LLBVHLoader::reset() //------------------------------------------------------------------------ // LLBVHLoader::getLine() //------------------------------------------------------------------------ -BOOL LLBVHLoader::getLine(apr_file_t* fp) +bool LLBVHLoader::getLine(apr_file_t* fp) { if (apr_file_eof(fp) == APR_EOF) { @@ -1287,7 +1287,7 @@ U32 LLBVHLoader::getOutputSize() } // writes contents to datapacker -BOOL LLBVHLoader::serialize(LLDataPacker& dp) +bool LLBVHLoader::serialize(LLDataPacker& dp) { F32 time; diff --git a/indra/llcharacter/llbvhloader.h b/indra/llcharacter/llbvhloader.h index 47fe409047..1cad8561c3 100644 --- a/indra/llcharacter/llbvhloader.h +++ b/indra/llcharacter/llbvhloader.h @@ -71,8 +71,8 @@ struct Key F32 mPos[3]; F32 mRot[3]; - BOOL mIgnorePos; - BOOL mIgnoreRot; + bool mIgnorePos; + bool mIgnoreRot; }; @@ -89,10 +89,10 @@ struct Joint Joint(const char *name) { mName = name; - mIgnore = FALSE; - mIgnorePositions = FALSE; - mRelativePositionKey = FALSE; - mRelativeRotationKey = FALSE; + mIgnore = false; + mIgnorePositions = false; + mRelativePositionKey = false; + mRelativeRotationKey = false; mOutName = name; mOrder[0] = 'X'; mOrder[1] = 'Y'; @@ -111,10 +111,10 @@ struct Joint LLVector3 mRelativePosition; // std::string mName; - BOOL mIgnore; - BOOL mIgnorePositions; - BOOL mRelativePositionKey; - BOOL mRelativeRotationKey; + bool mIgnore; + bool mIgnorePositions; + bool mRelativePositionKey; + bool mRelativeRotationKey; std::string mOutName; std::string mMergeParentName; std::string mMergeChildName; @@ -161,18 +161,18 @@ class Translation public: Translation() { - mIgnore = FALSE; - mIgnorePositions = FALSE; - mRelativePositionKey = FALSE; - mRelativeRotationKey = FALSE; + mIgnore = false; + mIgnorePositions = false; + mRelativePositionKey = false; + mRelativeRotationKey = false; mPriorityModifier = 0; } std::string mOutName; - BOOL mIgnore; - BOOL mIgnorePositions; - BOOL mRelativePositionKey; - BOOL mRelativeRotationKey; + bool mIgnore; + bool mIgnorePositions; + bool mRelativePositionKey; + bool mRelativeRotationKey; LLMatrix3 mFrameMatrix; LLMatrix3 mOffsetMatrix; LLVector3 mRelativePosition; @@ -293,7 +293,7 @@ public: U32 getOutputSize(); // writes contents to datapacker - BOOL serialize(LLDataPacker& dp); + bool serialize(LLDataPacker& dp); // flags redundant keyframe data void optimize(); @@ -302,13 +302,13 @@ public: F32 getDuration() { return mDuration; } - BOOL isInitialized() { return mInitialized; } + bool isInitialized() { return mInitialized; } ELoadStatus getStatus() { return mStatus; } protected: // Consumes one line of input from file. - BOOL getLine(apr_file_t *fp); + bool getLine(apr_file_t *fp); // parser state char mLine[BVH_PARSER_LINE_SIZE]; /* Flawfinder: ignore */ @@ -322,7 +322,7 @@ protected: TranslationMap mTranslations; S32 mPriority; - BOOL mLoop; + bool mLoop; F32 mLoopInPoint; F32 mLoopOutPoint; F32 mEaseIn; @@ -330,7 +330,7 @@ protected: S32 mHand; std::string mEmoteName; - BOOL mInitialized; + bool mInitialized; ELoadStatus mStatus; // computed values diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index b373bd75a3..abb0495b31 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -39,7 +39,7 @@ LLStringTable LLCharacter::sVisualParamNames(1024); std::vector< LLCharacter* > LLCharacter::sInstances; -BOOL LLCharacter::sAllowInstancesChange = TRUE ; +bool LLCharacter::sAllowInstancesChange = true ; //----------------------------------------------------------------------------- // LLCharacter() @@ -114,7 +114,7 @@ LLJoint *LLCharacter::getJoint( const std::string &name ) //----------------------------------------------------------------------------- // registerMotion() //----------------------------------------------------------------------------- -BOOL LLCharacter::registerMotion( const LLUUID& id, LLMotionConstructor create ) +bool LLCharacter::registerMotion( const LLUUID& id, LLMotionConstructor create ) { return mMotionController.registerMotion(id, create); } @@ -147,7 +147,7 @@ LLMotion* LLCharacter::createMotion( const LLUUID &id ) //----------------------------------------------------------------------------- // startMotion() //----------------------------------------------------------------------------- -BOOL LLCharacter::startMotion(const LLUUID &id, F32 start_offset) +bool LLCharacter::startMotion(const LLUUID &id, F32 start_offset) { return mMotionController.startMotion(id, start_offset); } @@ -156,7 +156,7 @@ BOOL LLCharacter::startMotion(const LLUUID &id, F32 start_offset) //----------------------------------------------------------------------------- // stopMotion() //----------------------------------------------------------------------------- -BOOL LLCharacter::stopMotion(const LLUUID& id, BOOL stop_immediate) +bool LLCharacter::stopMotion(const LLUUID& id, bool stop_immediate) { return mMotionController.stopMotionLocally(id, stop_immediate); } @@ -164,7 +164,7 @@ BOOL LLCharacter::stopMotion(const LLUUID& id, BOOL stop_immediate) //----------------------------------------------------------------------------- // isMotionActive() //----------------------------------------------------------------------------- -BOOL LLCharacter::isMotionActive(const LLUUID& id) +bool LLCharacter::isMotionActive(const LLUUID& id) { LLMotion *motionp = mMotionController.findMotion(id); if (motionp) @@ -279,7 +279,7 @@ void LLCharacter::removeAnimationData(std::string name) //----------------------------------------------------------------------------- // setVisualParamWeight() //----------------------------------------------------------------------------- -BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight) +bool LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight) { S32 index = which_param->getID(); visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); @@ -294,7 +294,7 @@ BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 wei //----------------------------------------------------------------------------- // setVisualParamWeight() //----------------------------------------------------------------------------- -BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight) +bool LLCharacter::setVisualParamWeight(const char* param_name, F32 weight) { std::string tname(param_name); LLStringUtil::toLower(tname); @@ -312,7 +312,7 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight) //----------------------------------------------------------------------------- // setVisualParamWeight() //----------------------------------------------------------------------------- -BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight) +bool LLCharacter::setVisualParamWeight(S32 index, F32 weight) { visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); if (index_iter != mVisualParamIndexMap.end()) diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 6d56d59e8c..d134c1cb5b 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -125,7 +125,7 @@ public: //------------------------------------------------------------------------- // registers a motion with the character // returns true if successfull - BOOL registerMotion( const LLUUID& id, LLMotionConstructor create ); + bool registerMotion( const LLUUID& id, LLMotionConstructor create ); void removeMotion( const LLUUID& id ); @@ -137,13 +137,13 @@ public: // start a motion // returns true if successful, false if an error occurred - virtual BOOL startMotion( const LLUUID& id, F32 start_offset = 0.f); + virtual bool startMotion( const LLUUID& id, F32 start_offset = 0.f); // stop a motion - virtual BOOL stopMotion( const LLUUID& id, BOOL stop_immediate = FALSE ); + virtual bool stopMotion( const LLUUID& id, bool stop_immediate = false ); // is this motion active? - BOOL isMotionActive( const LLUUID& id ); + bool isMotionActive( const LLUUID& id ); // Event handler for motion deactivation. // Called when a motion has completely stopped and has been deactivated. @@ -156,7 +156,7 @@ public: void updateMotions(e_update_t update_type); LLAnimPauseRequest requestPause(); - BOOL areAnimationsPaused() const { return mMotionController.isPaused(); } + bool areAnimationsPaused() const { return mMotionController.isPaused(); } void setAnimTimeFactor(F32 factor) { mMotionController.setTimeFactor(factor); } void setTimeStep(F32 time_step) { mMotionController.setTimeStep(time_step); } @@ -190,9 +190,9 @@ public: void addVisualParam(LLVisualParam *param); void addSharedVisualParam(LLVisualParam *param); - virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight); - virtual BOOL setVisualParamWeight(const char* param_name, F32 weight); - virtual BOOL setVisualParamWeight(S32 index, F32 weight); + virtual bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight); + virtual bool setVisualParamWeight(const char* param_name, F32 weight); + virtual bool setVisualParamWeight(S32 index, F32 weight); // get visual param weight by param or name F32 getVisualParamWeight(LLVisualParam *distortion); @@ -256,7 +256,7 @@ public: void setSkeletonSerialNum( U32 num ) { mSkeletonSerialNum = num; } static std::vector< LLCharacter* > sInstances; - static BOOL sAllowInstancesChange ; //debug use + static bool sAllowInstancesChange ; //debug use virtual void setHoverOffset(const LLVector3& hover_offset, bool send_update=true) { mHoverOffset = hover_offset; } const LLVector3& getHoverOffset() const { return mHoverOffset; } diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp index cf6438aad9..0eed1ab39e 100644 --- a/indra/llcharacter/lleditingmotion.cpp +++ b/indra/llcharacter/lleditingmotion.cpp @@ -141,7 +141,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte //----------------------------------------------------------------------------- // LLEditingMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLEditingMotion::onActivate() +bool LLEditingMotion::onActivate() { // propagate joint positions to kinematic chain // SL-315 @@ -161,14 +161,14 @@ BOOL LLEditingMotion::onActivate() //----------------------------------------------------------------------------- // LLEditingMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask) +bool LLEditingMotion::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED; LLVector3 focus_pt; LLVector3* pointAtPt = (LLVector3*)mCharacter->getAnimationData("PointAtPoint"); - BOOL result = true; + bool result = true; if (!pointAtPt) { diff --git a/indra/llcharacter/lleditingmotion.h b/indra/llcharacter/lleditingmotion.h index 63295983e0..de78c47da6 100644 --- a/indra/llcharacter/lleditingmotion.h +++ b/indra/llcharacter/lleditingmotion.h @@ -94,14 +94,14 @@ public: virtual LLMotionInitStatus onInitialize(LLCharacter *character); // called when a motion is activated - // must return TRUE to indicate success, or else + // must return true to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + virtual bool onActivate(); // called per time step - // must return TRUE while it is active, and - // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + // must return true while it is active, and + // must return false when the motion is completed. + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index d0c4139da7..b36b83e75e 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -91,14 +91,14 @@ const LLGesture &LLGesture::operator =(const LLGesture &rhs) } -BOOL LLGesture::trigger(KEY key, MASK mask) +bool LLGesture::trigger(KEY key, MASK mask) { LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL; return false; } -BOOL LLGesture::trigger(const std::string& trigger_string) +bool LLGesture::trigger(const std::string& trigger_string) { LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL; return false; @@ -189,12 +189,12 @@ void LLGestureList::deleteAll() // Iterates through space delimited tokens in string, triggering any gestures found. // Generates a revised string that has the found tokens replaced by their replacement strings // and (as a minor side effect) has multiple spaces in a row replaced by single spaces. -BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::string* revised_string) +bool LLGestureList::triggerAndReviseString(const std::string &string, std::string* revised_string) { std::string tokenized = string; - BOOL found_gestures = FALSE; - BOOL first_token = TRUE; + bool found_gestures = false; + bool first_token = true; typedef boost::tokenizer > tokenizer; boost::char_separator sep(" "); @@ -235,7 +235,7 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin } } - found_gestures = TRUE; + found_gestures = true; break; } gesture = NULL; @@ -251,14 +251,14 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin revised_string->append( cur_token ); } - first_token = FALSE; + first_token = false; } return found_gestures; } -BOOL LLGestureList::trigger(KEY key, MASK mask) +bool LLGestureList::trigger(KEY key, MASK mask) { for (U32 i = 0; i < mList.size(); i++) { diff --git a/indra/llcharacter/llgesture.h b/indra/llcharacter/llgesture.h index cfb489f727..22db9bc565 100644 --- a/indra/llcharacter/llgesture.h +++ b/indra/llcharacter/llgesture.h @@ -55,10 +55,10 @@ public: const std::string& getOutputString() const { return mOutputString; } // Triggers if a key/mask matches it - virtual BOOL trigger(KEY key, MASK mask); + virtual bool trigger(KEY key, MASK mask); // Triggers if case-insensitive substring matches (assumes string is lowercase) - virtual BOOL trigger(const std::string &string); + virtual bool trigger(const std::string &string); // non-endian-neutral serialization U8 *serialize(U8 *buffer) const; @@ -84,10 +84,10 @@ public: virtual ~LLGestureList(); // Triggers if a key/mask matches one in the list - BOOL trigger(KEY key, MASK mask); + bool trigger(KEY key, MASK mask); // Triggers if substring matches and generates revised string. - BOOL triggerAndReviseString(const std::string &string, std::string* revised_string); + bool triggerAndReviseString(const std::string &string, std::string* revised_string); // Used for construction from UI S32 count() const { return mList.size(); } diff --git a/indra/llcharacter/llhandmotion.cpp b/indra/llcharacter/llhandmotion.cpp index 1aad9565fc..f74c8aa70c 100644 --- a/indra/llcharacter/llhandmotion.cpp +++ b/indra/llcharacter/llhandmotion.cpp @@ -98,7 +98,7 @@ LLMotion::LLMotionInitStatus LLHandMotion::onInitialize(LLCharacter *character) //----------------------------------------------------------------------------- // LLHandMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLHandMotion::onActivate() +bool LLHandMotion::onActivate() { LLPolyMesh *upperBodyMesh = mCharacter->getUpperBodyMesh(); @@ -119,7 +119,7 @@ BOOL LLHandMotion::onActivate() //----------------------------------------------------------------------------- // LLHandMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask) +bool LLHandMotion::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED; eHandPose *requestedHandPose; diff --git a/indra/llcharacter/llhandmotion.h b/indra/llcharacter/llhandmotion.h index a37e50f595..828b4851be 100644 --- a/indra/llcharacter/llhandmotion.h +++ b/indra/llcharacter/llhandmotion.h @@ -107,14 +107,14 @@ public: virtual LLMotionInitStatus onInitialize(LLCharacter *character); // called when a motion is activated - // must return TRUE to indicate success, or else - // it will be deactivated - virtual BOOL onActivate(); + // must return true to indicate success, or else + // it will be deactivated + virtual bool onActivate(); // called per time step - // must return TRUE while it is active, and - // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + // must return true while it is active, and + // must return false when the motion is completed. + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index 85d7611b2c..b327deca64 100644 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -164,7 +164,7 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte //----------------------------------------------------------------------------- // LLHeadRotMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLHeadRotMotion::onActivate() +bool LLHeadRotMotion::onActivate() { return true; } @@ -173,7 +173,7 @@ BOOL LLHeadRotMotion::onActivate() //----------------------------------------------------------------------------- // LLHeadRotMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask) +bool LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; LLQuaternion targetHeadRotWorld; @@ -279,7 +279,7 @@ LLEyeMotion::LLEyeMotion(const LLUUID &id) : LLMotion(id) mEyeLookAwayPitch = 0.f; mEyeBlinkTime = 0.f; - mEyesClosed = FALSE; + mEyesClosed = false; mHeadJoint = NULL; @@ -362,7 +362,7 @@ LLMotion::LLMotionInitStatus LLEyeMotion::onInitialize(LLCharacter *character) //----------------------------------------------------------------------------- // LLEyeMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLEyeMotion::onActivate() +bool LLEyeMotion::onActivate() { return true; } @@ -373,7 +373,7 @@ BOOL LLEyeMotion::onActivate() void LLEyeMotion::adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_state, LLJointState& right_eye_state) { // Compute eye rotation. - BOOL has_eye_target = FALSE; + bool has_eye_target = false; LLQuaternion target_eye_rot; LLVector3 eye_look_at; F32 vergence; @@ -385,7 +385,7 @@ void LLEyeMotion::adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_s LLVector3 up; eye_look_at = *targetPos; - has_eye_target = TRUE; + has_eye_target = true; F32 lookAtDistance = eye_look_at.normVec(); left.setVec(skyward % eye_look_at); @@ -457,7 +457,7 @@ void LLEyeMotion::adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_s //----------------------------------------------------------------------------- // LLEyeMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask) +bool LLEyeMotion::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; //calculate jitter @@ -505,7 +505,7 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask) if (rightEyeBlinkMorph == 1.f) { - mEyesClosed = TRUE; + mEyesClosed = true; mEyeBlinkTime = EYE_BLINK_CLOSE_TIME; mEyeBlinkTimer.reset(); } @@ -525,7 +525,7 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask) if (rightEyeBlinkMorph == 0.f) { - mEyesClosed = FALSE; + mEyesClosed = false; mEyeBlinkTime = EYE_BLINK_MIN_TIME + ll_frand(EYE_BLINK_MAX_TIME - EYE_BLINK_MIN_TIME); mEyeBlinkTimer.reset(); } diff --git a/indra/llcharacter/llheadrotmotion.h b/indra/llcharacter/llheadrotmotion.h index fbc0885039..6bab1e8795 100644 --- a/indra/llcharacter/llheadrotmotion.h +++ b/indra/llcharacter/llheadrotmotion.h @@ -89,14 +89,14 @@ public: virtual LLMotionInitStatus onInitialize(LLCharacter *character); // called when a motion is activated - // must return TRUE to indicate success, or else + // must return true to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + virtual bool onActivate(); // called per time step - // must return TRUE while it is active, and - // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + // must return true while it is active, and + // must return false when the motion is completed. + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); @@ -172,16 +172,16 @@ public: virtual LLMotionInitStatus onInitialize(LLCharacter *character); // called when a motion is activated - // must return TRUE to indicate success, or else + // must return true to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + virtual bool onActivate(); void adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_state, LLJointState& right_eye_state); // called per time step - // must return TRUE while it is active, and - // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + // must return true while it is active, and + // must return false when the motion is completed. + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); @@ -209,7 +209,7 @@ public: // eye blinking LLFrameTimer mEyeBlinkTimer; F32 mEyeBlinkTime; - BOOL mEyesClosed; + bool mEyesClosed; }; #endif // LL_LLHEADROTMOTION_H diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 06f3bedf85..3597f3b63f 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -105,10 +105,10 @@ void LLJoint::init() { mName = "unnamed"; mParent = NULL; - mXform.setScaleChildOffset(TRUE); + mXform.setScaleChildOffset(true); mXform.setScale(LLVector3(1.0f, 1.0f, 1.0f)); mDirtyFlags = MATRIX_DIRTY | ROTATION_DIRTY | POSITION_DIRTY; - mUpdateXform = TRUE; + mUpdateXform = true; mSupport = SUPPORT_BASE; mEnd = LLVector3(0.0f, 0.0f, 0.0f); } @@ -135,7 +135,7 @@ LLJoint::LLJoint(const std::string &name, LLJoint *parent) : mJointNum(-2) { init(); - mUpdateXform = FALSE; + mUpdateXform = false; setName(name); if (parent) @@ -996,7 +996,7 @@ void LLJoint::updateWorldMatrix() if (mDirtyFlags & MATRIX_DIRTY) { sNumUpdates++; - mXform.updateMatrix(FALSE); + mXform.updateMatrix(false); mWorldMatrix.loadu(mXform.getWorldMatrix()); mDirtyFlags = 0x0; } diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 61ac6b4432..f0bfb3ba89 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -133,7 +133,7 @@ protected: public: U32 mDirtyFlags; - BOOL mUpdateXform; + bool mUpdateXform; // describes the skin binding pose LLVector3 mSkinOffset; @@ -280,7 +280,7 @@ public: void clampRotation(LLQuaternion old_rot, LLQuaternion new_rot); - virtual BOOL isAnimatable() const { return true; } + virtual bool isAnimatable() const { return true; } void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info, bool& active_override_changed ); void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info, bool& active_override_changed ); diff --git a/indra/llcharacter/lljointsolverrp3.cpp b/indra/llcharacter/lljointsolverrp3.cpp index f3d5e2e324..4b5d1c8894 100644 --- a/indra/llcharacter/lljointsolverrp3.cpp +++ b/indra/llcharacter/lljointsolverrp3.cpp @@ -53,9 +53,9 @@ LLJointSolverRP3::LLJointSolverRP3() mLengthAB = 1.0f; mLengthBC = 1.0f; mPoleVector.setVec( 1.0f, 0.0f, 0.0f ); - mbUseBAxis = FALSE; + mbUseBAxis = false; mTwist = 0.0f; - mFirstTime = TRUE; + mFirstTime = true; } @@ -114,7 +114,7 @@ void LLJointSolverRP3::setBAxis( const LLVector3& bAxis ) { mBAxis = bAxis; mBAxis.normVec(); - mbUseBAxis = TRUE; + mbUseBAxis = true; } //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/lljointsolverrp3.h b/indra/llcharacter/lljointsolverrp3.h index 88b5d08710..4eb814ee2b 100644 --- a/indra/llcharacter/lljointsolverrp3.h +++ b/indra/llcharacter/lljointsolverrp3.h @@ -97,11 +97,11 @@ protected: LLVector3 mPoleVector; LLVector3 mBAxis; - BOOL mbUseBAxis; + bool mbUseBAxis; F32 mTwist; - BOOL mFirstTime; + bool mFirstTime; LLMatrix4 mSavedJointAMat; LLMatrix4 mSavedInvPlaneMat; diff --git a/indra/llcharacter/lljointstate.h b/indra/llcharacter/lljointstate.h index 1ccc6b5093..c01ec96450 100644 --- a/indra/llcharacter/lljointstate.h +++ b/indra/llcharacter/lljointstate.h @@ -80,7 +80,7 @@ public: // joint that this state is applied to LLJoint* getJoint() { return mJoint; } const LLJoint* getJoint() const { return mJoint; } - BOOL setJoint( LLJoint *joint ) { mJoint = joint; return mJoint != NULL; } + bool setJoint( LLJoint *joint ) { mJoint = joint; return mJoint != NULL; } // transform type (bitwise flags can be combined) // Note that these are set automatically when various diff --git a/indra/llcharacter/llkeyframefallmotion.cpp b/indra/llcharacter/llkeyframefallmotion.cpp index e8bb2bf95d..ed6dd69362 100644 --- a/indra/llcharacter/llkeyframefallmotion.cpp +++ b/indra/llcharacter/llkeyframefallmotion.cpp @@ -91,7 +91,7 @@ LLMotion::LLMotionInitStatus LLKeyframeFallMotion::onInitialize(LLCharacter *cha //----------------------------------------------------------------------------- // LLKeyframeFallMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLKeyframeFallMotion::onActivate() +bool LLKeyframeFallMotion::onActivate() { LLVector3 ground_pos; LLVector3 ground_normal; @@ -119,10 +119,10 @@ BOOL LLKeyframeFallMotion::onActivate() //----------------------------------------------------------------------------- // LLKeyframeFallMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLKeyframeFallMotion::onUpdate(F32 activeTime, U8* joint_mask) +bool LLKeyframeFallMotion::onUpdate(F32 activeTime, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; - BOOL result = LLKeyframeMotion::onUpdate(activeTime, joint_mask); + bool result = LLKeyframeMotion::onUpdate(activeTime, joint_mask); F32 slerp_amt = clamp_rescale(activeTime / getDuration(), 0.5f, 0.75f, 0.f, 1.f); if (mPelvisState.notNull()) diff --git a/indra/llcharacter/llkeyframefallmotion.h b/indra/llcharacter/llkeyframefallmotion.h index 7f0a2fdda2..1ca1ed4dec 100644 --- a/indra/llcharacter/llkeyframefallmotion.h +++ b/indra/llcharacter/llkeyframefallmotion.h @@ -60,9 +60,9 @@ public: // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); + virtual bool onActivate(); virtual F32 getEaseInDuration(); - virtual BOOL onUpdate(F32 activeTime, U8* joint_mask); + virtual bool onUpdate(F32 activeTime, U8* joint_mask); protected: //------------------------------------------------------------------------- diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 0c2893cf4d..ba6cc025be 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -66,7 +66,7 @@ static F32 MAX_CONSTRAINTS = 10; //----------------------------------------------------------------------------- LLKeyframeMotion::JointMotionList::JointMotionList() : mDuration(0.f), - mLoop(FALSE), + mLoop(false), mLoopInPoint(0.f), mLoopOutPoint(0.f), mEaseInDuration(0.f), @@ -505,7 +505,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact LLAssetType::AT_ANIMATION, onLoadComplete, (void*)character_id, - FALSE); + false); } else { @@ -565,7 +565,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact U8 *anim_data; S32 anim_file_size; - BOOL success = FALSE; + bool success = false; LLFileSystem* anim_file = new LLFileSystem(mID, LLAssetType::AT_ANIMATION); if (!anim_file || !anim_file->getSize()) { @@ -620,7 +620,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact //----------------------------------------------------------------------------- // setupPose() //----------------------------------------------------------------------------- -BOOL LLKeyframeMotion::setupPose() +bool LLKeyframeMotion::setupPose() { // add all valid joint states to the pose for (U32 jm=0; jmgetNumJointMotions(); jm++) @@ -659,7 +659,7 @@ BOOL LLKeyframeMotion::setupPose() //----------------------------------------------------------------------------- // LLKeyframeMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLKeyframeMotion::onActivate() +bool LLKeyframeMotion::onActivate() { // If the keyframe anim has an associated emote, trigger it. if( mJointMotionList->mEmoteName.length() > 0 ) @@ -680,7 +680,7 @@ BOOL LLKeyframeMotion::onActivate() //----------------------------------------------------------------------------- // LLKeyframeMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLKeyframeMotion::onUpdate(F32 time, U8* joint_mask) +bool LLKeyframeMotion::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // llassert(time >= 0.f); // This will fire @@ -869,7 +869,7 @@ void LLKeyframeMotion::initializeConstraint(JointConstraint* constraint) void LLKeyframeMotion::activateConstraint(JointConstraint* constraint) { JointConstraintSharedData *shared_data = constraint->mSharedData; - constraint->mActive = TRUE; + constraint->mActive = true; S32 joint_num; // grab ground position if we need to @@ -901,17 +901,17 @@ void LLKeyframeMotion::deactivateConstraint(JointConstraint *constraintp) { if (constraintp->mSourceVolume) { - constraintp->mSourceVolume->mUpdateXform = FALSE; + constraintp->mSourceVolume->mUpdateXform = false; } if (constraintp->mSharedData->mConstraintTargetType != CONSTRAINT_TARGET_TYPE_GROUND) { if (constraintp->mTargetVolume) { - constraintp->mTargetVolume->mUpdateXform = FALSE; + constraintp->mTargetVolume->mUpdateXform = false; } } - constraintp->mActive = FALSE; + constraintp->mActive = false; } //----------------------------------------------------------------------------- @@ -1088,9 +1088,9 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 // convert intermediate joint positions to world coordinates positions[joint_num] = ( constraint->mPositions[joint_num] * mPelvisp->getWorldRotation()) + mPelvisp->getWorldPosition(); F32 time_constant = 1.f / clamp_rescale(constraint->mFixupDistanceRMS, 0.f, 0.5f, 0.2f, 8.f); -// LL_INFOS() << "Interpolant " << LLSmoothInterpolation::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL; - positions[joint_num] = lerp(positions[joint_num], kinematic_position, - LLSmoothInterpolation::getInterpolant(time_constant, FALSE)); +// LL_INFOS() << "Interpolant " << LLSmoothInterpolation::getInterpolant(time_constant, false) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL; + positions[joint_num] = lerp(positions[joint_num], kinematic_position, + LLSmoothInterpolation::getInterpolant(time_constant, false)); } S32 iteration_count; @@ -1225,9 +1225,9 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 // allow_invalid_joints should be true when handling existing content, to avoid breakage. // During upload, we should be more restrictive and reject such animations. //----------------------------------------------------------------------------- -BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, bool allow_invalid_joints) +bool LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, bool allow_invalid_joints) { - BOOL old_version = FALSE; + bool old_version = false; std::unique_ptr joint_motion_list(new LLKeyframeMotion::JointMotionList); //------------------------------------------------------------------------- @@ -1251,7 +1251,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo if (version == 0 && sub_version == 1) { - old_version = TRUE; + old_version = true; } else if (version != KEYFRAME_MOTION_VERSION || sub_version != KEYFRAME_MOTION_SUBVERSION) { @@ -1352,7 +1352,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo if (female_land_anim == asset_id || formal_female_land_anim == asset_id) { LL_WARNS() << "Animation(" << asset_id << ") won't be looped." << LL_ENDL; - joint_motion_list->mLoop = FALSE; + joint_motion_list->mLoop = false; } //------------------------------------------------------------------------- @@ -1656,7 +1656,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo // scan position curve keys //--------------------------------------------------------------------- PositionCurve *pCurve = &joint_motion->mPositionCurve; - BOOL is_pelvis = joint_motion->mJointName == "mPelvis"; + bool is_pelvis = joint_motion->mJointName == "mPelvis"; for (S32 k = 0; k < joint_motion->mPositionCurve.mNumKeys; k++) { U16 time_short; @@ -1903,7 +1903,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo if (!constraintp->mTargetConstraintDir.isExactlyZero()) { - constraintp->mUseTargetOffset = TRUE; + constraintp->mUseTargetOffset = true; // constraintp->mTargetConstraintDir *= constraintp->mSourceConstraintOffset.magVec(); } @@ -1998,9 +1998,9 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo //----------------------------------------------------------------------------- // serialize() //----------------------------------------------------------------------------- -BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const +bool LLKeyframeMotion::serialize(LLDataPacker& dp) const { - BOOL success = true; + bool success = true; LL_DEBUGS("BVH") << "serializing" << LL_ENDL; @@ -2283,7 +2283,7 @@ void LLKeyframeMotion::flushKeyframeCache() //----------------------------------------------------------------------------- // setLoop() //----------------------------------------------------------------------------- -void LLKeyframeMotion::setLoop(BOOL loop) +void LLKeyframeMotion::setLoop(bool loop) { if (mJointMotionList) { @@ -2515,7 +2515,7 @@ LLKeyframeMotion::JointConstraint::JointConstraint(JointConstraintSharedData* sh { mWeight = 0.f; mTotalLength = 0.f; - mActive = FALSE; + mActive = false; mSourceVolume = NULL; mTargetVolume = NULL; mFixupDistanceRMS = 0.f; diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h index 59a1d39a62..56c4364fd8 100644 --- a/indra/llcharacter/llkeyframemotion.h +++ b/indra/llcharacter/llkeyframemotion.h @@ -135,14 +135,14 @@ public: virtual LLMotionInitStatus onInitialize(LLCharacter *character); // called when a motion is activated - // must return TRUE to indicate success, or else + // must return true to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + virtual bool onActivate(); // called per time step - // must return TRUE while it is active, and - // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + // must return true while it is active, and + // must return false when the motion is completed. + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); @@ -155,14 +155,14 @@ public: public: U32 getFileSize(); - BOOL serialize(LLDataPacker& dp) const; - BOOL deserialize(LLDataPacker& dp, const LLUUID& asset_id, bool allow_invalid_joints = true); - BOOL isLoaded() { return mJointMotionList != NULL; } + bool serialize(LLDataPacker& dp) const; + bool deserialize(LLDataPacker& dp, const LLUUID& asset_id, bool allow_invalid_joints = true); + bool isLoaded() { return mJointMotionList != NULL; } bool dumpToFile(const std::string& name); // setters for modifying a keyframe animation - void setLoop(BOOL loop); + void setLoop(bool loop); F32 getLoopIn() { return (mJointMotionList) ? mJointMotionList->mLoopInPoint : 0.f; @@ -211,7 +211,7 @@ protected: mEaseInStopTime(0.f), mEaseOutStartTime(0.f), mEaseOutStopTime(0.f), - mUseTargetOffset(FALSE), + mUseTargetOffset(false), mConstraintType(CONSTRAINT_TYPE_POINT), mConstraintTargetType(CONSTRAINT_TARGET_TYPE_BODY), mSourceConstraintVolume(0), @@ -231,7 +231,7 @@ protected: F32 mEaseInStopTime; F32 mEaseOutStartTime; F32 mEaseOutStopTime; - BOOL mUseTargetOffset; + bool mUseTargetOffset; EConstraintType mConstraintType; EConstraintTargetType mConstraintTargetType; }; @@ -251,7 +251,7 @@ protected: LLVector3 mPositions[MAX_CHAIN_LENGTH]; F32 mJointLengths[MAX_CHAIN_LENGTH]; F32 mJointLengthFractions[MAX_CHAIN_LENGTH]; - BOOL mActive; + bool mActive; LLVector3d mGroundPos; LLVector3 mGroundNorm; LLJoint* mSourceVolume; @@ -271,7 +271,7 @@ protected: void applyConstraint(JointConstraint* constraintp, F32 time, U8* joint_mask); - BOOL setupPose(); + bool setupPose(); public: enum AssetStatus { ASSET_LOADED, ASSET_FETCHED, ASSET_NEEDS_FETCH, ASSET_FETCH_FAILED, ASSET_UNDEFINED }; diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp index 88c1a7ebe4..dfb6c1ec9f 100644 --- a/indra/llcharacter/llkeyframemotionparam.cpp +++ b/indra/llcharacter/llkeyframemotionparam.cpp @@ -133,7 +133,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *ch //----------------------------------------------------------------------------- // LLKeyframeMotionParam::onActivate() //----------------------------------------------------------------------------- -BOOL LLKeyframeMotionParam::onActivate() +bool LLKeyframeMotionParam::onActivate() { for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { @@ -150,7 +150,7 @@ BOOL LLKeyframeMotionParam::onActivate() //----------------------------------------------------------------------------- // LLKeyframeMotionParam::onUpdate() //----------------------------------------------------------------------------- -BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) +bool LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED; F32 weightFactor = 1.f / (F32)mParameterizedMotions.size(); @@ -283,7 +283,7 @@ void LLKeyframeMotionParam::onDeactivate() //----------------------------------------------------------------------------- // LLKeyframeMotionParam::addKeyframeMotion() //----------------------------------------------------------------------------- -BOOL LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value) +bool LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value) { LLMotion *newMotion = mCharacter->createMotion( id ); @@ -322,7 +322,7 @@ void LLKeyframeMotionParam::setDefaultKeyframeMotion(char *name) //----------------------------------------------------------------------------- // loadMotions() //----------------------------------------------------------------------------- -BOOL LLKeyframeMotionParam::loadMotions() +bool LLKeyframeMotionParam::loadMotions() { //------------------------------------------------------------------------- // Load named file by concatenating the character prefix with the motion name. @@ -401,7 +401,7 @@ BOOL LLKeyframeMotionParam::loadMotions() //------------------------------------------------------------------------- // get priority //------------------------------------------------------------------------- - BOOL isFirstMotion = TRUE; + bool isFirstMotion = true; num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */ while(1) @@ -416,7 +416,7 @@ BOOL LLKeyframeMotionParam::loadMotions() addKeyframeMotion(strA, gAnimLibrary.stringToAnimState(std::string(strA)), strB, floatA); if (isFirstMotion) { - isFirstMotion = FALSE; + isFirstMotion = false; setDefaultKeyframeMotion(strA); } diff --git a/indra/llcharacter/llkeyframemotionparam.h b/indra/llcharacter/llkeyframemotionparam.h index 3b0bc36012..553d95dbbe 100644 --- a/indra/llcharacter/llkeyframemotionparam.h +++ b/indra/llcharacter/llkeyframemotionparam.h @@ -102,14 +102,14 @@ public: virtual LLMotionInitStatus onInitialize(LLCharacter *character); // called when a motion is activated - // must return TRUE to indicate success, or else + // must return true to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + virtual bool onActivate(); // called per time step - // must return TRUE while it is active, and - // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + // must return true while it is active, and + // must return false when the motion is completed. + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); @@ -128,12 +128,12 @@ protected: }; // add a motion and associated parameter triplet - BOOL addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value); + bool addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value); // set default motion for LOD and retrieving blend constants void setDefaultKeyframeMotion(char *); - BOOL loadMotions(); + bool loadMotions(); protected: //------------------------------------------------------------------------- diff --git a/indra/llcharacter/llkeyframestandmotion.cpp b/indra/llcharacter/llkeyframestandmotion.cpp index f99492fd47..5e31d70216 100644 --- a/indra/llcharacter/llkeyframestandmotion.cpp +++ b/indra/llcharacter/llkeyframestandmotion.cpp @@ -46,7 +46,7 @@ const F32 POSITION_THRESHOLD = 0.1f; //----------------------------------------------------------------------------- LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotion(id) { - mFlipFeet = FALSE; + mFlipFeet = false; mCharacter = NULL; // create kinematic hierarchy @@ -67,7 +67,7 @@ LLKeyframeStandMotion::LLKeyframeStandMotion(const LLUUID &id) : LLKeyframeMotio mKneeRightState = NULL; mAnkleRightState = NULL; - mTrackAnkles = TRUE; + mTrackAnkles = true; mFrameNum = 0; } @@ -90,7 +90,7 @@ LLMotion::LLMotionInitStatus LLKeyframeStandMotion::onInitialize(LLCharacter *ch // save character pointer for later use mCharacter = character; - mFlipFeet = FALSE; + mFlipFeet = false; // load keyframe data, setup pose and joint states LLMotion::LLMotionInitStatus status = LLKeyframeMotion::onInitialize(character); @@ -129,7 +129,7 @@ LLMotion::LLMotionInitStatus LLKeyframeStandMotion::onInitialize(LLCharacter *ch //----------------------------------------------------------------------------- // LLKeyframeStandMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLKeyframeStandMotion::onActivate() +bool LLKeyframeStandMotion::onActivate() { //------------------------------------------------------------------------- // setup the IK solvers @@ -158,12 +158,12 @@ void LLKeyframeStandMotion::onDeactivate() //----------------------------------------------------------------------------- // LLKeyframeStandMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask) +bool LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask) { //------------------------------------------------------------------------- // let the base class update the cycle //------------------------------------------------------------------------- - BOOL status = LLKeyframeMotion::onUpdate(time, joint_mask); + bool status = LLKeyframeMotion::onUpdate(time, joint_mask); if (!status) { return false; @@ -185,16 +185,16 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask) { mLastGoodPelvisRotation = mPelvisState->getJoint()->getWorldRotation(); mLastGoodPelvisRotation.normalize(); - mTrackAnkles = TRUE; + mTrackAnkles = true; } else if ((mCharacter->getCharacterPosition() - mLastGoodPosition).magVecSquared() > POSITION_THRESHOLD) { mLastGoodPosition = mCharacter->getCharacterPosition(); - mTrackAnkles = TRUE; + mTrackAnkles = true; } else if (mPose.getWeight() < 1.f) { - mTrackAnkles = TRUE; + mTrackAnkles = true; } diff --git a/indra/llcharacter/llkeyframestandmotion.h b/indra/llcharacter/llkeyframestandmotion.h index 1aa5b187ba..0932a837bd 100644 --- a/indra/llcharacter/llkeyframestandmotion.h +++ b/indra/llcharacter/llkeyframestandmotion.h @@ -63,9 +63,9 @@ public: // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); + virtual bool onActivate(); void onDeactivate(); - virtual BOOL onUpdate(F32 time, U8* joint_mask); + virtual bool onUpdate(F32 time, U8* joint_mask); public: //------------------------------------------------------------------------- @@ -85,7 +85,7 @@ public: LLCharacter *mCharacter; - BOOL mFlipFeet; + bool mFlipFeet; LLPointer mPelvisState; @@ -109,7 +109,7 @@ public: LLQuaternion mLastGoodPelvisRotation; LLVector3 mLastGoodPosition; - BOOL mTrackAnkles; + bool mTrackAnkles; S32 mFrameNum; } LL_ALIGN_POSTFIX(16); diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index ae0a03925d..1dd743e096 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -83,7 +83,7 @@ LLMotion::LLMotionInitStatus LLKeyframeWalkMotion::onInitialize(LLCharacter *cha //----------------------------------------------------------------------------- // LLKeyframeWalkMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLKeyframeWalkMotion::onActivate() +bool LLKeyframeWalkMotion::onActivate() { mRealTimeLast = 0.0f; mAdjTimeLast = 0.0f; @@ -103,7 +103,7 @@ void LLKeyframeWalkMotion::onDeactivate() //----------------------------------------------------------------------------- // LLKeyframeWalkMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask) +bool LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED; // compute time since last update @@ -174,7 +174,7 @@ LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *chara //----------------------------------------------------------------------------- // LLWalkAdjustMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLWalkAdjustMotion::onActivate() +bool LLWalkAdjustMotion::onActivate() { mAnimSpeed = 0.f; mAdjustedSpeed = 0.f; @@ -197,7 +197,7 @@ BOOL LLWalkAdjustMotion::onActivate() //----------------------------------------------------------------------------- // LLWalkAdjustMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) +bool LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED; // delta_time is guaranteed to be non zero @@ -362,7 +362,7 @@ LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *charac //----------------------------------------------------------------------------- // LLFlyAdjustMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLFlyAdjustMotion::onActivate() +bool LLFlyAdjustMotion::onActivate() { mPelvisState->setPosition(LLVector3::zero); mPelvisState->setRotation(LLQuaternion::DEFAULT); @@ -373,7 +373,7 @@ BOOL LLFlyAdjustMotion::onActivate() //----------------------------------------------------------------------------- // LLFlyAdjustMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask) +bool LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED; LLVector3 ang_vel = mCharacter->getCharacterAngularVelocity() * mCharacter->getTimeDilation(); diff --git a/indra/llcharacter/llkeyframewalkmotion.h b/indra/llcharacter/llkeyframewalkmotion.h index d9e9322c82..7539d84db1 100644 --- a/indra/llcharacter/llkeyframewalkmotion.h +++ b/indra/llcharacter/llkeyframewalkmotion.h @@ -65,9 +65,9 @@ public: // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); + virtual bool onActivate(); virtual void onDeactivate(); - virtual BOOL onUpdate(F32 time, U8* joint_mask); + virtual bool onUpdate(F32 time, U8* joint_mask); public: //------------------------------------------------------------------------- @@ -100,9 +100,9 @@ public: // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); + virtual bool onActivate(); virtual void onDeactivate(); - virtual BOOL onUpdate(F32 time, U8* joint_mask); + virtual bool onUpdate(F32 time, U8* joint_mask); virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGH_PRIORITY;} virtual bool getLoop() { return true; } virtual F32 getDuration() { return 0.f; } @@ -150,9 +150,9 @@ public: // animation callbacks to be implemented by subclasses //------------------------------------------------------------------------- virtual LLMotionInitStatus onInitialize(LLCharacter *character); - virtual BOOL onActivate(); + virtual bool onActivate(); virtual void onDeactivate() {}; - virtual BOOL onUpdate(F32 time, U8* joint_mask); + virtual bool onUpdate(F32 time, U8* joint_mask); virtual LLJoint::JointPriority getPriority(){return LLJoint::HIGHER_PRIORITY;} virtual bool getLoop() { return true; } virtual F32 getDuration() { return 0.f; } diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index a3c23a9c94..a0b599663e 100644 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -43,8 +43,8 @@ // Class Constructor //----------------------------------------------------------------------------- LLMotion::LLMotion( const LLUUID &id ) : - mStopped(TRUE), - mActive(FALSE), + mStopped(true), + mActive(false), mID(id), mActivationTimestamp(0.f), mStopTimestamp(0.f), @@ -132,10 +132,10 @@ void LLMotion::setDeactivateCallback( void (*cb)(void *), void* userdata ) void LLMotion::setStopTime(F32 time) { mStopTimestamp = time; - mStopped = TRUE; + mStopped = true; } -BOOL LLMotion::isBlending() +bool LLMotion::isBlending() { return mPose.getWeight() < 1.f; } @@ -146,8 +146,8 @@ BOOL LLMotion::isBlending() void LLMotion::activate(F32 time) { mActivationTimestamp = time; - mStopped = FALSE; - mActive = TRUE; + mStopped = false; + mActive = true; onActivate(); } @@ -156,7 +156,7 @@ void LLMotion::activate(F32 time) //----------------------------------------------------------------------------- void LLMotion::deactivate() { - mActive = FALSE; + mActive = false; mPose.setWeight(0.f); if (mDeactivateCallback) diff --git a/indra/llcharacter/llmotion.h b/indra/llcharacter/llmotion.h index 1453979764..d6d7267115 100644 --- a/indra/llcharacter/llmotion.h +++ b/indra/llcharacter/llmotion.h @@ -91,21 +91,21 @@ public: virtual void setStopTime(F32 time); - BOOL isStopped() const { return mStopped; } + bool isStopped() const { return mStopped; } - void setStopped(BOOL stopped) { mStopped = stopped; } + void setStopped(bool stopped) { mStopped = stopped; } - BOOL isBlending(); + bool isBlending(); // Activation functions. // It is OK for other classes to activate a motion, // but only the controller can deactivate it. - // Thus, if mActive == TRUE, the motion *may* be on the controllers active list, - // but if mActive == FALSE, the motion is gauranteed not to be on the active list. + // Thus, if mActive == true, the motion *may* be on the controllers active list, + // but if mActive == false, the motion is gauranteed not to be on the active list. protected: // Used by LLMotionController only void deactivate(); - BOOL isActive() { return mActive; } + bool isActive() { return mActive; } public: void activate(F32 time); @@ -144,15 +144,15 @@ public: virtual LLMotionInitStatus onInitialize(LLCharacter *character) = 0; // called per time step - // must return TRUE while it is active, and - // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 activeTime, U8* joint_mask) = 0; + // must return true while it is active, and + // must return false when the motion is completed. + virtual bool onUpdate(F32 activeTime, U8* joint_mask) = 0; // called when a motion is deactivated virtual void onDeactivate() = 0; // can we crossfade this motion with a new instance when restarted? - // should ultimately always be TRUE, but lack of emote blending, etc + // should ultimately always be true, but lack of emote blending, etc // requires this virtual bool canDeprecate(); @@ -161,16 +161,16 @@ public: protected: // called when a motion is activated - // must return TRUE to indicate success, or else + // must return true to indicate success, or else // it will be deactivated - virtual BOOL onActivate() = 0; + virtual bool onActivate() = 0; void addJointState(const LLPointer& jointState); protected: LLPose mPose; - BOOL mStopped; // motion has been stopped; - BOOL mActive; // motion is on active list (can be stopped or not stopped) + bool mStopped; // motion has been stopped; + bool mActive; // motion is on active list (can be stopped or not stopped) //------------------------------------------------------------------------- // these are set implicitly by the motion controller and @@ -208,8 +208,8 @@ public: F32 getMinPixelArea() { return 0.f; } LLMotionInitStatus onInitialize(LLCharacter*) { LL_INFOS() << "LLTestMotion::onInitialize()" << LL_ENDL; return STATUS_SUCCESS; } - BOOL onActivate() { LL_INFOS() << "LLTestMotion::onActivate()" << LL_ENDL; return true; } - BOOL onUpdate(F32 time, U8* joint_mask) { LL_INFOS() << "LLTestMotion::onUpdate(" << time << ")" << LL_ENDL; return true; } + bool onActivate() { LL_INFOS() << "LLTestMotion::onActivate()" << LL_ENDL; return true; } + bool onUpdate(F32 time, U8* joint_mask) { LL_INFOS() << "LLTestMotion::onUpdate(" << time << ")" << LL_ENDL; return true; } void onDeactivate() { LL_INFOS() << "LLTestMotion::onDeactivate()" << LL_ENDL; } }; @@ -251,14 +251,14 @@ public: /*virtual*/ LLMotionInitStatus onInitialize(LLCharacter *character) { return STATUS_SUCCESS; } // called when a motion is activated - // must return TRUE to indicate success, or else + // must return true to indicate success, or else // it will be deactivated - /*virtual*/ BOOL onActivate() { return true; } + /*virtual*/ bool onActivate() { return true; } // called per time step - // must return TRUE while it is active, and - // must return FALSE when the motion is completed. - /*virtual*/ BOOL onUpdate(F32 activeTime, U8* joint_mask) { return true; } + // must return true while it is active, and + // must return false when the motion is completed. + /*virtual*/ bool onUpdate(F32 activeTime, U8* joint_mask) { return true; } // called when a motion is deactivated /*virtual*/ void onDeactivate() {} diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 750547da93..115606d863 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -76,7 +76,7 @@ LLMotionRegistry::~LLMotionRegistry() //----------------------------------------------------------------------------- // addMotion() //----------------------------------------------------------------------------- -BOOL LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor ) +bool LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor ) { // LL_INFOS() << "Registering motion: " << name << LL_ENDL; if (!is_in_map(mMotionTable, id)) @@ -133,13 +133,13 @@ LLMotionController::LLMotionController() mAnimTime(0.f), mPrevTimerElapsed(0.f), mLastTime(0.0f), - mHasRunOnce(FALSE), - mPaused(FALSE), + mHasRunOnce(false), + mPaused(false), mPausedFrame(0), mTimeStep(0.f), mTimeStepCount(0), mLastInterp(0.f), - mIsSelf(FALSE), + mIsSelf(false), mLastCountAfterPurge(0) { } @@ -275,7 +275,7 @@ void LLMotionController::setTimeStep(F32 step) LLMotion* motionp = *iter; F32 activation_time = motionp->mActivationTimestamp; motionp->mActivationTimestamp = (F32)(llfloor(activation_time / step)) * step; - BOOL stopped = motionp->isStopped(); + bool stopped = motionp->isStopped(); motionp->setStopTime((F32)(llfloor(motionp->getStopTime() / step)) * step); motionp->setStopped(stopped); motionp->mSendStopTimestamp = (F32)llfloor(motionp->mSendStopTimestamp / step) * step; @@ -303,7 +303,7 @@ void LLMotionController::setCharacter(LLCharacter *character) //----------------------------------------------------------------------------- // registerMotion() //----------------------------------------------------------------------------- -BOOL LLMotionController::registerMotion( const LLUUID& id, LLMotionConstructor constructor ) +bool LLMotionController::registerMotion( const LLUUID& id, LLMotionConstructor constructor ) { return sRegistry.registerMotion(id, constructor); } @@ -389,7 +389,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id ) //----------------------------------------------------------------------------- // startMotion() //----------------------------------------------------------------------------- -BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset) +bool LLMotionController::startMotion(const LLUUID &id, F32 start_offset) { // do we have an instance of this motion for this character? LLMotion *motion = findMotion(id); @@ -431,7 +431,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset) //----------------------------------------------------------------------------- // stopMotionLocally() //----------------------------------------------------------------------------- -BOOL LLMotionController::stopMotionLocally(const LLUUID &id, BOOL stop_immediate) +bool LLMotionController::stopMotionLocally(const LLUUID &id, bool stop_immediate) { // if already inactive, return false LLMotion *motion = findMotion(id); @@ -439,7 +439,7 @@ BOOL LLMotionController::stopMotionLocally(const LLUUID &id, BOOL stop_immediate return stopMotionInstance(motion, stop_immediate||mPaused); } -BOOL LLMotionController::stopMotionInstance(LLMotion* motion, BOOL stop_immediate) +bool LLMotionController::stopMotionInstance(LLMotion* motion, bool stop_immediate) { if (!motion) { @@ -459,7 +459,7 @@ BOOL LLMotionController::stopMotionInstance(LLMotion* motion, BOOL stop_immediat } else if (isMotionLoading(motion)) { - motion->setStopped(TRUE); + motion->setStopped(true); return true; } @@ -518,7 +518,7 @@ void LLMotionController::updateIdleMotion(LLMotion* motionp) if (mLastTime <= motionp->mSendStopTimestamp) { mCharacter->requestStopMotion( motionp ); - stopMotionInstance(motionp, FALSE); + stopMotionInstance(motionp, false); } } else if (mAnimTime >= motionp->mActivationTimestamp) @@ -552,7 +552,7 @@ void LLMotionController::updateIdleActiveMotions() void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; - BOOL update_result = TRUE; + bool update_result = true; U8 last_joint_signature[LL_CHARACTER_MAX_ANIMATED_JOINTS]; memset(&last_joint_signature, 0, sizeof(U8) * LL_CHARACTER_MAX_ANIMATED_JOINTS); @@ -568,11 +568,11 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty continue; } - BOOL update_motion = FALSE; + bool update_motion = false; if (motionp->getPose()->getWeight() < 1.f) { - update_motion = TRUE; + update_motion = true; } else { @@ -584,7 +584,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty if ((*current_signature | test_signature) > (*current_signature)) { *current_signature |= test_signature; - update_motion = TRUE; + update_motion = true; } *((U32*)&last_joint_signature[i * 4]) = *(U32*)&(mJointSignature[1][i * 4]); @@ -594,7 +594,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty if ((*current_signature | test_signature) > (*current_signature)) { *current_signature |= test_signature; - update_motion = TRUE; + update_motion = true; } } } @@ -620,7 +620,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty if (mLastTime <= motionp->mSendStopTimestamp) { mCharacter->requestStopMotion( motionp ); - stopMotionInstance(motionp, FALSE); + stopMotionInstance(motionp, false); } } @@ -701,7 +701,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty if (mLastTime <= motionp->mSendStopTimestamp) { mCharacter->requestStopMotion( motionp ); - stopMotionInstance(motionp, FALSE); + stopMotionInstance(motionp, false); } } @@ -747,12 +747,12 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty // propagate this to the network // as not all viewers are guaranteed to have access to the same logic mCharacter->requestStopMotion( motionp ); - stopMotionInstance(motionp, FALSE); + stopMotionInstance(motionp, false); } } - // even if onupdate returns FALSE, add this motion in to the blend one last time + // even if onupdate returns false, add this motion in to the blend one last time mPoseBlender.addMotion(motionp); } } @@ -815,7 +815,7 @@ void LLMotionController::updateMotions(bool force_update) // The use_quantum optimization or possibly the associated code in setTimeStamp() // does not work as implemented. // Currently setting mTimeStep to nonzero is disabled elsewhere. - BOOL use_quantum = (mTimeStep != 0.f); + bool use_quantum = (mTimeStep != 0.f); // Always update mPrevTimerElapsed F32 cur_time = mTimer.getElapsedTimeF32(); @@ -885,7 +885,7 @@ void LLMotionController::updateMotions(bool force_update) if (use_quantum) { - mPoseBlender.blendAndCache(TRUE); + mPoseBlender.blendAndCache(true); } else { @@ -893,7 +893,7 @@ void LLMotionController::updateMotions(bool force_update) } } - mHasRunOnce = TRUE; + mHasRunOnce = true; // LL_INFOS() << "Motion controller time " << motionTimer.getElapsedTimeF32() << LL_ENDL; } @@ -913,13 +913,13 @@ void LLMotionController::updateMotionsMinimal() deactivateStoppedMotions(); - mHasRunOnce = TRUE; + mHasRunOnce = true; } //----------------------------------------------------------------------------- // activateMotionInstance() //----------------------------------------------------------------------------- -BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time) +bool LLMotionController::activateMotionInstance(LLMotion *motion, F32 time) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // It's not clear why the getWeight() line seems to be crashing this, but @@ -932,7 +932,7 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time) if (mLoadingMotions.find(motion) != mLoadingMotions.end()) { // we want to start this motion, but we can't yet, so flag it as started - motion->setStopped(FALSE); + motion->setStopped(false); // report pending animations as activated return true; } @@ -984,7 +984,7 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time) //----------------------------------------------------------------------------- // deactivateMotionInstance() //----------------------------------------------------------------------------- -BOOL LLMotionController::deactivateMotionInstance(LLMotion *motion) +bool LLMotionController::deactivateMotionInstance(LLMotion *motion) { motion->deactivate(); @@ -1009,7 +1009,7 @@ void LLMotionController::deprecateMotionInstance(LLMotion* motion) mDeprecatedMotions.insert(motion); //fade out deprecated motion - stopMotionInstance(motion, FALSE); + stopMotionInstance(motion, false); //no longer canonical mAllMotions.erase(motion->getID()); } @@ -1124,7 +1124,7 @@ void LLMotionController::pauseAllMotions() if (!mPaused) { //LL_INFOS() << "Pausing animations..." << LL_ENDL; - mPaused = TRUE; + mPaused = true; mPausedFrame = LLFrameTimer::getFrameCount(); } @@ -1138,7 +1138,7 @@ void LLMotionController::unpauseAllMotions() if (mPaused) { //LL_INFOS() << "Unpausing animations..." << LL_ENDL; - mPaused = FALSE; + mPaused = false; } } // End diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index 637ee4d2bb..dea470cbd3 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -62,7 +62,7 @@ public: // adds motion classes to the registry // returns true if successfull - BOOL registerMotion( const LLUUID& id, LLMotionConstructor create); + bool registerMotion( const LLUUID& id, LLMotionConstructor create); // creates a new instance of a named motion // returns NULL motion is not registered @@ -85,7 +85,7 @@ class LLMotionController public: typedef std::list motion_list_t; typedef std::set motion_set_t; - BOOL mIsSelf; + bool mIsSelf; public: // Constructor @@ -102,7 +102,7 @@ public: // registers a motion with the controller // (actually just forwards call to motion registry) // returns true if successfull - BOOL registerMotion( const LLUUID& id, LLMotionConstructor create ); + bool registerMotion( const LLUUID& id, LLMotionConstructor create ); // creates a motion from the registry LLMotion *createMotion( const LLUUID &id ); @@ -115,13 +115,13 @@ public: // start motion // begins playing the specified motion // returns true if successful - BOOL startMotion( const LLUUID &id, F32 start_offset ); + bool startMotion( const LLUUID &id, F32 start_offset ); // stop motion // stops a playing motion // in reality, it begins the ease out transition phase // returns true if successful - BOOL stopMotionLocally( const LLUUID &id, BOOL stop_immediate ); + bool stopMotionLocally( const LLUUID &id, bool stop_immediate ); // Move motions from loading to loaded void updateLoadingMotions(); @@ -147,7 +147,7 @@ public: // pause and continue all motions void pauseAllMotions(); void unpauseAllMotions(); - BOOL isPaused() const { return mPaused; } + bool isPaused() const { return mPaused; } S32 getPausedFrame() const { return mPausedFrame; } void setTimeStep(F32 step); @@ -178,10 +178,10 @@ protected: // internal operations act on motion instances directly // as there can be duplicate motions per id during blending overlap void deleteAllMotions(); - BOOL activateMotionInstance(LLMotion *motion, F32 time); - BOOL deactivateMotionInstance(LLMotion *motion); + bool activateMotionInstance(LLMotion *motion, F32 time); + bool deactivateMotionInstance(LLMotion *motion); void deprecateMotionInstance(LLMotion* motion); - BOOL stopMotionInstance(LLMotion *motion, BOOL stop_imemdiate); + bool stopMotionInstance(LLMotion *motion, bool stop_imemdiate); void removeMotionInstance(LLMotion* motion); void updateRegularMotions(); void updateAdditiveMotions(); @@ -220,8 +220,8 @@ protected: F32 mPrevTimerElapsed; F32 mAnimTime; F32 mLastTime; - BOOL mHasRunOnce; - BOOL mPaused; + bool mHasRunOnce; + bool mPaused; S32 mPausedFrame; F32 mTimeStep; S32 mTimeStepCount; diff --git a/indra/llcharacter/llmultigesture.cpp b/indra/llcharacter/llmultigesture.cpp index 2938bf9473..73652a15b4 100644 --- a/indra/llcharacter/llmultigesture.cpp +++ b/indra/llcharacter/llmultigesture.cpp @@ -48,7 +48,7 @@ LLMultiGesture::LLMultiGesture() mTrigger(), mReplaceText(), mSteps(), - mPlaying(FALSE), + mPlaying(false), mCurrentStep(0), mDoneCallback(NULL), mCallbackData(NULL) @@ -64,12 +64,12 @@ LLMultiGesture::~LLMultiGesture() void LLMultiGesture::reset() { - mPlaying = FALSE; + mPlaying = false; mCurrentStep = 0; mWaitTimer.reset(); - mWaitingTimer = FALSE; - mWaitingAnimations = FALSE; - mWaitingAtEnd = FALSE; + mWaitingTimer = false; + mWaitingAnimations = false; + mWaitingAtEnd = false; mRequestedAnimIDs.clear(); mPlayingAnimIDs.clear(); } @@ -114,7 +114,7 @@ S32 LLMultiGesture::getMaxSerialSize() const return max_size; } -BOOL LLMultiGesture::serialize(LLDataPacker& dp) const +bool LLMultiGesture::serialize(LLDataPacker& dp) const { dp.packS32(GESTURE_VERSION, "version"); dp.packU8(mKey, "key"); @@ -130,7 +130,7 @@ BOOL LLMultiGesture::serialize(LLDataPacker& dp) const LLGestureStep* step = mSteps[i]; dp.packS32(step->getType(), "step_type"); - BOOL ok = step->serialize(dp); + bool ok = step->serialize(dp); if (!ok) { return false; @@ -139,7 +139,7 @@ BOOL LLMultiGesture::serialize(LLDataPacker& dp) const return true; } -BOOL LLMultiGesture::deserialize(LLDataPacker& dp) +bool LLMultiGesture::deserialize(LLDataPacker& dp) { S32 version; dp.unpackS32(version, "version"); @@ -179,7 +179,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp) case STEP_ANIMATION: { LLGestureStepAnimation* step = new LLGestureStepAnimation(); - BOOL ok = step->deserialize(dp); + bool ok = step->deserialize(dp); if (!ok) return false; mSteps.push_back(step); break; @@ -187,7 +187,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp) case STEP_SOUND: { LLGestureStepSound* step = new LLGestureStepSound(); - BOOL ok = step->deserialize(dp); + bool ok = step->deserialize(dp); if (!ok) return false; mSteps.push_back(step); break; @@ -195,7 +195,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp) case STEP_CHAT: { LLGestureStepChat* step = new LLGestureStepChat(); - BOOL ok = step->deserialize(dp); + bool ok = step->deserialize(dp); if (!ok) return false; mSteps.push_back(step); break; @@ -203,7 +203,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp) case STEP_WAIT: { LLGestureStepWait* step = new LLGestureStepWait(); - BOOL ok = step->deserialize(dp); + bool ok = step->deserialize(dp); if (!ok) return false; mSteps.push_back(step); break; @@ -262,7 +262,7 @@ S32 LLGestureStepAnimation::getMaxSerialSize() const return max_size; } -BOOL LLGestureStepAnimation::serialize(LLDataPacker& dp) const +bool LLGestureStepAnimation::serialize(LLDataPacker& dp) const { dp.packString(mAnimName, "anim_name"); dp.packUUID(mAnimAssetID, "asset_id"); @@ -270,7 +270,7 @@ BOOL LLGestureStepAnimation::serialize(LLDataPacker& dp) const return true; } -BOOL LLGestureStepAnimation::deserialize(LLDataPacker& dp) +bool LLGestureStepAnimation::deserialize(LLDataPacker& dp) { dp.unpackString(mAnimName, "anim_name"); @@ -344,7 +344,7 @@ S32 LLGestureStepSound::getMaxSerialSize() const return max_size; } -BOOL LLGestureStepSound::serialize(LLDataPacker& dp) const +bool LLGestureStepSound::serialize(LLDataPacker& dp) const { dp.packString(mSoundName, "sound_name"); dp.packUUID(mSoundAssetID, "asset_id"); @@ -352,7 +352,7 @@ BOOL LLGestureStepSound::serialize(LLDataPacker& dp) const return true; } -BOOL LLGestureStepSound::deserialize(LLDataPacker& dp) +bool LLGestureStepSound::deserialize(LLDataPacker& dp) { dp.unpackString(mSoundName, "sound_name"); @@ -404,14 +404,14 @@ S32 LLGestureStepChat::getMaxSerialSize() const return max_size; } -BOOL LLGestureStepChat::serialize(LLDataPacker& dp) const +bool LLGestureStepChat::serialize(LLDataPacker& dp) const { dp.packString(mChatText, "chat_text"); dp.packU32(mFlags, "flags"); return true; } -BOOL LLGestureStepChat::deserialize(LLDataPacker& dp) +bool LLGestureStepChat::deserialize(LLDataPacker& dp) { dp.unpackString(mChatText, "chat_text"); @@ -459,14 +459,14 @@ S32 LLGestureStepWait::getMaxSerialSize() const return max_size; } -BOOL LLGestureStepWait::serialize(LLDataPacker& dp) const +bool LLGestureStepWait::serialize(LLDataPacker& dp) const { dp.packF32(mWaitSeconds, "wait_seconds"); dp.packU32(mFlags, "flags"); return true; } -BOOL LLGestureStepWait::deserialize(LLDataPacker& dp) +bool LLGestureStepWait::deserialize(LLDataPacker& dp) { dp.unpackF32(mWaitSeconds, "wait_seconds"); dp.unpackU32(mFlags, "flags"); diff --git a/indra/llcharacter/llmultigesture.h b/indra/llcharacter/llmultigesture.h index 92820159d4..13acbc3f52 100644 --- a/indra/llcharacter/llmultigesture.h +++ b/indra/llcharacter/llmultigesture.h @@ -46,8 +46,8 @@ public: // Maximum number of bytes this could hold once serialized. S32 getMaxSerialSize() const; - BOOL serialize(LLDataPacker& dp) const; - BOOL deserialize(LLDataPacker& dp); + bool serialize(LLDataPacker& dp) const; + bool deserialize(LLDataPacker& dp); void dump(); @@ -75,19 +75,19 @@ public: std::vector mSteps; // Is the gesture currently playing? - BOOL mPlaying; + bool mPlaying; // "instruction pointer" for steps S32 mCurrentStep; // We're waiting for triggered animations to stop playing - BOOL mWaitingAnimations; + bool mWaitingAnimations; // We're waiting a fixed amount of time - BOOL mWaitingTimer; + bool mWaitingTimer; // Waiting after the last step played for all animations to complete - BOOL mWaitingAtEnd; + bool mWaitingAtEnd; // Timer for waiting LLFrameTimer mWaitTimer; @@ -129,8 +129,8 @@ public: virtual std::vector getLabel() const = 0; virtual S32 getMaxSerialSize() const = 0; - virtual BOOL serialize(LLDataPacker& dp) const = 0; - virtual BOOL deserialize(LLDataPacker& dp) = 0; + virtual bool serialize(LLDataPacker& dp) const = 0; + virtual bool deserialize(LLDataPacker& dp) = 0; virtual void dump() = 0; }; @@ -151,8 +151,8 @@ public: virtual std::vector getLabel() const; virtual S32 getMaxSerialSize() const; - virtual BOOL serialize(LLDataPacker& dp) const; - virtual BOOL deserialize(LLDataPacker& dp); + virtual bool serialize(LLDataPacker& dp) const; + virtual bool deserialize(LLDataPacker& dp); virtual void dump(); @@ -174,8 +174,8 @@ public: virtual std::vector getLabel() const; virtual S32 getMaxSerialSize() const; - virtual BOOL serialize(LLDataPacker& dp) const; - virtual BOOL deserialize(LLDataPacker& dp); + virtual bool serialize(LLDataPacker& dp) const; + virtual bool deserialize(LLDataPacker& dp); virtual void dump(); @@ -197,8 +197,8 @@ public: virtual std::vector getLabel() const; virtual S32 getMaxSerialSize() const; - virtual BOOL serialize(LLDataPacker& dp) const; - virtual BOOL deserialize(LLDataPacker& dp); + virtual bool serialize(LLDataPacker& dp) const; + virtual bool deserialize(LLDataPacker& dp); virtual void dump(); @@ -222,8 +222,8 @@ public: virtual std::vector getLabel() const; virtual S32 getMaxSerialSize() const; - virtual BOOL serialize(LLDataPacker& dp) const; - virtual BOOL deserialize(LLDataPacker& dp); + virtual bool serialize(LLDataPacker& dp) const; + virtual bool deserialize(LLDataPacker& dp); virtual void dump(); diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp index 5acdfbf532..1983607d47 100644 --- a/indra/llcharacter/llpose.cpp +++ b/indra/llcharacter/llpose.cpp @@ -81,7 +81,7 @@ LLJointState *LLPose::getNextJointState() //----------------------------------------------------------------------------- // addJointState() //----------------------------------------------------------------------------- -BOOL LLPose::addJointState(const LLPointer& jointState) +bool LLPose::addJointState(const LLPointer& jointState) { if (mJointMap.find(jointState->getJoint()->getName()) == mJointMap.end()) { @@ -93,7 +93,7 @@ BOOL LLPose::addJointState(const LLPointer& jointState) //----------------------------------------------------------------------------- // removeJointState() //----------------------------------------------------------------------------- -BOOL LLPose::removeJointState(const LLPointer& jointState) +bool LLPose::removeJointState(const LLPointer& jointState) { mJointMap.erase(jointState->getJoint()->getName()); return true; @@ -102,7 +102,7 @@ BOOL LLPose::removeJointState(const LLPointer& jointState) //----------------------------------------------------------------------------- // removeAllJointStates() //----------------------------------------------------------------------------- -BOOL LLPose::removeAllJointStates() +bool LLPose::removeAllJointStates() { mJointMap.clear(); return true; @@ -181,7 +181,7 @@ LLJointStateBlender::LLJointStateBlender() { mJointStates[i] = NULL; mPriorities[i] = S32_MIN; - mAdditiveBlends[i] = FALSE; + mAdditiveBlends[i] = false; } } @@ -193,7 +193,7 @@ LLJointStateBlender::~LLJointStateBlender() //----------------------------------------------------------------------------- // addJointState() //----------------------------------------------------------------------------- -BOOL LLJointStateBlender::addJointState(const LLPointer& joint_state, S32 priority, BOOL additive_blend) +bool LLJointStateBlender::addJointState(const LLPointer& joint_state, S32 priority, bool additive_blend) { llassert(joint_state); @@ -235,7 +235,7 @@ BOOL LLJointStateBlender::addJointState(const LLPointer& joint_sta //----------------------------------------------------------------------------- // blendJointStates() //----------------------------------------------------------------------------- -void LLJointStateBlender::blendJointStates(BOOL apply_now) +void LLJointStateBlender::blendJointStates(bool apply_now) { // we need at least one joint to blend // if there is one, it will be in slot zero according to insertion logic @@ -468,7 +468,7 @@ LLPoseBlender::~LLPoseBlender() //----------------------------------------------------------------------------- // addMotion() //----------------------------------------------------------------------------- -BOOL LLPoseBlender::addMotion(LLMotion* motion) +bool LLPoseBlender::addMotion(LLMotion* motion) { LLPose* pose = motion->getPose(); @@ -525,7 +525,7 @@ void LLPoseBlender::blendAndApply() //----------------------------------------------------------------------------- // blendAndCache() //----------------------------------------------------------------------------- -void LLPoseBlender::blendAndCache(BOOL reset_cached_joints) +void LLPoseBlender::blendAndCache(bool reset_cached_joints) { for (blender_list_t::iterator iter = mActiveBlenders.begin(); iter != mActiveBlenders.end(); ++iter) @@ -535,7 +535,7 @@ void LLPoseBlender::blendAndCache(BOOL reset_cached_joints) { jsbp->resetCachedJoint(); } - jsbp->blendJointStates(FALSE); + jsbp->blendJointStates(false); } } diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h index 1405f1e053..d43956e120 100644 --- a/indra/llcharacter/llpose.h +++ b/indra/llcharacter/llpose.h @@ -65,11 +65,11 @@ public: // Destructor ~LLPose(); // add a joint state in this pose - BOOL addJointState(const LLPointer& jointState); + bool addJointState(const LLPointer& jointState); // remove a joint state from this pose - BOOL removeJointState(const LLPointer& jointState); + bool removeJointState(const LLPointer& jointState); // removes all joint states from this pose - BOOL removeAllJointStates(); + bool removeAllJointStates(); // set weight for all joint states in this pose void setWeight(F32 weight); // get weight for this pose @@ -87,12 +87,12 @@ class LLJointStateBlender protected: LLPointer mJointStates[JSB_NUM_JOINT_STATES]; S32 mPriorities[JSB_NUM_JOINT_STATES]; - BOOL mAdditiveBlends[JSB_NUM_JOINT_STATES]; + bool mAdditiveBlends[JSB_NUM_JOINT_STATES]; public: LLJointStateBlender(); ~LLJointStateBlender(); - void blendJointStates(BOOL apply_now = TRUE); - BOOL addJointState(const LLPointer& joint_state, S32 priority, BOOL additive_blend); + void blendJointStates(bool apply_now = true); + bool addJointState(const LLPointer& joint_state, S32 priority, bool additive_blend); void interpolate(F32 u); void clear(); void resetCachedJoint(); @@ -120,7 +120,7 @@ public: ~LLPoseBlender(); // request motion joint states to be added to pose blender joint state records - BOOL addMotion(LLMotion* motion); + bool addMotion(LLMotion* motion); // blend all joint states and apply to skeleton void blendAndApply(); @@ -129,7 +129,7 @@ public: void clearBlenders(); // blend all joint states and cache results - void blendAndCache(BOOL reset_cached_joints); + void blendAndCache(bool reset_cached_joints); // interpolate all joints towards cached values void interpolate(F32 u); diff --git a/indra/llcharacter/llstatemachine.cpp b/indra/llcharacter/llstatemachine.cpp index 8261670728..261eaf0350 100644 --- a/indra/llcharacter/llstatemachine.cpp +++ b/indra/llcharacter/llstatemachine.cpp @@ -49,7 +49,7 @@ bool operator!=(const LLUniqueID &a, const LLUniqueID &b) LLStateDiagram::LLStateDiagram() { mDefaultState = NULL; - mUseDefaultState = FALSE; + mUseDefaultState = false; } LLStateDiagram::~LLStateDiagram() @@ -58,14 +58,14 @@ LLStateDiagram::~LLStateDiagram() } // add a state to the state graph -BOOL LLStateDiagram::addState(LLFSMState *state) +bool LLStateDiagram::addState(LLFSMState *state) { mStates[state] = Transitions(); return true; } // add a directed transition between 2 states -BOOL LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition) +bool LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition) { StateMap::iterator state_it; state_it = mStates.find(&start_state); @@ -97,9 +97,9 @@ BOOL LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_stat } // add an undirected transition between 2 states -BOOL LLStateDiagram::addUndirectedTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition) +bool LLStateDiagram::addUndirectedTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition) { - BOOL result; + bool result; result = addTransition(start_state, end_state, transition); if (result) { @@ -162,7 +162,7 @@ LLFSMState* LLStateDiagram::processTransition(LLFSMState& start_state, LLFSMTran void LLStateDiagram::setDefaultState(LLFSMState& default_state) { - mUseDefaultState = TRUE; + mUseDefaultState = true; mDefaultState = &default_state; } @@ -179,7 +179,7 @@ S32 LLStateDiagram::numDeadendStates() return numDeadends; } -BOOL LLStateDiagram::stateIsValid(LLFSMState& state) +bool LLStateDiagram::stateIsValid(LLFSMState& state) { if (mStates.find(&state) != mStates.end()) { @@ -200,7 +200,7 @@ LLFSMState* LLStateDiagram::getState(U32 state_id) return NULL; } -BOOL LLStateDiagram::saveDotFile(const std::string& filename) +bool LLStateDiagram::saveDotFile(const std::string& filename) { LLAPRFile outfile ; outfile.open(filename, LL_APR_W); @@ -308,7 +308,7 @@ void LLStateMachine::runCurrentState(void *data) } // set current state -BOOL LLStateMachine::setCurrentState(LLFSMState *initial_state, void* user_data, BOOL skip_entry) +bool LLStateMachine::setCurrentState(LLFSMState *initial_state, void* user_data, bool skip_entry) { llassert(mStateDiagram); @@ -325,7 +325,7 @@ BOOL LLStateMachine::setCurrentState(LLFSMState *initial_state, void* user_data, return false; } -BOOL LLStateMachine::setCurrentState(U32 state_id, void* user_data, BOOL skip_entry) +bool LLStateMachine::setCurrentState(U32 state_id, void* user_data, bool skip_entry) { llassert(mStateDiagram); diff --git a/indra/llcharacter/llstatemachine.h b/indra/llcharacter/llstatemachine.h index a2f7e59bd2..521da113e9 100644 --- a/indra/llcharacter/llstatemachine.h +++ b/indra/llcharacter/llstatemachine.h @@ -74,7 +74,7 @@ protected: StateMap mStates; Transitions mDefaultTransitions; LLFSMState* mDefaultState; - BOOL mUseDefaultState; + bool mUseDefaultState; public: LLStateDiagram(); @@ -82,13 +82,13 @@ public: protected: // add a state to the state graph, executed implicitly when adding transitions - BOOL addState(LLFSMState *state); + bool addState(LLFSMState *state); // add a directed transition between 2 states - BOOL addTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition); + bool addTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition); // add an undirected transition between 2 states - BOOL addUndirectedTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition); + bool addUndirectedTransition(LLFSMState& start_state, LLFSMState& end_state, LLFSMTransition& transition); // add a transition that is taken if none other exist void addDefaultTransition(LLFSMState& end_state, LLFSMTransition& transition); @@ -103,14 +103,14 @@ protected: S32 numDeadendStates(); // does this state exist in the state diagram? - BOOL stateIsValid(LLFSMState& state); + bool stateIsValid(LLFSMState& state); // get a state pointer by ID LLFSMState* getState(U32 state_id); public: // save the graph in a DOT file for rendering and visualization - BOOL saveDotFile(const std::string& filename); + bool saveDotFile(const std::string& filename); }; class LLStateMachine @@ -138,10 +138,10 @@ public: void runCurrentState(void *data); // set state by state pointer - BOOL setCurrentState(LLFSMState *initial_state, void* user_data, BOOL skip_entry = TRUE); + bool setCurrentState(LLFSMState *initial_state, void* user_data, bool skip_entry = true); // set state by unique ID - BOOL setCurrentState(U32 state_id, void* user_data, BOOL skip_entry = TRUE); + bool setCurrentState(U32 state_id, void* user_data, bool skip_entry = true); }; #endif //_LL_LLSTATEMACHINE_H diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp index 0697d04fd3..87d61a2d36 100644 --- a/indra/llcharacter/lltargetingmotion.cpp +++ b/indra/llcharacter/lltargetingmotion.cpp @@ -93,7 +93,7 @@ LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *charac //----------------------------------------------------------------------------- // LLTargetingMotion::onActivate() //----------------------------------------------------------------------------- -BOOL LLTargetingMotion::onActivate() +bool LLTargetingMotion::onActivate() { return true; } @@ -101,7 +101,7 @@ BOOL LLTargetingMotion::onActivate() //----------------------------------------------------------------------------- // LLTargetingMotion::onUpdate() //----------------------------------------------------------------------------- -BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask) +bool LLTargetingMotion::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED; F32 slerp_amt = LLSmoothInterpolation::getInterpolant(TORSO_TARGET_HALF_LIFE); @@ -109,7 +109,7 @@ BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask) LLVector3 target; LLVector3* lookAtPoint = (LLVector3*)mCharacter->getAnimationData("LookAtPoint"); - BOOL result = TRUE; + bool result = true; if (!lookAtPoint) { diff --git a/indra/llcharacter/lltargetingmotion.h b/indra/llcharacter/lltargetingmotion.h index 85749a0882..b284dd2941 100644 --- a/indra/llcharacter/lltargetingmotion.h +++ b/indra/llcharacter/lltargetingmotion.h @@ -91,14 +91,14 @@ public: virtual LLMotionInitStatus onInitialize(LLCharacter *character); // called when a motion is activated - // must return TRUE to indicate success, or else + // must return true to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + virtual bool onActivate(); // called per time step - // must return TRUE while it is active, and - // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + // must return true while it is active, and + // must return true when the motion is completed. + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index 2255191e59..5930a28ee8 100644 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -164,8 +164,8 @@ LLVisualParam::LLVisualParam() mLastWeight( 0.f ), mNext( NULL ), mTargetWeight( 0.f ), - mIsAnimating( FALSE ), - mIsDummy(FALSE), + mIsAnimating( false ), + mIsDummy(false), mID( -1 ), mInfo( 0 ), mParamLocation(LOC_UNKNOWN) @@ -207,21 +207,21 @@ LLVisualParam::~LLVisualParam() // setInfo() //----------------------------------------------------------------------------- -BOOL LLVisualParam::setInfo(LLVisualParamInfo *info) +bool LLVisualParam::setInfo(LLVisualParamInfo *info) { llassert(mInfo == NULL); if (info->mID < 0) return false; mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), FALSE ); + setWeight(getDefaultWeight(), false ); return true; } //----------------------------------------------------------------------------- // parseData() //----------------------------------------------------------------------------- -BOOL LLVisualParam::parseData(LLXmlTreeNode *node) +bool LLVisualParam::parseData(LLXmlTreeNode *node) { LLVisualParamInfo *info = new LLVisualParamInfo; @@ -282,7 +282,7 @@ void LLVisualParam::setAnimationTarget(F32 target_value) { mTargetWeight = target_value; } - mIsAnimating = TRUE; + mIsAnimating = true; if (mNext) { @@ -327,7 +327,7 @@ void LLVisualParam::stopAnimating() { if (mIsAnimating && isTweakable()) { - mIsAnimating = FALSE; + mIsAnimating = false; setWeight(mTargetWeight); } } diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 2a632689f0..9cbb3962f4 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -113,11 +113,11 @@ public: // (They can not be virtual because they use specific derived Info classes) LLVisualParamInfo* getInfo() const { return mInfo; } // This sets mInfo and calls initialization functions - BOOL setInfo(LLVisualParamInfo *info); + bool setInfo(LLVisualParamInfo *info); // Virtual functions // Pure virtuals - //virtual BOOL parseData( LLXmlTreeNode *node ) = 0; + //virtual bool parseData( LLXmlTreeNode *node ) = 0; virtual void apply( ESex avatar_sex ) = 0; // Default functions virtual void setWeight(F32 weight); @@ -151,17 +151,17 @@ public: F32 getCurrentWeight() const { return mCurWeight; } F32 getLastWeight() const { return mLastWeight; } void setLastWeight(F32 val) { mLastWeight = val; } - BOOL isAnimating() const { return mIsAnimating; } - BOOL isTweakable() const { return (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) || (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT); } + bool isAnimating() const { return mIsAnimating; } + bool isTweakable() const { return (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) || (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT); } LLVisualParam* getNextParam() { return mNext; } void setNextParam( LLVisualParam *next ); void clearNextParam(); - virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating && !mIsDummy; } - BOOL getAnimating() const { return mIsAnimating; } + virtual void setAnimating(bool is_animating) { mIsAnimating = is_animating && !mIsDummy; } + bool getAnimating() const { return mIsAnimating; } - void setIsDummy(BOOL is_dummy) { mIsDummy = is_dummy; } + void setIsDummy(bool is_dummy) { mIsDummy = is_dummy; } void setParamLocation(EParamLocation loc); EParamLocation getParamLocation() const { return mParamLocation; } @@ -173,8 +173,8 @@ protected: F32 mLastWeight; // last weight LLVisualParam* mNext; // next param in a shared chain F32 mTargetWeight; // interpolation target - BOOL mIsAnimating; // this value has been given an interpolation target - BOOL mIsDummy; // this is used to prevent dummy visual params from animating + bool mIsAnimating; // this value has been given an interpolation target + bool mIsDummy; // this is used to prevent dummy visual params from animating S32 mID; // id for storing weight/morphtarget compares compactly diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index ef77b0b1c8..6e6797312b 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -1359,7 +1359,7 @@ S32 LLStringUtil::format(std::string& s, const format_map_t& substitutions) if (iter != substitutions.end()) { S32 secFromEpoch = 0; - BOOL r = LLStringUtil::convertToS32(iter->second, secFromEpoch); + bool r = LLStringUtil::convertToS32(iter->second, secFromEpoch); if (r) { found_replacement = formatDatetime(replacement, tokens[0], param, secFromEpoch); diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 47dbf967cf..f2741a0e1f 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -382,7 +382,7 @@ public: static void _makeASCII(string_type& string); // Conversion to other data types - static bool convertToBOOL(const string_type& string, BOOL& value); + static bool convertToBOOL(const string_type& string, bool& value); static bool convertToU8(const string_type& string, U8& value); static bool convertToS8(const string_type& string, S8& value); static bool convertToS16(const string_type& string, S16& value); @@ -1804,7 +1804,7 @@ auto LLStringUtilBase::getenv(const std::string& key, const string_type& dflt } template -bool LLStringUtilBase::convertToBOOL(const string_type& string, BOOL& value) +bool LLStringUtilBase::convertToBOOL(const string_type& string, bool& value) { if( string.empty() ) { diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index aa9d9572be..78dcf40ac6 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -124,10 +124,10 @@ LLParcel::LLParcel() LLParcel::LLParcel(const LLUUID &owner_id, - BOOL modify, BOOL terraform, BOOL damage, + bool modify, bool terraform, bool damage, time_t claim_date, S32 claim_price_per_meter, S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned) + bool is_group_owned) { init( owner_id, modify, terraform, damage, claim_date, claim_price_per_meter, rent_price_per_meter, area, sim_object_limit, parcel_object_bonus, @@ -142,10 +142,10 @@ LLParcel::~LLParcel() } void LLParcel::init(const LLUUID &owner_id, - BOOL modify, BOOL terraform, BOOL damage, + bool modify, bool terraform, bool damage, time_t claim_date, S32 claim_price_per_meter, S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned) + bool is_group_owned) { mID.setNull(); mOwnerID = owner_id; @@ -172,7 +172,7 @@ void LLParcel::init(const LLUUID &owner_id, mSaleTimerExpires.stop(); mGraceExtension = 0; //mExpireAction = STEA_REVERT; - //mRecordTransaction = FALSE; + //mRecordTransaction = false; mAuctionID = 0; mInEscrow = false; @@ -238,7 +238,7 @@ void LLParcel::init(const LLUUID &owner_id, setObscureMOAP(false); } -void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned) +void LLParcel::overrideOwner(const LLUUID& owner_id, bool is_group_owned) { // Override with system permission (LLUUID::null) // Overridden parcels have no group @@ -352,7 +352,7 @@ void LLParcel::setAllParcelFlags(U32 flags) mParcelFlags = flags; } -void LLParcel::setParcelFlag(U32 flag, BOOL b) +void LLParcel::setParcelFlag(U32 flag, bool b) { if (b) { @@ -365,7 +365,7 @@ void LLParcel::setParcelFlag(U32 flag, BOOL b) } -BOOL LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const +bool LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const { if (agent_id == LLUUID::null) { @@ -394,7 +394,7 @@ BOOL LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) con return false; } -BOOL LLParcel::allowTerraformBy(const LLUUID &agent_id) const +bool LLParcel::allowTerraformBy(const LLUUID &agent_id) const { if (agent_id == LLUUID::null) { @@ -441,7 +441,7 @@ void LLParcel::setDiscountRate(F32 rate) // File input and output //----------------------------------------------------------- -BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entry) +bool LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entry) { skip_to_end_of_next_keyword("{", input_stream); while (input_stream.good()) @@ -561,9 +561,9 @@ void LLParcel::unpackMessage(LLMessageSystem* msg) msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer ); setMediaURL(buffer); - BOOL see_avs = TRUE; // All default to true for legacy server behavior - BOOL any_av_sounds = TRUE; - BOOL group_av_sounds = TRUE; + bool see_avs = true; // All default to true for legacy server behavior + bool any_av_sounds = true; + bool group_av_sounds = true; bool have_new_parcel_limit_data = (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_SeeAVs) > 0); // New version of server should send all 3 of these values have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_AnyAVSounds) > 0); have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_GroupAVSounds) > 0); @@ -787,7 +787,7 @@ void LLParcel::extendAABB(const LLVector3& box_min, const LLVector3& box_max) } } -BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) +bool LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) { if (mAccessList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) { @@ -828,7 +828,7 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) return true; } -BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) +bool LLParcel::addToBanList(const LLUUID& agent_id, S32 time) { if (mBanList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) { @@ -871,10 +871,10 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) return true; } -BOOL remove_from_access_array(std::map* list, +bool remove_from_access_array(std::map* list, const LLUUID& agent_id) { - BOOL removed = FALSE; + bool removed = false; LLAccessEntry::map::iterator itor = list->begin(); while (itor != list->end()) { @@ -882,7 +882,7 @@ BOOL remove_from_access_array(std::map* list, if (entry.mID == agent_id) { list->erase(itor++); - removed = TRUE; + removed = true; } else { @@ -892,12 +892,12 @@ BOOL remove_from_access_array(std::map* list, return removed; } -BOOL LLParcel::removeFromAccessList(const LLUUID& agent_id) +bool LLParcel::removeFromAccessList(const LLUUID& agent_id) { return remove_from_access_array(&mAccessList, agent_id); } -BOOL LLParcel::removeFromBanList(const LLUUID& agent_id) +bool LLParcel::removeFromBanList(const LLUUID& agent_id) { return remove_from_access_array(&mBanList, agent_id); } @@ -947,13 +947,13 @@ const std::string& LLParcel::getActionString(LLParcel::EAction action) return PARCEL_ACTION_STRING[index]; } -BOOL LLParcel::isSaleTimerExpired(const U64& time) +bool LLParcel::isSaleTimerExpired(const U64& time) { if (mSaleTimerExpires.getStarted() == FALSE) { return false; } - BOOL expired = mSaleTimerExpires.checkExpirationAndReset(0.0); + bool expired = mSaleTimerExpires.checkExpirationAndReset(0.0); if (expired) { mSaleTimerExpires.stop(); @@ -961,13 +961,13 @@ BOOL LLParcel::isSaleTimerExpired(const U64& time) return expired; } -BOOL LLParcel::isMediaResetTimerExpired(const U64& time) +bool LLParcel::isMediaResetTimerExpired(const U64& time) { - if (mMediaResetTimer.getStarted() == FALSE) + if (mMediaResetTimer.getStarted() == false) { return false; } - BOOL expired = mMediaResetTimer.checkExpirationAndReset(0.0); + bool expired = mMediaResetTimer.checkExpirationAndReset(0.0); if (expired) { mMediaResetTimer.stop(); @@ -976,7 +976,7 @@ BOOL LLParcel::isMediaResetTimerExpired(const U64& time) } -void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group) +void LLParcel::startSale(const LLUUID& buyer_id, bool is_buyer_group) { // TODO -- this and all Sale related methods need to move out of the LLParcel // base class and into server-side-only LLSimParcel class @@ -1042,7 +1042,7 @@ void LLParcel::completeSale( // Turn off show directory, since it's a recurring fee that // the buyer may not want. - setParcelFlag(PF_SHOW_DIRECTORY, FALSE); + setParcelFlag(PF_SHOW_DIRECTORY, false); //should be cleared on sale. mAccessList.clear(); @@ -1069,12 +1069,12 @@ void LLParcel::clearSale() setSellWithObjects(FALSE); } -BOOL LLParcel::isPublic() const +bool LLParcel::isPublic() const { return (mOwnerID.isNull()); } -BOOL LLParcel::isBuyerAuthorized(const LLUUID& buyer_id) const +bool LLParcel::isBuyerAuthorized(const LLUUID& buyer_id) const { if(mAuthBuyerID.isNull()) { diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index f5ee1241ab..e3c27e7d73 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -209,37 +209,37 @@ public: LLParcel(); LLParcel( const LLUUID &owner_id, - BOOL modify, - BOOL terraform, - BOOL damage, + bool modify, + bool terraform, + bool damage, time_t claim_date, S32 claim_price, S32 rent_price, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned = FALSE); + bool is_group_owned = false); virtual ~LLParcel(); void init( const LLUUID &owner_id, - BOOL modify, - BOOL terraform, - BOOL damage, + bool modify, + bool terraform, + bool damage, time_t claim_date, S32 claim_price, S32 rent_price, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, - BOOL is_group_owned = FALSE); + bool is_group_owned = false); // TODO: make an actual copy constructor for this void overrideParcelFlags(U32 flags); // if you specify an agent id here, the group id will be zeroed void overrideOwner( const LLUUID& owner_id, - BOOL is_group_owned = FALSE); + bool is_group_owned = false); void overrideSaleTimerExpires(F32 secs_left) { mSaleTimerExpires.setTimerExpirySec(secs_left); } // MANIPULATORS @@ -283,7 +283,7 @@ public: void setAuctionID(U32 auction_id) { mAuctionID = auction_id;} void setAllParcelFlags(U32 flags); - void setParcelFlag(U32 flag, BOOL b); + void setParcelFlag(U32 flag, bool b); virtual void setArea(S32 area, S32 sim_object_limit); void setDiscountRate(F32 rate); @@ -316,7 +316,7 @@ public: void setPassHours(F32 hours) { mPassHours = hours; } // BOOL importStream(std::istream& input_stream); - BOOL importAccessEntry(std::istream& input_stream, LLAccessEntry* entry); + bool importAccessEntry(std::istream& input_stream, LLAccessEntry* entry); // BOOL exportStream(std::ostream& output_stream); void packMessage(LLMessageSystem* msg); @@ -344,10 +344,10 @@ public: void expirePasses(S32 now); // Add to list, suppressing duplicates. Returns TRUE if added. - BOOL addToAccessList(const LLUUID& agent_id, S32 time); - BOOL addToBanList(const LLUUID& agent_id, S32 time); - BOOL removeFromAccessList(const LLUUID& agent_id); - BOOL removeFromBanList(const LLUUID& agent_id); + bool addToAccessList(const LLUUID& agent_id, S32 time); + bool addToBanList(const LLUUID& agent_id, S32 time); + bool removeFromAccessList(const LLUUID& agent_id); + bool removeFromBanList(const LLUUID& agent_id); // ACCESSORS const LLUUID& getID() const { return mID; } @@ -377,14 +377,14 @@ public: U32 getAuctionID() const { return mAuctionID; } bool isInEscrow() const { return mInEscrow; } - BOOL isPublic() const; + bool isPublic() const; // Region-local user-specified position const LLVector3& getUserLocation() const { return mUserLocation; } const LLVector3& getUserLookAt() const { return mUserLookAt; } ELandingType getLandingType() const { return mLandingType; } - BOOL getSeeAVs() const { return mSeeAVs; } - BOOL getHaveNewParcelLimitData() const { return mHaveNewParcelLimitData; } + bool getSeeAVs() const { return mSeeAVs; } + bool getHaveNewParcelLimitData() const { return mHaveNewParcelLimitData; } // User-specified snapshot const LLUUID& getSnapshotID() const { return mSnapshotID; } @@ -395,7 +395,7 @@ public: const LLUUID& getAuthorizedBuyerID() const { return mAuthBuyerID; } // helper function - BOOL isBuyerAuthorized(const LLUUID& buyer_id) const; + bool isBuyerAuthorized(const LLUUID& buyer_id) const; // The buyer of a plot is set when someone indicates they want to // buy the plot, and the system is simply waiting for tier-up @@ -422,7 +422,7 @@ public: // the isSaleTimerExpired will trivially return FALSE if there is // no sale going on. Pass in the current time in usec which will // be used for comparison. - BOOL isSaleTimerExpired(const U64& time); + bool isSaleTimerExpired(const U64& time); F32 getSaleTimerExpires() { return mSaleTimerExpires.getRemainingTimeF32(); } @@ -431,7 +431,7 @@ public: // need to record a few things with the parcel when a sale // starts. - void startSale(const LLUUID& buyer_id, BOOL is_buyer_group); + void startSale(const LLUUID& buyer_id, bool is_buyer_group); // do the expiration logic, which needs to return values usable in // a L$ transaction. @@ -440,26 +440,26 @@ public: void clearSale(); - BOOL isMediaResetTimerExpired(const U64& time); + bool isMediaResetTimerExpired(const U64& time); // more accessors U32 getParcelFlags() const { return mParcelFlags; } - BOOL getParcelFlag(U32 flag) const - { return (mParcelFlags & flag) ? TRUE : FALSE; } + bool getParcelFlag(U32 flag) const + { return (mParcelFlags & flag) ? true : false; } // objects can be added or modified by anyone (only parcel owner if disabled) - BOOL getAllowModify() const - { return (mParcelFlags & PF_CREATE_OBJECTS) ? TRUE : FALSE; } + bool getAllowModify() const + { return (mParcelFlags & PF_CREATE_OBJECTS) ? true : false; } // objects can be added or modified by group members - BOOL getAllowGroupModify() const - { return (mParcelFlags & PF_CREATE_GROUP_OBJECTS) ? TRUE : FALSE; } + bool getAllowGroupModify() const + { return (mParcelFlags & PF_CREATE_GROUP_OBJECTS) ? true : false; } // the parcel can be deeded to the group - BOOL getAllowDeedToGroup() const - { return (mParcelFlags & PF_ALLOW_DEED_TO_GROUP) ? TRUE : FALSE; } + bool getAllowDeedToGroup() const + { return (mParcelFlags & PF_ALLOW_DEED_TO_GROUP) ? true : false; } // Does the owner want to make a contribution along with the deed. BOOL getContributeWithDeed() const @@ -537,10 +537,10 @@ public: S32 getClaimPrice() const { return mClaimPricePerMeter * mArea; } // Can this agent create objects here? - BOOL allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const; + bool allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const; // Can this agent change the shape of the land? - BOOL allowTerraformBy(const LLUUID &agent_id) const; + bool allowTerraformBy(const LLUUID &agent_id) const; bool operator==(const LLParcel &rhs) const; diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index 0359d2f554..693a0da123 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -87,21 +87,21 @@ void LLPermissions::initMasks(LLInventoryType::EType type) } } -BOOL LLPermissions::getOwnership(LLUUID& owner_id, BOOL& is_group_owned) const +bool LLPermissions::getOwnership(LLUUID& owner_id, bool& is_group_owned) const { if(mOwner.notNull()) { owner_id = mOwner; - is_group_owned = FALSE; - return TRUE; + is_group_owned = false; + return true; } else if(mIsGroupOwned) { owner_id = mGroup; - is_group_owned = TRUE; - return TRUE; + is_group_owned = true; + return true; } - return FALSE; + return false; } LLUUID LLPermissions::getSafeOwner() const @@ -232,13 +232,13 @@ void LLPermissions::accumulate(const LLPermissions& perm) // saves last owner, sets current owner, and sets the group. note // that this function has to more cleverly apply the fair use // permissions. -BOOL LLPermissions::setOwnerAndGroup( +bool LLPermissions::setOwnerAndGroup( const LLUUID& agent, const LLUUID& owner, const LLUUID& group, bool is_atomic) { - BOOL allowed = FALSE; + bool allowed = false; if( agent.isNull() || mOwner.isNull() || ((agent == mOwner) && ((owner == mOwner) || (mMaskOwner & PERM_TRANSFER)) ) ) @@ -246,7 +246,7 @@ BOOL LLPermissions::setOwnerAndGroup( // ...system can alway set owner // ...public objects can be claimed by anyone // ...otherwise, agent must own it and have transfer ability - allowed = TRUE; + allowed = true; } if (allowed) @@ -301,7 +301,7 @@ void LLPermissions::yesReallySetOwner(const LLUUID& owner, bool group_owned) mIsGroupOwned = group_owned; } -BOOL LLPermissions::deedToGroup(const LLUUID& agent, const LLUUID& group) +bool LLPermissions::deedToGroup(const LLUUID& agent, const LLUUID& group) { if(group.notNull() && (agent.isNull() || ((group == mGroup) && (mMaskOwner & PERM_TRANSFER) @@ -318,18 +318,18 @@ BOOL LLPermissions::deedToGroup(const LLUUID& agent, const LLUUID& group) mIsGroupOwned = true; fixFairUse(); fix(); - return TRUE; + return true; } - return FALSE; + return false; } -BOOL LLPermissions::setBaseBits(const LLUUID& agent, BOOL set, PermissionMask bits) +bool LLPermissions::setBaseBits(const LLUUID& agent, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = true; if(agent.isNull()) { // only the system is always allowed to change base bits - ownership = TRUE; + ownership = true; } if (ownership) @@ -351,19 +351,19 @@ BOOL LLPermissions::setBaseBits(const LLUUID& agent, BOOL set, PermissionMask bi // Note: If you attempt to set bits that the base bits doesn't allow, // the function will succeed, but those bits will not be set. -BOOL LLPermissions::setOwnerBits(const LLUUID& agent, BOOL set, PermissionMask bits) +bool LLPermissions::setOwnerBits(const LLUUID& agent, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = false; if(agent.isNull()) { // ...system always allowed to change things - ownership = TRUE; + ownership = true; } else if (agent == mOwner) { // ...owner bits can only be set by owner - ownership = TRUE; + ownership = true; } // If we have correct ownership and @@ -383,15 +383,15 @@ BOOL LLPermissions::setOwnerBits(const LLUUID& agent, BOOL set, PermissionMask b return (ownership); } -BOOL LLPermissions::setGroupBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits) +bool LLPermissions::setGroupBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = false; if((agent.isNull()) || (agent == mOwner) || ((group == mGroup) && (!mGroup.isNull()))) { // The group bits can be set by the system, the owner, or a // group member. - ownership = TRUE; + ownership = true; } if (ownership) @@ -412,15 +412,15 @@ BOOL LLPermissions::setGroupBits(const LLUUID& agent, const LLUUID& group, BOOL // Note: If you attempt to set bits that the creator or owner doesn't allow, // the function will succeed, but those bits will not be set. -BOOL LLPermissions::setEveryoneBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits) +bool LLPermissions::setEveryoneBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = false; if((agent.isNull()) || (agent == mOwner) || ((group == mGroup) && (!mGroup.isNull()))) { // The everyone bits can be set by the system, the owner, or a // group member. - ownership = TRUE; + ownership = true; } if (ownership) { @@ -441,15 +441,15 @@ BOOL LLPermissions::setEveryoneBits(const LLUUID& agent, const LLUUID& group, BO // Note: If you attempt to set bits that the creator or owner doesn't allow, // the function will succeed, but those bits will not be set. -BOOL LLPermissions::setNextOwnerBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits) +bool LLPermissions::setNextOwnerBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits) { - BOOL ownership = FALSE; + bool ownership = false; if((agent.isNull()) || (agent == mOwner) || ((group == mGroup) && (!mGroup.isNull()))) { // The next owner bits can be set by the system, the owner, or // a group member. - ownership = TRUE; + ownership = true; } if (ownership) { @@ -478,7 +478,7 @@ bool LLPermissions::allowOperationBy(PermissionBit op, const LLUUID& requester, { // ...system making request // ...not owned - return TRUE; + return true; } else if (mIsGroupOwned && (mGroup == requester)) { @@ -513,7 +513,7 @@ LLSD LLPermissions::packMessage() const result["group-mask"] = (S32)mMaskGroup; result["everyone-mask"] = (S32)mMaskEveryone; result["next-owner-mask"]= (S32)mMaskNextOwner; - result["group-owned"] = (BOOL)mIsGroupOwned; + result["group-owned"] = (bool)mIsGroupOwned; return result; } @@ -531,7 +531,7 @@ void LLPermissions::packMessage(LLMessageSystem* msg) const msg->addU32Fast(_PREHASH_GroupMask, mMaskGroup ); msg->addU32Fast(_PREHASH_EveryoneMask, mMaskEveryone ); msg->addU32Fast(_PREHASH_NextOwnerMask, mMaskNextOwner ); - msg->addBOOLFast(_PREHASH_GroupOwned, (BOOL)mIsGroupOwned); + msg->addBOOLFast(_PREHASH_GroupOwned, mIsGroupOwned); } void LLPermissions::unpackMessage(LLSD perms) @@ -559,13 +559,13 @@ void LLPermissions::unpackMessage(LLMessageSystem* msg, const char* block, S32 b msg->getU32Fast(block, _PREHASH_GroupMask, mMaskGroup, block_num ); msg->getU32Fast(block, _PREHASH_EveryoneMask, mMaskEveryone, block_num ); msg->getU32Fast(block, _PREHASH_NextOwnerMask, mMaskNextOwner, block_num ); - BOOL tmp; + bool tmp; msg->getBOOLFast(block, _PREHASH_GroupOwned, tmp, block_num); - mIsGroupOwned = (bool)tmp; + mIsGroupOwned = tmp; } -BOOL LLPermissions::importLegacyStream(std::istream& input_stream) +bool LLPermissions::importLegacyStream(std::istream& input_stream) { init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null); const S32 BUFSIZE = 16384; @@ -661,11 +661,11 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream) } } fix(); - return TRUE; + return true; } -BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const +bool LLPermissions::exportLegacyStream(std::ostream& output_stream) const { std::string uuid_str; @@ -701,12 +701,9 @@ BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const output_stream << "\t\tgroup_owned\t1\n"; } output_stream << "\t}\n"; - return TRUE; + return true; } -// Deleted LLPermissions::exportFileXML() and LLPermissions::importXML() -// because I can't find any non-test code references to it. 2009-05-04 JC - bool LLPermissions::operator==(const LLPermissions &rhs) const { return @@ -791,21 +788,21 @@ U8 LLAggregatePermissions::getU8() const return byte; } -BOOL LLAggregatePermissions::isEmpty() const +bool LLAggregatePermissions::isEmpty() const { for(S32 i = 0; i < PI_END; ++i) { if(mBits[i] != AP_EMPTY) { - return FALSE; + return false; } } - return TRUE; + return true; } void LLAggregatePermissions::aggregate(PermissionMask mask) { - BOOL is_allowed = mask & PERM_COPY; + bool is_allowed = mask & PERM_COPY; aggregateBit(PI_COPY, is_allowed); is_allowed = mask & PERM_MODIFY; aggregateBit(PI_MODIFY, is_allowed); @@ -821,7 +818,7 @@ void LLAggregatePermissions::aggregate(const LLAggregatePermissions& ag) } } -void LLAggregatePermissions::aggregateBit(EPermIndex idx, BOOL allowed) +void LLAggregatePermissions::aggregateBit(EPermIndex idx, bool allowed) { //if(AP_SOME == mBits[idx]) return; // P4 branch prediction optimization switch(mBits[idx]) diff --git a/indra/llinventory/llpermissions.h b/indra/llinventory/llpermissions.h index 27252f7b97..a8acef098a 100644 --- a/indra/llinventory/llpermissions.h +++ b/indra/llinventory/llpermissions.h @@ -162,7 +162,7 @@ public: // either the owner id or the group id, and the is_group_owned // parameter is appropriately filled. The values of owner_id and // is_group_owned are not changed if the object is not owned. - BOOL getOwnership(LLUUID& owner_id, BOOL& is_group_owned) const; + bool getOwnership(LLUUID& owner_id, bool& is_group_owned) const; // Gets the 'safe' owner. This should never return LLUUID::null. // If no group owned, return the agent owner id normally. @@ -218,7 +218,7 @@ public: // Currently, the only way to have a collection is when an object // has inventory and is then itself rolled up into an inventory // item. - BOOL setOwnerAndGroup(const LLUUID& agent, const LLUUID& owner, const LLUUID& group, bool is_atomic); + bool setOwnerAndGroup(const LLUUID& agent, const LLUUID& owner, const LLUUID& group, bool is_atomic); // only call this if you know what you're doing // there are usually perm-bit consequences when the @@ -239,16 +239,16 @@ public: // owner transfer) then this function will deed the permissions, // set the next owner mask, and return TRUE. Otherwise, no change // is effected, and the function returns FALSE. - BOOL deedToGroup(const LLUUID& agent, const LLUUID& group); + bool deedToGroup(const LLUUID& agent, const LLUUID& group); // Attempt to set or clear the given bitmask. Returns TRUE if you // are allowed to modify the permissions. If you attempt to turn // on bits not allowed by the base bits, the function will return // TRUE, but those bits will not be set. - BOOL setBaseBits( const LLUUID& agent, BOOL set, PermissionMask bits); - BOOL setOwnerBits( const LLUUID& agent, BOOL set, PermissionMask bits); - BOOL setGroupBits( const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits); - BOOL setEveryoneBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits); - BOOL setNextOwnerBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits); + bool setBaseBits( const LLUUID& agent, bool set, PermissionMask bits); + bool setOwnerBits( const LLUUID& agent, bool set, PermissionMask bits); + bool setGroupBits( const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits); + bool setEveryoneBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits); + bool setNextOwnerBits(const LLUUID& agent, const LLUUID& group, bool set, PermissionMask bits); // This is currently only used in the Viewer to handle calling cards // where the creator is actually used to store the target. Use with care. @@ -311,8 +311,8 @@ public: void packMessage(LLMessageSystem* msg) const; void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); - BOOL importLegacyStream(std::istream& input_stream); - BOOL exportLegacyStream(std::ostream& output_stream) const; + bool importLegacyStream(std::istream& input_stream); + bool exportLegacyStream(std::ostream& output_stream) const; bool operator==(const LLPermissions &rhs) const; bool operator!=(const LLPermissions &rhs) const; @@ -401,8 +401,8 @@ public: // LSB is to the right U8 getU8() const; - // return TRUE is the aggregate permissions are empty, otherwise FALSE. - BOOL isEmpty() const ; + // return true is the aggregate permissions are empty, otherwise false. + bool isEmpty() const ; // pass in a PERM_COPY, PERM_TRANSFER, etc, and an EValue // enumeration to specifically set that value. Not implemented @@ -432,7 +432,7 @@ protected: PI_END = 3, PI_COUNT = 3 }; - void aggregateBit(EPermIndex idx, BOOL allowed); + void aggregateBit(EPermIndex idx, bool allowed); void aggregateIndex(EPermIndex idx, U8 bits); static EPermIndex perm2PermIndex(PermissionBit bit); diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index f9306d6bce..5f0c668b33 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -803,16 +803,16 @@ S32 LLProfile::getNumPoints(const LLProfileParams& params, BOOL path_open,F32 de } -BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detail, S32 split, - BOOL is_sculpted, S32 sculpt_size) +bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detail, S32 split, + bool is_sculpted, S32 sculpt_size) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME if ((!mDirty) && (!is_sculpted)) { - return FALSE; + return false; } - mDirty = FALSE; + mDirty = false; if (detail < MIN_LOD) { @@ -833,7 +833,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai if (begin > end - 0.01f) { LL_WARNS() << "LLProfile::generate() assertion failed (begin >= end)" << LL_ENDL; - return FALSE; + return false; } S32 face_num = 0; @@ -1014,11 +1014,11 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai } if (mOpen && !params.getHollow()) { - addFace(0,mTotal-1,0,LL_FACE_OUTER_SIDE_0, FALSE); + addFace(0,mTotal-1,0,LL_FACE_OUTER_SIDE_0, false); } else { - addFace(0,mTotal,0,LL_FACE_OUTER_SIDE_0, FALSE); + addFace(0,mTotal,0,LL_FACE_OUTER_SIDE_0, false); } if (hollow) @@ -1026,15 +1026,15 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai switch (hole_type) { case LL_PCODE_HOLE_SQUARE: - addHole(params, TRUE, 2, 0.5f, hollow, 0.5f, split); + addHole(params, true, 2, 0.5f, hollow, 0.5f, split); break; case LL_PCODE_HOLE_TRIANGLE: - addHole(params, TRUE, 3, 0.5f, hollow, 0.5f, split); + addHole(params, true, 3, 0.5f, hollow, 0.5f, split); break; case LL_PCODE_HOLE_CIRCLE: case LL_PCODE_HOLE_SAME: default: - addHole(params, FALSE, circle_detail, 0.5f, hollow, 0.5f); + addHole(params, false, circle_detail, 0.5f, hollow, 0.5f); break; } } @@ -1042,11 +1042,11 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai // Special case for openness of sphere if ((params.getEnd() - params.getBegin()) < 1.f) { - mOpen = TRUE; + mOpen = true; } else if (!hollow) { - mOpen = FALSE; + mOpen = false; mProfile.push_back(mProfile[0]); mTotal++; } @@ -1064,19 +1064,19 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai if ( mOpen) // interior edge caps { - addFace(mTotal-1, 2,0.5,LL_FACE_PROFILE_BEGIN, TRUE); + addFace(mTotal-1, 2,0.5,LL_FACE_PROFILE_BEGIN, true); if (hollow) { - addFace(mTotalOut-1, 2,0.5,LL_FACE_PROFILE_END, TRUE); + addFace(mTotalOut-1, 2,0.5,LL_FACE_PROFILE_END, true); } else { - addFace(mTotal-2, 2,0.5,LL_FACE_PROFILE_END, TRUE); + addFace(mTotal-2, 2,0.5,LL_FACE_PROFILE_END, true); } } - return TRUE; + return true; } @@ -1521,14 +1521,14 @@ S32 LLPath::getNumPoints(const LLPathParams& params, F32 detail) return np; } -BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, - BOOL is_sculpted, S32 sculpt_size) +bool LLPath::generate(const LLPathParams& params, F32 detail, S32 split, + bool is_sculpted, S32 sculpt_size) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME if ((!mDirty) && (!is_sculpted)) { - return FALSE; + return false; } if (detail < MIN_LOD) @@ -1537,11 +1537,11 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, detail = MIN_LOD; } - mDirty = FALSE; + mDirty = false; S32 np = 2; // hardcode for line mPath.resize(0); - mOpen = TRUE; + mOpen = true; // Is this 0xf0 mask really necessary? DK 03/02/05 switch (params.getCurveType() & 0xf0) @@ -1601,7 +1601,7 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, if (params.getEnd() - params.getBegin() >= 0.99f && params.getScaleX() >= .99f) { - mOpen = FALSE; + mOpen = false; } //genNGon(params, llfloor(MIN_DETAIL_FACES * detail), 4.f, 0.f); @@ -1645,19 +1645,19 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, break; }; - if (params.getTwist() != params.getTwistBegin()) mOpen = TRUE; + if (params.getTwist() != params.getTwistBegin()) mOpen = true; //if ((int(fabsf(params.getTwist() - params.getTwistBegin())*100))%100 != 0) { - // mOpen = TRUE; + // mOpen = true; //} - return TRUE; + return true; } -BOOL LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split, - BOOL is_sculpted, S32 sculpt_size) +bool LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split, + bool is_sculpted, S32 sculpt_size) { - mOpen = TRUE; // Draw end caps + mOpen = true; // Draw end caps if (getPathLength() == 0) { // Path hasn't been generated yet. @@ -1676,7 +1676,7 @@ BOOL LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split, } } - return TRUE; + return true; } diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index c27bc5e821..0158ca9bcd 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -703,9 +703,9 @@ public: static S32 getNumPoints(const LLProfileParams& params, BOOL path_open, F32 detail = 1.0f, S32 split = 0, BOOL is_sculpted = FALSE, S32 sculpt_size = 0); - BOOL generate(const LLProfileParams& params, BOOL path_open, F32 detail = 1.0f, S32 split = 0, - BOOL is_sculpted = FALSE, S32 sculpt_size = 0); - BOOL isConcave() const { return mConcave; } + bool generate(const LLProfileParams& params, bool path_open, F32 detail = 1.0f, S32 split = 0, + bool is_sculpted = false, S32 sculpt_size = 0); + bool isConcave() const { return mConcave; } public: struct Face { @@ -792,8 +792,8 @@ public: static S32 getNumNGonPoints(const LLPathParams& params, S32 sides, F32 offset=0.0f, F32 end_scale = 1.f, F32 twist_scale = 1.f); void genNGon(const LLPathParams& params, S32 sides, F32 offset=0.0f, F32 end_scale = 1.f, F32 twist_scale = 1.f); - virtual BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, - BOOL is_sculpted = FALSE, S32 sculpt_size = 0); + virtual bool generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, + bool is_sculpted = false, S32 sculpt_size = 0); BOOL isOpen() const { return mOpen; } F32 getStep() const { return mStep; } @@ -819,8 +819,8 @@ class LLDynamicPath : public LLPath { public: LLDynamicPath() : LLPath() { } - /*virtual*/ BOOL generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, - BOOL is_sculpted = FALSE, S32 sculpt_size = 0); + /*virtual*/ bool generate(const LLPathParams& params, F32 detail=1.0f, S32 split = 0, + bool is_sculpted = false, S32 sculpt_size = 0); }; // Yet another "face" class - caches volume-specific, but not instance-specific data for faces) diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index f38a5e663e..60d95c3367 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -1020,7 +1020,7 @@ void LLAssetStorage::processUploadComplete(LLMessageSystem *msg, void **user_dat LLUUID uuid; S8 asset_type_s8; LLAssetType::EType asset_type; - BOOL success = FALSE; + bool success = false; msg->getUUIDFast(_PREHASH_AssetBlock, _PREHASH_UUID, uuid); msg->getS8Fast(_PREHASH_AssetBlock, _PREHASH_Type, asset_type_s8); diff --git a/indra/llmessage/llmessagereader.h b/indra/llmessage/llmessagereader.h index 3b77a6bfe4..647f267785 100644 --- a/indra/llmessage/llmessagereader.h +++ b/indra/llmessage/llmessagereader.h @@ -52,7 +52,7 @@ class LLMessageReader /** All get* methods expect pointers to canonical strings. */ virtual void getBinaryData(const char *blockname, const char *varname, void *datap, S32 size, S32 blocknum = 0, S32 max_size = S32_MAX) = 0; - virtual void getBOOL(const char *block, const char *var, BOOL &data, S32 blocknum = 0) = 0; + virtual void getBOOL(const char *block, const char *var, bool &data, S32 blocknum = 0) = 0; virtual void getS8(const char *block, const char *var, S8 &data, S32 blocknum = 0) = 0; virtual void getU8(const char *block, const char *var, U8 &data, S32 blocknum = 0) = 0; virtual void getS16(const char *block, const char *var, S16 &data, S32 blocknum = 0) = 0; diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp index b729ebafa9..d533d6535b 100644 --- a/indra/llmessage/llsdmessagereader.cpp +++ b/indra/llmessage/llsdmessagereader.cpp @@ -114,7 +114,7 @@ void LLSDMessageReader::getBinaryData(const char *block, const char *var, //virtual void LLSDMessageReader::getBOOL(const char *block, const char *var, - BOOL &data, + bool &data, S32 blocknum) { data = getLLSD(mMessage, block, var, blocknum); diff --git a/indra/llmessage/llsdmessagereader.h b/indra/llmessage/llsdmessagereader.h index 3b3d7fbfbe..4119de6009 100644 --- a/indra/llmessage/llsdmessagereader.h +++ b/indra/llmessage/llsdmessagereader.h @@ -46,7 +46,7 @@ public: virtual void getBinaryData(const char *block, const char *var, void *datap, S32 size, S32 blocknum = 0, S32 max_size = S32_MAX); - virtual void getBOOL(const char *block, const char *var, BOOL &data, + virtual void getBOOL(const char *block, const char *var, bool &data, S32 blocknum = 0); virtual void getS8(const char *block, const char *var, S8 &data, S32 blocknum = 0); diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 32f79f0546..8a41d5565d 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -284,7 +284,7 @@ void LLTemplateMessageReader::getU8(const char *block, const char *var, } void LLTemplateMessageReader::getBOOL(const char *block, const char *var, - BOOL &b, S32 blocknum ) + bool &b, S32 blocknum ) { U8 value; getData(block, var, &value, sizeof(U8), blocknum); diff --git a/indra/llmessage/lltemplatemessagereader.h b/indra/llmessage/lltemplatemessagereader.h index fcf8f92fa6..88889cd7d2 100644 --- a/indra/llmessage/lltemplatemessagereader.h +++ b/indra/llmessage/lltemplatemessagereader.h @@ -47,7 +47,7 @@ public: virtual void getBinaryData(const char *blockname, const char *varname, void *datap, S32 size, S32 blocknum = 0, S32 max_size = S32_MAX); - virtual void getBOOL(const char *block, const char *var, BOOL &data, + virtual void getBOOL(const char *block, const char *var, bool &data, S32 blocknum = 0); virtual void getS8(const char *block, const char *var, S8 &data, S32 blocknum = 0); diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index f9b59d7e42..956ecc11a3 100644 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -757,7 +757,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user LLUUID uuid; LLAssetType::EType type; S16 type_s16; - BOOL b_use_big_packets; + bool b_use_big_packets; mesgsys->getBOOL("XferID", "UseBigPackets", b_use_big_packets); @@ -853,7 +853,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user } LL_INFOS("Xfer") << "starting file transfer: " << expanded_filename << " to " << mesgsys->getSender() << LL_ENDL; - BOOL delete_local_on_completion = FALSE; + bool delete_local_on_completion = false; mesgsys->getBOOL("XferID", "DeleteOnCompletion", delete_local_on_completion); // -1 chunk_size causes it to use the default diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 5de29ba66f..5e24061959 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -3673,13 +3673,13 @@ void LLMessageSystem::getU8(const char *block, const char *var, U8 &u, LLMessageStringTable::getInstance()->getString(var), u, blocknum); } -void LLMessageSystem::getBOOLFast(const char *block, const char *var, BOOL &b, +void LLMessageSystem::getBOOLFast(const char *block, const char *var, bool &b, S32 blocknum) { mMessageReader->getBOOL(block, var, b, blocknum); } -void LLMessageSystem::getBOOL(const char *block, const char *var, BOOL &b, +void LLMessageSystem::getBOOL(const char *block, const char *var, bool &b, S32 blocknum) { getBOOLFast(LLMessageStringTable::getInstance()->getString(block), diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index e25a9ea7ef..c041a69d79 100644 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -599,8 +599,8 @@ public: */ void getBinaryDataFast(const char *blockname, const char *varname, void *datap, S32 size, S32 blocknum = 0, S32 max_size = S32_MAX); void getBinaryData(const char *blockname, const char *varname, void *datap, S32 size, S32 blocknum = 0, S32 max_size = S32_MAX); - void getBOOLFast( const char *block, const char *var, BOOL &data, S32 blocknum = 0); - void getBOOL( const char *block, const char *var, BOOL &data, S32 blocknum = 0); + void getBOOLFast( const char *block, const char *var, bool &data, S32 blocknum = 0); + void getBOOL( const char *block, const char *var, bool &data, S32 blocknum = 0); void getS8Fast( const char *block, const char *var, S8 &data, S32 blocknum = 0); void getS8( const char *block, const char *var, S8 &data, S32 blocknum = 0); void getU8Fast( const char *block, const char *var, U8 &data, S32 blocknum = 0); diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 1abf6832fb..2c04147a5a 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -178,10 +178,10 @@ LLSD LLControlVariable::getComparableValue(const LLSD& value) LLSD storable_value; if(TYPE_BOOLEAN == type() && value.isString()) { - BOOL temp; + bool temp; if(LLStringUtil::convertToBOOL(value.asString(), temp)) { - storable_value = (bool)temp; + storable_value = temp; } else { @@ -859,7 +859,7 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require break; case TYPE_BOOLEAN: { - BOOL initial = FALSE; + bool initial = false; child_nodep->getAttributeBOOL("value", initial); control->set(initial); diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp index ed9c07e1db..4991e99a96 100644 --- a/indra/llxml/llxmltree.cpp +++ b/indra/llxml/llxmltree.cpp @@ -199,7 +199,7 @@ void LLXmlTreeNode::addChild(LLXmlTreeNode* child) // These functions assume that name is already in mAttritrubteKeys -BOOL LLXmlTreeNode::getFastAttributeBOOL(LLStdStringHandle canonical_name, BOOL& value) +bool LLXmlTreeNode::getFastAttributeBOOL(LLStdStringHandle canonical_name, bool& value) { const std::string *s = getAttribute( canonical_name ); return s && LLStringUtil::convertToBOOL( *s, value ); @@ -310,7 +310,7 @@ BOOL LLXmlTreeNode::getFastAttributeString(LLStdStringHandle canonical_name, std ////////////////////////////////////////////////////////////// -BOOL LLXmlTreeNode::getAttributeBOOL(const std::string& name, BOOL& value) +bool LLXmlTreeNode::getAttributeBOOL(const std::string& name, bool& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeBOOL(canonical_name, value); diff --git a/indra/llxml/llxmltree.h b/indra/llxml/llxmltree.h index 3e425c3870..5d33e2c660 100644 --- a/indra/llxml/llxmltree.h +++ b/indra/llxml/llxmltree.h @@ -105,7 +105,7 @@ public: BOOL hasAttribute( const std::string& name ); // Fast versions use cannonical_name handlee to entru in LLXmlTree::sAttributeKeys string table - BOOL getFastAttributeBOOL( LLStdStringHandle cannonical_name, BOOL& value ); + bool getFastAttributeBOOL( LLStdStringHandle cannonical_name, bool& value ); BOOL getFastAttributeU8( LLStdStringHandle cannonical_name, U8& value ); BOOL getFastAttributeS8( LLStdStringHandle cannonical_name, S8& value ); BOOL getFastAttributeU16( LLStdStringHandle cannonical_name, U16& value ); @@ -124,7 +124,7 @@ public: BOOL getFastAttributeString( LLStdStringHandle cannonical_name, std::string& value ); // Normal versions find 'name' in LLXmlTree::sAttributeKeys then call fast versions - virtual BOOL getAttributeBOOL( const std::string& name, BOOL& value ); + virtual bool getAttributeBOOL( const std::string& name, bool& value ); virtual BOOL getAttributeU8( const std::string& name, U8& value ); virtual BOOL getAttributeS8( const std::string& name, S8& value ); virtual BOOL getAttributeU16( const std::string& name, U16& value ); diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index cdb4130d42..565c00d2ea 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3430,7 +3430,7 @@ BOOL LLAgent::allowOperation(PermissionBit op, if (!perm.isOwned()) return FALSE; // A group member with group_proxy_power can act as owner. - BOOL is_group_owned; + bool is_group_owned; LLUUID owner_id; perm.getOwnership(owner_id, is_group_owned); LLUUID group_id(perm.getGroup()); @@ -3812,9 +3812,9 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **) S32 block_count = msg->getNumberOfBlocks("Data"); for (S32 block_index = 0; block_index < block_count; block_index++) { - BOOL take_controls; + bool take_controls; U32 controls; - BOOL passon; + bool passon; U32 i; msg->getBOOL("Data", "TakeControls", take_controls, block_index); if (take_controls) diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index c1162c1609..2b33cb878b 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -78,7 +78,7 @@ struct LLGroupData LLUUID mID; LLUUID mInsigniaID; U64 mPowers; - BOOL mAcceptNotices; + bool mAcceptNotices; BOOL mListInProfile; S32 mContribution; std::string mName; diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8bd9169c7d..405432fe90 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -623,7 +623,7 @@ BOOL LLAgentWearables::selfHasWearable(LLWearableType::EType type) } // virtual -void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) +void LLAgentWearables::wearableUpdated(LLWearable *wearable, bool removed) { if (isAgentAvatarValid()) { diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index e20f5df7fa..2a888573d6 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -101,7 +101,7 @@ public: // Setters //-------------------------------------------------------------------- private: - /*virtual*/void wearableUpdated(LLWearable *wearable, BOOL removed); + /*virtual*/void wearableUpdated(LLWearable *wearable, bool removed); public: void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false); void setWearableOutfit(const LLInventoryItem::item_array_t& items, const std::vector< LLViewerWearable* >& wearables); diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h index 10cde35f9c..b4a4b60794 100644 --- a/indra/newview/llavatarpropertiesprocessor.h +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -105,14 +105,14 @@ struct LLPickData LLUUID agent_id; LLUUID pick_id; LLUUID creator_id; - BOOL top_pick; + bool top_pick; LLUUID parcel_id; std::string name; std::string desc; LLUUID snapshot_id; LLVector3d pos_global; S32 sort_order; - BOOL enabled; + bool enabled; //used only in read requests std::string user_name; diff --git a/indra/newview/llbreastmotion.h b/indra/newview/llbreastmotion.h index 433fece29f..d099257a33 100644 --- a/indra/newview/llbreastmotion.h +++ b/indra/newview/llbreastmotion.h @@ -93,12 +93,12 @@ public: // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + virtual bool onActivate(); // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 794bb78b9c..bc61fac00b 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -571,7 +571,7 @@ void setControlValueCB(const LLCommandLineParser::token_vector_t& value, std::string token(onevalue(option, value)); // There's a token. check the string for true/false/1/0 etc. - BOOL result = false; + bool result = false; bool gotSet = LLStringUtil::convertToBOOL(token, result); if (gotSet) { diff --git a/indra/newview/llemote.cpp b/indra/newview/llemote.cpp index b9ef297c00..a051825dae 100644 --- a/indra/newview/llemote.cpp +++ b/indra/newview/llemote.cpp @@ -74,7 +74,7 @@ LLMotion::LLMotionInitStatus LLEmote::onInitialize(LLCharacter *character) //----------------------------------------------------------------------------- // LLEmote::onActivate() //----------------------------------------------------------------------------- -BOOL LLEmote::onActivate() +bool LLEmote::onActivate() { LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" ); if( default_param ) @@ -89,14 +89,14 @@ BOOL LLEmote::onActivate() mCharacter->updateVisualParams(); } - return TRUE; + return true; } //----------------------------------------------------------------------------- // LLEmote::onUpdate() //----------------------------------------------------------------------------- -BOOL LLEmote::onUpdate(F32 time, U8* joint_mask) +bool LLEmote::onUpdate(F32 time, U8* joint_mask) { if( mParam ) { @@ -116,7 +116,7 @@ BOOL LLEmote::onUpdate(F32 time, U8* joint_mask) mCharacter->updateVisualParams(); } - return TRUE; + return true; } diff --git a/indra/newview/llemote.h b/indra/newview/llemote.h index 9ea6be6b1e..1b15445e4b 100644 --- a/indra/newview/llemote.h +++ b/indra/newview/llemote.h @@ -96,12 +96,12 @@ public: // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + virtual bool onActivate(); // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 440ec06c4e..f9dfa0334f 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -170,7 +170,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, buy_btn->setEnabled(FALSE); LLUUID owner_id; - BOOL is_group_owned; + bool is_group_owned; LLAssetType::EType asset_type; LLInventoryType::EType inv_type; S32 wearable_count = 0; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 9c4c9b3e59..07bd77460f 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1649,12 +1649,12 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo S32 rows = msg->getNumberOfBlocksFast(_PREHASH_Data); //uuid_list_t return_ids; LLUUID owner_id; - BOOL is_group_owned; + bool is_group_owned; S32 object_count; U32 most_recent_time = 0; - BOOL is_online; + bool is_online; std::string object_count_str; - //BOOL b_need_refresh = FALSE; + //bool b_need_refresh = false; // If we were waiting for the first reply, clear the "Searching..." text. if (self->mFirstReply) diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 94261b2e4e..bab6631d54 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -388,7 +388,7 @@ void LLFloaterPay::payViaObject(money_callback callback, LLSafeHandlesetHandlerFuncFast(_PREHASH_PayPriceReply, processPayPriceReply,(void **)floater); LLUUID owner_id; - BOOL is_group = FALSE; + bool is_group = false; node->mPermissions->getOwnership(owner_id, is_group); floater->getChild("object_name_text")->setValue(node->mName); @@ -505,7 +505,7 @@ void LLFloaterPay::onGive(give_money_ptr info) if (amount > PAY_AMOUNT_NOTIFICATION && gStatusBar && gStatusBar->getBalance() > amount) { LLUUID payee_id = LLUUID::null; - BOOL is_group = false; + bool is_group = false; if (floater->mObjectSelection.notNull()) { LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d4eb40ff92..1e106ed3b1 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -437,7 +437,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) F32 water_height; F32 terrain_raise_limit; F32 terrain_lower_limit; - BOOL use_estate_sun; + bool use_estate_sun; F32 sun_hour; msg->getString("RegionInfo", "SimName", sim_name); msg->getU8("RegionInfo", "MaxAgents", agent_limit); diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index a9e5e55451..5683a690f1 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -980,7 +980,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) std::string online_status; std::string title; U64 agent_powers = 0; - BOOL is_owner = FALSE; + bool is_owner = false; S32 num_members = msg->getNumberOfBlocksFast(_PREHASH_MemberData); for (S32 i = 0; i < num_members; i++) @@ -1075,7 +1075,7 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) LLUUID group_id; std::string name; std::string charter; - BOOL show_in_list = FALSE; + bool show_in_list = false; LLUUID founder_id; U64 powers_mask = GP_NO_POWERS; S32 money = 0; @@ -1083,11 +1083,11 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) LLUUID insignia_id; LLUUID owner_role; U32 membership_fee = 0; - BOOL open_enrollment = FALSE; + bool open_enrollment = false; S32 num_group_members = 0; S32 num_group_roles = 0; - BOOL allow_publish = FALSE; - BOOL mature = FALSE; + bool allow_publish = false; + bool mature = false; msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id ); msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_FounderID, founder_id); @@ -1389,7 +1389,7 @@ void LLGroupMgr::processEjectGroupMemberReply(LLMessageSystem* msg, void ** data LL_DEBUGS("GrpMgr") << "processEjectGroupMemberReply" << LL_ENDL; LLUUID group_id; msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id); - BOOL success; + bool success; msg->getBOOLFast(_PREHASH_EjectData, _PREHASH_Success, success); // If we had a failure, the group panel needs to be updated. @@ -1404,7 +1404,7 @@ void LLGroupMgr::processJoinGroupReply(LLMessageSystem* msg, void ** data) { LL_DEBUGS("GrpMgr") << "processJoinGroupReply" << LL_ENDL; LLUUID group_id; - BOOL success; + bool success; msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id); msg->getBOOLFast(_PREHASH_GroupData, _PREHASH_Success, success); @@ -1424,7 +1424,7 @@ void LLGroupMgr::processLeaveGroupReply(LLMessageSystem* msg, void ** data) { LL_DEBUGS("GrpMgr") << "processLeaveGroupReply" << LL_ENDL; LLUUID group_id; - BOOL success; + bool success; msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id); msg->getBOOLFast(_PREHASH_GroupData, _PREHASH_Success, success); @@ -1443,7 +1443,7 @@ void LLGroupMgr::processLeaveGroupReply(LLMessageSystem* msg, void ** data) void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data) { LLUUID group_id; - BOOL success; + bool success; std::string message; msg->getUUIDFast(_PREHASH_ReplyData, _PREHASH_GroupID, group_id ); diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index 0d25e8fb22..bd61798543 100644 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -221,7 +221,7 @@ struct LLGroupTitle { std::string mTitle; LLUUID mRoleID; - BOOL mSelected; + bool mSelected; }; class LLGroupMgrGroupData diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 54121c2656..b007291179 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -501,7 +501,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) std::string subj; std::string name; U32 timestamp; - BOOL has_attachment; + bool has_attachment; U8 asset_type; S32 i=0; diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 03a02ba26f..98b8919660 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -124,7 +124,7 @@ public: ~LLPhysicsMotion() {} - BOOL onUpdate(F32 time); + bool onUpdate(F32 time); LLPointer getJointState() { @@ -250,9 +250,9 @@ LLPhysicsMotionController::~LLPhysicsMotionController() } } -BOOL LLPhysicsMotionController::onActivate() -{ - return TRUE; +bool LLPhysicsMotionController::onActivate() +{ + return true; } void LLPhysicsMotionController::onDeactivate() @@ -451,16 +451,16 @@ F32 LLPhysicsMotion::calculateAcceleration_local(const F32 velocity_local, const return smoothed_acceleration_local; } -BOOL LLPhysicsMotionController::onUpdate(F32 time, U8* joint_mask) +bool LLPhysicsMotionController::onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // Skip if disabled globally. if (!gSavedSettings.getBOOL("AvatarPhysics")) { - return TRUE; + return true; } - BOOL update_visuals = FALSE; + BOOL update_visuals = false; for (motion_vec_t::iterator iter = mMotions.begin(); iter != mMotions.end(); ++iter) @@ -472,21 +472,21 @@ BOOL LLPhysicsMotionController::onUpdate(F32 time, U8* joint_mask) if (update_visuals) mCharacter->updateVisualParams(); - return TRUE; + return true; } // Return TRUE if character has to update visual params. -BOOL LLPhysicsMotion::onUpdate(F32 time) +bool LLPhysicsMotion::onUpdate(F32 time) { // static FILE *mFileWrite = fopen("c:\\temp\\avatar_data.txt","w"); if (!mParamDriver) - return FALSE; + return false; if (!mLastTime || mLastTime >= time) { mLastTime = time; - return FALSE; + return false; } //////////////////////////////////////////////////////////////////////////////// @@ -499,7 +499,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) if (time_delta > 1.0) { mLastTime = time; - return FALSE; + return false; } // Higher LOD is better. This controls the granularity @@ -507,7 +507,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) const F32 lod_factor = LLVOAvatar::sPhysicsLODFactor; if (lod_factor == 0) { - return TRUE; + return true; } LLJoint *joint = mJointState->getJoint(); @@ -520,7 +520,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) const F32 behavior_drag = getParamValue(DRAG); F32 behavior_maxeffect = getParamValue(MAX_EFFECT); - const BOOL physics_test = FALSE; // Enable this to simulate bouncing on all parts. + const BOOL physics_test = false; // Enable this to simulate bouncing on all parts. if (physics_test) behavior_maxeffect = 1.0f; @@ -548,7 +548,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) // End velocity and acceleration //////////////////////////////////////////////////////////////////////////////// - BOOL update_visuals = FALSE; + bool update_visuals = false; // Break up the physics into a bunch of iterations so that differing framerates will show // roughly the same behavior. diff --git a/indra/newview/llphysicsmotion.h b/indra/newview/llphysicsmotion.h index a3b8e293f1..976f23cd44 100644 --- a/indra/newview/llphysicsmotion.h +++ b/indra/newview/llphysicsmotion.h @@ -93,12 +93,12 @@ public: // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate(); + virtual bool onActivate(); // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask); + virtual bool onUpdate(F32 time, U8* joint_mask); // called when a motion is deactivated virtual void onDeactivate(); diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index aceb8539d2..b0b9e00d1b 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -2367,11 +2367,11 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) if(instance) { instance->mHaveRunningInfo = TRUE; - BOOL running; + bool running; msg->getBOOLFast(_PREHASH_Script, _PREHASH_Running, running); LLCheckBoxCtrl* runningCheckbox = instance->getChild("running"); runningCheckbox->set(running); - BOOL mono; + bool mono; msg->getBOOLFast(_PREHASH_Script, "Mono", mono); LLCheckBoxCtrl* monoCheckbox = instance->getChild("mono"); monoCheckbox->setEnabled(instance->getIsModifiable() && have_script_upload_cap(object_id)); diff --git a/indra/newview/llregioninfomodel.h b/indra/newview/llregioninfomodel.h index baeff82fef..2aea654de7 100644 --- a/indra/newview/llregioninfomodel.h +++ b/indra/newview/llregioninfomodel.h @@ -70,7 +70,7 @@ public: F32 mTerrainLowerLimit; F32 mSunHour; // 6..30 - BOOL mUseEstateSun; + bool mUseEstateSun; std::string mSimName; std::string mSimType; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 61508f8648..4c7a440231 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6022,7 +6022,7 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use // static void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**) { - BOOL reset_list; + bool reset_list; msg->getBOOL("Header", "ResetList", reset_list); if (reset_list) @@ -6858,14 +6858,14 @@ void LLSelectNode::saveTextureScaleRatios(LLRender::eTexIndex index_to_query) BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) const { // Extract ownership. - BOOL object_is_group_owned = FALSE; + bool object_is_group_owned = false; LLUUID object_owner_id; mPermissions->getOwnership(object_owner_id, object_is_group_owned); // Operations on invalid or public objects is not allowed. if (!mObject || (mObject->isDead()) || !mPermissions->isOwned()) { - return FALSE; + return false; } // The transfer permissions can never be given through proxy. @@ -6875,7 +6875,7 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) if ( !object_is_group_owned && (gAgent.getID() == object_owner_id) ) { - return TRUE; + return true; } else { @@ -6891,7 +6891,7 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) // no proxy allowed. if (mObject->isAttachment() && object_owner_id != gAgent.getID()) { - return FALSE; + return false; } } @@ -6904,7 +6904,7 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) // Gods can always operate. if (gAgent.isGodlike()) { - return TRUE; + return true; } // Check if the agent is in the same group as the object. diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 4df80cb2b9..fb5ca2c3f4 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -227,8 +227,8 @@ void LLSettingsVOBase::updateInventoryItem(const LLSettingsBase::ptr_t &settings if (settings->getFlag(LLSettingsBase::FLAG_NOTRANS) && new_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) { LLPermissions perm(inv_item->getPermissions()); - perm.setBaseBits(LLUUID::null, FALSE, PERM_TRANSFER); - perm.setOwnerBits(LLUUID::null, FALSE, PERM_TRANSFER); + perm.setBaseBits(LLUUID::null, false, PERM_TRANSFER); + perm.setOwnerBits(LLUUID::null, false, PERM_TRANSFER); new_item->setPermissions(perm); need_update |= true; } diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 298fac1bfe..7feacd530d 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -957,7 +957,7 @@ void LLSidepanelItemInfo::updatePermissions() LLViewerInventoryItem* item = findItem(); if(!item) return; - BOOL is_group_owned; + bool is_group_owned; LLUUID owner_id; LLUUID group_id; LLPermissions perm(item->getPermissions()); diff --git a/indra/newview/llviewergesture.cpp b/indra/newview/llviewergesture.cpp index f30279d1e9..ef63ef41e5 100644 --- a/indra/newview/llviewergesture.cpp +++ b/indra/newview/llviewergesture.cpp @@ -70,37 +70,37 @@ LLViewerGesture::LLViewerGesture(const LLViewerGesture &rhs) { } -BOOL LLViewerGesture::trigger(KEY key, MASK mask) +bool LLViewerGesture::trigger(KEY key, MASK mask) { if (mKey == key && mMask == mask) { - doTrigger( TRUE ); - return TRUE; + doTrigger( true ); + return true; } else { - return FALSE; + return false; } } -BOOL LLViewerGesture::trigger(const std::string &trigger_string) +bool LLViewerGesture::trigger(const std::string &trigger_string) { // Assumes trigger_string is lowercase if (mTriggerLower == trigger_string) { - doTrigger( FALSE ); - return TRUE; + doTrigger( false ); + return true; } else { - return FALSE; + return false; } } // private -void LLViewerGesture::doTrigger( BOOL send_chat ) +void LLViewerGesture::doTrigger( bool send_chat ) { if (mSoundItemID != LLUUID::null) { @@ -132,7 +132,7 @@ void LLViewerGesture::doTrigger( BOOL send_chat ) // Don't play nodding animation, since that might not blend // with the gesture animation. (LLFloaterReg::getTypedInstance("nearby_chat"))-> - sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, FALSE); + sendChatFromViewer(mOutputString, CHAT_TYPE_NORMAL, false); } } @@ -140,7 +140,7 @@ void LLViewerGesture::doTrigger( BOOL send_chat ) LLViewerGestureList::LLViewerGestureList() : LLGestureList() { - mIsLoaded = FALSE; + mIsLoaded = false; } @@ -154,7 +154,7 @@ LLGesture *LLViewerGestureList::create_gesture(U8 **buffer, S32 max_size) // See if the prefix matches any gesture. If so, return TRUE // and place the full text of the gesture trigger into // output_str -BOOL LLViewerGestureList::matchPrefix(const std::string& in_str, std::string* out_str) +bool LLViewerGestureList::matchPrefix(const std::string& in_str, std::string* out_str) { S32 in_len = in_str.length(); @@ -177,10 +177,10 @@ BOOL LLViewerGestureList::matchPrefix(const std::string& in_str, std::string* ou if (in_str_lc == trigger_trunc) { *out_str = trigger; - return TRUE; + return true; } } - return FALSE; + return false; } diff --git a/indra/newview/llviewergesture.h b/indra/newview/llviewergesture.h index 8b621850ea..fea0778b1c 100644 --- a/indra/newview/llviewergesture.h +++ b/indra/newview/llviewergesture.h @@ -46,12 +46,12 @@ public: LLViewerGesture(const LLViewerGesture &gesture); // Triggers if a key/mask matches it - virtual BOOL trigger(KEY key, MASK mask); + virtual bool trigger(KEY key, MASK mask); // Triggers if case-insensitive substring matches (assumes string is lowercase) - virtual BOOL trigger(const std::string &string); + virtual bool trigger(const std::string &string); - void doTrigger( BOOL send_chat ); + void doTrigger( bool send_chat ); protected: static const F32 SOUND_VOLUME; @@ -63,14 +63,14 @@ public: LLViewerGestureList(); //void requestFromServer(); - BOOL getIsLoaded() { return mIsLoaded; } + bool getIsLoaded() { return mIsLoaded; } //void requestResetFromServer( BOOL is_male ); // See if the prefix matches any gesture. If so, return TRUE // and place the full text of the gesture trigger into // output_str - BOOL matchPrefix(const std::string& in_str, std::string* out_str); + bool matchPrefix(const std::string& in_str, std::string* out_str); static void xferCallback(void *data, S32 size, void** /*user_data*/, S32 status); @@ -78,7 +78,7 @@ protected: LLGesture *create_gesture(U8 **buffer, S32 max_size); protected: - BOOL mIsLoaded; + bool mIsLoaded; }; extern LLViewerGestureList gGestureList; diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index 9653e80b53..22d70d482b 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -67,7 +67,7 @@ LLViewerJoint::~LLViewerJoint() //-------------------------------------------------------------------- // render() //-------------------------------------------------------------------- -U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) +U32 LLViewerJoint::render( F32 pixelArea, bool first_pass, bool is_dummy ) { stop_glerror(); @@ -107,13 +107,13 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) // second pass writes to z buffer only gGL.setColorMask(false, false); { - triangle_count += drawShape( pixelArea, FALSE, is_dummy ); + triangle_count += drawShape( pixelArea, false, is_dummy ); } // third past respects z buffer and writes color gGL.setColorMask(true, false); { LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - triangle_count += drawShape( pixelArea, FALSE, is_dummy ); + triangle_count += drawShape( pixelArea, false, is_dummy ); } } else @@ -127,7 +127,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) // Render Outside (write to the Z buffer) glCullFace(GL_BACK); { - triangle_count += drawShape( pixelArea, FALSE, is_dummy ); + triangle_count += drawShape( pixelArea, false, is_dummy ); } } } @@ -149,7 +149,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) F32 jointLOD = joint->getLOD(); if (pixelArea >= jointLOD || sDisableLOD) { - triangle_count += joint->render( pixelArea, TRUE, is_dummy ); + triangle_count += joint->render( pixelArea, true, is_dummy ); if (jointLOD != DEFAULT_AVATAR_JOINT_LOD) { @@ -164,7 +164,7 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) //-------------------------------------------------------------------- // drawShape() //-------------------------------------------------------------------- -U32 LLViewerJoint::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) +U32 LLViewerJoint::drawShape( F32 pixelArea, bool first_pass, bool is_dummy ) { return 0; } diff --git a/indra/newview/llviewerjoint.h b/indra/newview/llviewerjoint.h index abe11bbf5c..dec6b3d2a7 100644 --- a/indra/newview/llviewerjoint.h +++ b/indra/newview/llviewerjoint.h @@ -54,11 +54,11 @@ public: // Traverses the entire joint hierarchy, setting up // transforms and calling the drawShape(). // Derived classes may add text/graphic output. - virtual U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ); // Returns triangle count + virtual U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ); // Returns triangle count // Draws the shape attached to a joint. // Called by render(). - virtual U32 drawShape( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ); + virtual U32 drawShape( F32 pixelArea, bool first_pass = true, bool is_dummy = false ); virtual void drawNormals() {} }; diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index 55fa2682e1..eed482b598 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -71,15 +71,15 @@ LLViewerJointAttachment::~LLViewerJointAttachment() //----------------------------------------------------------------------------- // isTransparent() //----------------------------------------------------------------------------- -BOOL LLViewerJointAttachment::isTransparent() +bool LLViewerJointAttachment::isTransparent() { - return FALSE; + return false; } //----------------------------------------------------------------------------- // drawShape() //----------------------------------------------------------------------------- -U32 LLViewerJointAttachment::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ) +U32 LLViewerJointAttachment::drawShape( F32 pixelArea, bool first_pass, bool is_dummy ) { if (LLVOAvatar::sShowAttachmentPoints) { @@ -103,7 +103,7 @@ void LLViewerJointAttachment::setupDrawable(LLViewerObject *object) return; if (object->mDrawable->isActive()) { - object->mDrawable->makeStatic(FALSE); + object->mDrawable->makeStatic(false); } object->mDrawable->mXform.setParent(getXform()); // LLViewerJointAttachment::lazyAttach @@ -162,7 +162,7 @@ void LLViewerJointAttachment::setupDrawable(LLViewerObject *object) //----------------------------------------------------------------------------- // addObject() //----------------------------------------------------------------------------- -BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) +bool LLViewerJointAttachment::addObject(LLViewerObject* object) { object->extractAttachmentItemID(); @@ -184,7 +184,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) // If this happens to be attached to self, then detach. LLVOAvatarSelf::detachAttachmentIntoInventory(object->getAttachmentItemID()); - return FALSE; + return false; } mAttachedObjects.push_back(object); @@ -194,7 +194,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) { if (object->mText.notNull()) { - object->mText->setOnHUDAttachment(TRUE); + object->mText->setOnHUDAttachment(true); } LLViewerObject::const_child_list_t& child_list = object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); @@ -203,14 +203,14 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) LLViewerObject* childp = *iter; if (childp && childp->mText.notNull()) { - childp->mText->setOnHUDAttachment(TRUE); + childp->mText->setOnHUDAttachment(true); } } } calcLOD(); - mUpdateXform = TRUE; + mUpdateXform = true; - return TRUE; + return true; } //----------------------------------------------------------------------------- @@ -317,7 +317,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object) //----------------------------------------------------------------------------- // setAttachmentVisibility() //----------------------------------------------------------------------------- -void LLViewerJointAttachment::setAttachmentVisibility(BOOL visible) +void LLViewerJointAttachment::setAttachmentVisibility(bool visible) { for (attachedobjs_vec_t::const_iterator iter = mAttachedObjects.begin(); iter != mAttachedObjects.end(); @@ -435,7 +435,7 @@ bool LLViewerJointAttachment::updateLOD(F32 pixel_area, bool activate) return res; } -BOOL LLViewerJointAttachment::isObjectAttached(const LLViewerObject *viewer_object) const +bool LLViewerJointAttachment::isObjectAttached(const LLViewerObject *viewer_object) const { for (attachedobjs_vec_t::const_iterator iter = mAttachedObjects.begin(); iter != mAttachedObjects.end(); @@ -444,10 +444,10 @@ BOOL LLViewerJointAttachment::isObjectAttached(const LLViewerObject *viewer_obje const LLViewerObject* attached_object = iter->get(); if (attached_object == viewer_object) { - return TRUE; + return true; } } - return FALSE; + return false; } const LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &object_id) const diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h index 4f72f3dfa9..883df5b2c4 100644 --- a/indra/newview/llviewerjointattachment.h +++ b/indra/newview/llviewerjointattachment.h @@ -51,11 +51,11 @@ public: // Returns true if this object is transparent. // This is used to determine in which order to draw objects. - /*virtual*/ BOOL isTransparent(); + /*virtual*/ bool isTransparent(); // Draws the shape attached to a joint. // Called by render(). - /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ); + /*virtual*/ U32 drawShape( F32 pixelArea, bool first_pass, bool is_dummy ); /*virtual*/ bool updateLOD(F32 pixel_area, bool activate); @@ -64,15 +64,15 @@ public: // void setPieSlice(S32 pie_slice) { mPieSlice = pie_slice; } - void setVisibleInFirstPerson(BOOL visibility) { mVisibleInFirst = visibility; } + void setVisibleInFirstPerson(bool visibility) { mVisibleInFirst = visibility; } BOOL getVisibleInFirstPerson() const { return mVisibleInFirst; } void setGroup(S32 group) { mGroup = group; } void setOriginalPosition(LLVector3 &position); - void setAttachmentVisibility(BOOL visible); - void setIsHUDAttachment(BOOL is_hud) { mIsHUDAttachment = is_hud; } - BOOL getIsHUDAttachment() const { return mIsHUDAttachment; } + void setAttachmentVisibility(bool visible); + void setIsHUDAttachment(bool is_hud) { mIsHUDAttachment = is_hud; } + bool getIsHUDAttachment() const { return mIsHUDAttachment; } - BOOL isAnimatable() const { return FALSE; } + bool isAnimatable() const { return false; } S32 getGroup() const { return mGroup; } S32 getPieSlice() const { return mPieSlice; } @@ -84,13 +84,13 @@ public: // // unique methods // - BOOL addObject(LLViewerObject* object); + bool addObject(LLViewerObject* object); void removeObject(LLViewerObject *object); // // attachments operations // - BOOL isObjectAttached(const LLViewerObject *viewer_object) const; + bool isObjectAttached(const LLViewerObject *viewer_object) const; const LLViewerObject *getAttachedObject(const LLUUID &object_id) const; LLViewerObject *getAttachedObject(const LLUUID &object_id); @@ -103,10 +103,10 @@ protected: void setupDrawable(LLViewerObject *object); private: - BOOL mVisibleInFirst; + bool mVisibleInFirst; LLVector3 mOriginalPos; S32 mGroup; - BOOL mIsHUDAttachment; + bool mIsHUDAttachment; S32 mPieSlice; }; diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 7f774e9f63..fd45bc37b2 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -216,7 +216,7 @@ int compare_int(const void *a, const void *b) //-------------------------------------------------------------------- // LLViewerJointMesh::drawShape() //-------------------------------------------------------------------- -U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) +U32 LLViewerJointMesh::drawShape( F32 pixelArea, bool first_pass, bool is_dummy) { if (!mValid || !mMesh || !mFace || !mVisible || !mFace->getVertexBuffer() || @@ -346,7 +346,7 @@ void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 // updateFaceData() //----------------------------------------------------------------------------- -void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) +void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind, bool terse_update) { //IF THIS FUNCTION BREAKS, SEE LLPOLYMESH CONSTRUCTOR AND CHECK ALIGNMENT OF INPUT ARRAYS diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index 1fe58c60ad..c7f2b1bbac 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -54,19 +54,19 @@ public: void uploadJointMatrices(); // overloaded from base class - /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ); + /*virtual*/ U32 drawShape( F32 pixelArea, bool first_pass, bool is_dummy ); // necessary because MS's compiler warns on function inheritance via dominance in the diamond inheritance here. // warns even though LLViewerJoint holds the only non virtual implementation. - /*virtual*/ U32 render( F32 pixelArea, BOOL first_pass = TRUE, BOOL is_dummy = FALSE ) { return LLViewerJoint::render(pixelArea,first_pass,is_dummy);} + /*virtual*/ U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) { return LLViewerJoint::render(pixelArea,first_pass,is_dummy);} /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); + /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind = false, bool terse_update = false); /*virtual*/ bool updateLOD(F32 pixel_area, bool activate); /*virtual*/ void updateJointGeometry(); /*virtual*/ void dump(); - /*virtual*/ BOOL isAnimatable() const { return FALSE; } + /*virtual*/ bool isAnimatable() const { return false; } private: diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 8c76f575a9..d0fc0eb16c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2276,7 +2276,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LL_PROFILE_ZONE_SCOPED; LLUUID from_id; - BOOL from_group; + bool from_group; LLUUID to_id; U8 offline; U8 d = 0; @@ -4305,7 +4305,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) LLVector3 sitPosition; LLQuaternion sitRotation; LLUUID sitObjectID; - BOOL use_autopilot; + bool use_autopilot; mesgsys->getUUIDFast(_PREHASH_SitObject, _PREHASH_ID, sitObjectID); mesgsys->getBOOLFast(_PREHASH_SitTransform, _PREHASH_AutoPilot, use_autopilot); mesgsys->getVector3Fast(_PREHASH_SitTransform, _PREHASH_SitPosition, sitPosition); @@ -4314,7 +4314,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data) mesgsys->getVector3Fast(_PREHASH_SitTransform, _PREHASH_CameraEyeOffset, camera_eye); LLVector3 camera_at; mesgsys->getVector3Fast(_PREHASH_SitTransform, _PREHASH_CameraAtOffset, camera_at); - BOOL force_mouselook; + bool force_mouselook; mesgsys->getBOOLFast(_PREHASH_SitTransform, _PREHASH_ForceMouselook, force_mouselook); if (isAgentAvatarValid() && dist_vec_squared(camera_eye, camera_at) > CAMERA_POSITION_THRESHOLD_SQUARED) @@ -4739,12 +4739,12 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) // and agent ids for name lookup. S32 transaction_type = 0; LLUUID source_id; - BOOL is_source_group = FALSE; + bool is_source_group = false; LLUUID dest_id; - BOOL is_dest_group = FALSE; + bool is_dest_group = false; S32 amount = 0; std::string item_description; - BOOL success = FALSE; + bool success = false; msg->getS32("TransactionInfo", "TransactionType", transaction_type); msg->getUUID("TransactionInfo", "SourceID", source_id); @@ -5334,7 +5334,7 @@ void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data) if (!attempt_standard_notification(msgsystem)) { - BOOL modal = FALSE; + bool modal = false; msgsystem->getBOOL("AlertData", "Modal", modal); process_alert_core(message, modal); } @@ -5550,7 +5550,7 @@ void process_frozen_message(LLMessageSystem *msgsystem, void **user_data) // make sure the cursor is back to the usual default since the // alert is probably due to some kind of error. gViewerWindow->getWindow()->resetBusyCount(); - BOOL b_frozen; + bool b_frozen; msgsystem->getBOOL("FrozenData", "Data", b_frozen); @@ -6727,7 +6727,7 @@ void process_load_url(LLMessageSystem* msg, void**) { LLUUID object_id; LLUUID owner_id; - BOOL owner_is_group; + bool owner_is_group; char object_name[256]; /* Flawfinder: ignore */ char message[256]; /* Flawfinder: ignore */ char url[256]; /* Flawfinder: ignore */ diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 15accd0547..2e59145bbe 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1528,13 +1528,13 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use { S32 request_result; S32 sequence_id; - BOOL snap_selection = FALSE; + bool snap_selection = false; S32 self_count = 0; S32 other_count = 0; S32 public_count = 0; S32 local_id; LLUUID owner_id; - BOOL is_group_owned; + bool is_group_owned; U32 auction_id = 0; S32 claim_price_per_meter = 0; S32 rent_price_per_meter = 0; @@ -1553,15 +1553,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use S32 other_prims = 0; S32 selected_prims = 0; F32 parcel_prim_bonus = 1.f; - BOOL region_push_override = false; - BOOL region_deny_anonymous_override = false; - BOOL region_deny_identified_override = false; // Deprecated - BOOL region_deny_transacted_override = false; // Deprecated - BOOL region_deny_age_unverified_override = false; - BOOL region_allow_access_override = true; - BOOL region_allow_environment_override = true; + bool region_push_override = false; + bool region_deny_anonymous_override = false; + bool region_deny_identified_override = false; // Deprecated + bool region_deny_transacted_override = false; // Deprecated + bool region_deny_age_unverified_override = false; + bool region_allow_access_override = true; + bool region_allow_environment_override = true; S32 parcel_environment_version = 0; - BOOL agent_parcel_update = false; // updating previous(existing) agent parcel + bool agent_parcel_update = false; // updating previous(existing) agent parcel U32 extended_flags = 0; //obscure MOAP S32 other_clean_time = 0; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 452dcdd8fd..d341a966f1 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2890,7 +2890,7 @@ void LLViewerRegion::unpackRegionHandshake() U8 sim_access; std::string sim_name; LLUUID sim_owner; - BOOL is_estate_manager; + bool is_estate_manager; F32 water_height; F32 billable_factor; LLUUID cache_id; diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index 4c2fbcf837..63c8e0d59c 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -150,7 +150,7 @@ void LLViewerTexLayerSetBuffer::preRenderTexLayerSet() } // virtual -void LLViewerTexLayerSetBuffer::postRenderTexLayerSet(BOOL success) +void LLViewerTexLayerSetBuffer::postRenderTexLayerSet(bool success) { LLTexLayerSetBuffer::postRenderTexLayerSet(success); @@ -158,9 +158,9 @@ void LLViewerTexLayerSetBuffer::postRenderTexLayerSet(BOOL success) } // virtual -void LLViewerTexLayerSetBuffer::midRenderTexLayerSet(BOOL success) +void LLViewerTexLayerSetBuffer::midRenderTexLayerSet(bool success) { - const BOOL update_now = mNeedsUpdate && isReadyToUpdate(); + const bool update_now = mNeedsUpdate && isReadyToUpdate(); if (update_now) { doUpdate(); diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h index dec7f0ddfc..d1c01bf1ad 100644 --- a/indra/newview/llviewertexlayer.h +++ b/indra/newview/llviewertexlayer.h @@ -95,8 +95,8 @@ private: // Tex Layer Render //-------------------------------------------------------------------- virtual void preRenderTexLayerSet(); - virtual void midRenderTexLayerSet(BOOL success); - virtual void postRenderTexLayerSet(BOOL success); + virtual void midRenderTexLayerSet(bool success); + virtual void postRenderTexLayerSet(bool success); virtual S32 getCompositeOriginX() const { return getOriginX(); } virtual S32 getCompositeOriginY() const { return getOriginY(); } virtual S32 getCompositeWidth() const { return getFullWidth(); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index bb4ffac604..777fa70539 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -330,12 +330,12 @@ public: // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate() { return TRUE; } + virtual bool onActivate() { return true; } // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask) + virtual bool onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; F32 nx[2]; @@ -353,7 +353,7 @@ public: tQn.setQuat( rx, ry, 0.0f ); mTorsoState->setRotation( tQn ); - return TRUE; + return true; } // called when a motion is deactivated @@ -451,12 +451,12 @@ public: // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate() { return TRUE; } + virtual bool onActivate() { return true; } // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask) + virtual bool onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; mBreatheRate = 1.f; @@ -465,7 +465,7 @@ public: mChestState->setRotation(LLQuaternion(breathe_amt, LLVector3(0.f, 1.f, 0.f))); - return TRUE; + return true; } // called when a motion is deactivated @@ -553,17 +553,17 @@ public: // called when a motion is activated // must return TRUE to indicate success, or else // it will be deactivated - virtual BOOL onActivate() { return TRUE; } + virtual bool onActivate() { return true; } // called per time step // must return TRUE while it is active, and // must return FALSE when the motion is completed. - virtual BOOL onUpdate(F32 time, U8* joint_mask) + virtual bool onUpdate(F32 time, U8* joint_mask) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; mPelvisState->setPosition(LLVector3::zero); - return TRUE; + return true; } // called when a motion is deactivated @@ -6075,7 +6075,7 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) // id is the asset if of the animation to start // time_offset is the offset into the animation at which to start playing //----------------------------------------------------------------------------- -BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) +bool LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) { LL_DEBUGS("Motion") << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; @@ -6097,7 +6097,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) //----------------------------------------------------------------------------- // stopMotion() //----------------------------------------------------------------------------- -BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) +bool LLVOAvatar::stopMotion(const LLUUID& id, bool stop_immediate) { LL_DEBUGS("Motion") << "Motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 72770e19a8..203e3e8c62 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -192,8 +192,8 @@ public: /*virtual*/ LLVector3 getCharacterAngularVelocity(); /*virtual*/ LLUUID remapMotionID(const LLUUID& id); - /*virtual*/ BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f); - /*virtual*/ BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE); + /*virtual*/ bool startMotion(const LLUUID& id, F32 time_offset = 0.f); + /*virtual*/ bool stopMotion(const LLUUID& id, bool stop_immediate = FALSE); virtual bool hasMotionFromSource(const LLUUID& source_id); virtual void stopMotionFromSource(const LLUUID& source_id); virtual void requestStopMotion(LLMotion* motion); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 528407b82c..4f41a63e64 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -727,29 +727,29 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight) +bool LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight) { if (!which_param) { - return FALSE; + return false; } LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(which_param->getID()); return setParamWeight(param,weight); } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight) +bool LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight) { if (!param_name) { - return FALSE; + return false; } LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(param_name); return setParamWeight(param,weight); } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight) +bool LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight) { LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(index); return setParamWeight(param,weight); diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index a121ef356e..c4a81affe6 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -92,9 +92,9 @@ public: /*virtual*/ void requestStopMotion(LLMotion* motion); /*virtual*/ LLJoint* getJoint(const std::string &name); - /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight); - /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight); - /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight); + /*virtual*/ bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight); + /*virtual*/ bool setVisualParamWeight(const char* param_name, F32 weight); + /*virtual*/ bool setVisualParamWeight(S32 index, F32 weight); /*virtual*/ void updateVisualParams(); void writeWearablesToAvatar(); /*virtual*/ void idleUpdateAppearanceAnimation(); From 48b121ab03435507e2ed9a865de9f8aff992877a Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Sat, 17 Feb 2024 14:02:06 +0200 Subject: [PATCH 5/7] viewer#826 Follow-up buildfix: update lldatapacker --- indra/llmessage/lldatapacker.cpp | 556 +++++++++++++++--------------- indra/llmessage/lldatapacker.h | 312 ++++++++--------- indra/newview/llphysicsmotion.cpp | 4 +- 3 files changed, 436 insertions(+), 436 deletions(-) diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index 9f7768f78e..b3113cd5d8 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -45,7 +45,7 @@ const S32 DP_BUFSIZE = 512; static char DUMMY_BUFFER[128]; /*Flawfinder: ignore*/ -LLDataPacker::LLDataPacker() : mPassFlags(0), mWriteEnabled(FALSE) +LLDataPacker::LLDataPacker() : mPassFlags(0), mWriteEnabled(false) { } @@ -61,10 +61,10 @@ void LLDataPacker::dumpBufferToLog() LL_ERRS() << "dumpBufferToLog not implemented for this type!" << LL_ENDL; } -BOOL LLDataPacker::packFixed(const F32 value, const char *name, - const BOOL is_signed, const U32 int_bits, const U32 frac_bits) +bool LLDataPacker::packFixed(const F32 value, const char *name, + const bool is_signed, const U32 int_bits, const U32 frac_bits) { - BOOL success = TRUE; + bool success = true; S32 unsigned_bits = int_bits + frac_bits; S32 total_bits = unsigned_bits; @@ -113,10 +113,10 @@ BOOL LLDataPacker::packFixed(const F32 value, const char *name, return success; } -BOOL LLDataPacker::unpackFixed(F32 &value, const char *name, - const BOOL is_signed, const U32 int_bits, const U32 frac_bits) +bool LLDataPacker::unpackFixed(F32 &value, const char *name, + const bool is_signed, const U32 int_bits, const U32 frac_bits) { - BOOL success = TRUE; + bool success = true; //LL_INFOS() << "unpackFixed:" << name << " int:" << int_bits << " frac:" << frac_bits << LL_ENDL; S32 unsigned_bits = int_bits + frac_bits; S32 total_bits = unsigned_bits; @@ -166,82 +166,82 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name, return success; } -BOOL LLDataPacker::unpackU16s(U16 *values, S32 count, const char *name) +bool LLDataPacker::unpackU16s(U16 *values, S32 count, const char *name) { for (S32 idx = 0; idx < count; ++idx) { if (!unpackU16(values[idx], name)) { LL_WARNS("DATAPACKER") << "Buffer overflow reading Unsigned 16s \"" << name << "\" at index " << idx << "!" << LL_ENDL; - return FALSE; + return false; } } - return TRUE; + return true; } -BOOL LLDataPacker::unpackS16s(S16 *values, S32 count, const char *name) +bool LLDataPacker::unpackS16s(S16 *values, S32 count, const char *name) { for (S32 idx = 0; idx < count; ++idx) { if (!unpackS16(values[idx], name)) { LL_WARNS("DATAPACKER") << "Buffer overflow reading Signed 16s \"" << name << "\" at index " << idx << "!" << LL_ENDL; - return FALSE; + return false; } } - return TRUE; + return true; } -BOOL LLDataPacker::unpackF32s(F32 *values, S32 count, const char *name) +bool LLDataPacker::unpackF32s(F32 *values, S32 count, const char *name) { for (S32 idx = 0; idx < count; ++idx) { if (!unpackF32(values[idx], name)) { LL_WARNS("DATAPACKER") << "Buffer overflow reading Float 32s \"" << name << "\" at index " << idx << "!" << LL_ENDL; - return FALSE; + return false; } } - return TRUE; + return true; } -BOOL LLDataPacker::unpackColor4Us(LLColor4U *values, S32 count, const char *name) +bool LLDataPacker::unpackColor4Us(LLColor4U *values, S32 count, const char *name) { for (S32 idx = 0; idx < count; ++idx) { if (!unpackColor4U(values[idx], name)) { LL_WARNS("DATAPACKER") << "Buffer overflow reading Float 32s \"" << name << "\" at index " << idx << "!" << LL_ENDL; - return FALSE; + return false; } } - return TRUE; + return true; } -BOOL LLDataPacker::unpackUUIDs(LLUUID *values, S32 count, const char *name) +bool LLDataPacker::unpackUUIDs(LLUUID *values, S32 count, const char *name) { for (S32 idx = 0; idx < count; ++idx) { if (!unpackUUID(values[idx], name)) { LL_WARNS("DATAPACKER") << "Buffer overflow reading UUIDs \"" << name << "\" at index " << idx << "!" << LL_ENDL; - return FALSE; + return false; } } - return TRUE; + return true; } //--------------------------------------------------------------------------- // LLDataPackerBinaryBuffer implementation //--------------------------------------------------------------------------- -BOOL LLDataPackerBinaryBuffer::packString(const std::string& value, const char *name) +bool LLDataPackerBinaryBuffer::packString(const std::string& value, const char *name) { S32 length = value.length()+1; if (!verifyLength(length, name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -249,30 +249,30 @@ BOOL LLDataPackerBinaryBuffer::packString(const std::string& value, const char * htolememcpy(mCurBufferp, value.c_str(), MVT_VARIABLE, length); } mCurBufferp += length; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackString(std::string& value, const char *name) +bool LLDataPackerBinaryBuffer::unpackString(std::string& value, const char *name) { S32 length = (S32)strlen((char *)mCurBufferp) + 1; /*Flawfinder: ignore*/ if (!verifyLength(length, name)) { - return FALSE; + return false; } value = std::string((char*)mCurBufferp); // We already assume NULL termination calling strlen() mCurBufferp += length; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packBinaryData(const U8 *value, S32 size, const char *name) +bool LLDataPackerBinaryBuffer::packBinaryData(const U8 *value, S32 size, const char *name) { if (!verifyLength(size + 4, name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -285,16 +285,16 @@ BOOL LLDataPackerBinaryBuffer::packBinaryData(const U8 *value, S32 size, const c htolememcpy(mCurBufferp, value, MVT_VARIABLE, size); } mCurBufferp += size; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char *name) +bool LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char *name) { if (!verifyLength(4, name)) { LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << LL_ENDL; - return FALSE; + return false; } htolememcpy(&size, mCurBufferp, MVT_S32, 4); @@ -303,21 +303,21 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char if (!verifyLength(size, name)) { LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << LL_ENDL; - return FALSE; + return false; } htolememcpy(value, mCurBufferp, MVT_VARIABLE, size); mCurBufferp += size; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packBinaryDataFixed(const U8 *value, S32 size, const char *name) +bool LLDataPackerBinaryBuffer::packBinaryDataFixed(const U8 *value, S32 size, const char *name) { if (!verifyLength(size, name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -325,27 +325,27 @@ BOOL LLDataPackerBinaryBuffer::packBinaryDataFixed(const U8 *value, S32 size, co htolememcpy(mCurBufferp, value, MVT_VARIABLE, size); } mCurBufferp += size; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const char *name) +bool LLDataPackerBinaryBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const char *name) { if (!verifyLength(size, name)) { - return FALSE; + return false; } htolememcpy(value, mCurBufferp, MVT_VARIABLE, size); mCurBufferp += size; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packU8(const U8 value, const char *name) +bool LLDataPackerBinaryBuffer::packU8(const U8 value, const char *name) { if (!verifyLength(sizeof(U8), name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -353,28 +353,28 @@ BOOL LLDataPackerBinaryBuffer::packU8(const U8 value, const char *name) *mCurBufferp = value; } mCurBufferp++; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackU8(U8 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackU8(U8 &value, const char *name) { if (!verifyLength(sizeof(U8), name)) { - return FALSE; + return false; } value = *mCurBufferp; mCurBufferp++; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packU16(const U16 value, const char *name) +bool LLDataPackerBinaryBuffer::packU16(const U16 value, const char *name) { if (!verifyLength(sizeof(U16), name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -382,25 +382,25 @@ BOOL LLDataPackerBinaryBuffer::packU16(const U16 value, const char *name) htolememcpy(mCurBufferp, &value, MVT_U16, 2); } mCurBufferp += 2; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackU16(U16 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackU16(U16 &value, const char *name) { if (!verifyLength(sizeof(U16), name)) { - return FALSE; + return false; } htolememcpy(&value, mCurBufferp, MVT_U16, 2); mCurBufferp += 2; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packS16(const S16 value, const char *name) +bool LLDataPackerBinaryBuffer::packS16(const S16 value, const char *name) { - BOOL success = verifyLength(sizeof(S16), name); + bool success = verifyLength(sizeof(S16), name); if (mWriteEnabled && success) { @@ -410,9 +410,9 @@ BOOL LLDataPackerBinaryBuffer::packS16(const S16 value, const char *name) return success; } -BOOL LLDataPackerBinaryBuffer::unpackS16(S16 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackS16(S16 &value, const char *name) { - BOOL success = verifyLength(sizeof(S16), name); + bool success = verifyLength(sizeof(S16), name); if (success) { @@ -422,11 +422,11 @@ BOOL LLDataPackerBinaryBuffer::unpackS16(S16 &value, const char *name) return success; } -BOOL LLDataPackerBinaryBuffer::packU32(const U32 value, const char *name) +bool LLDataPackerBinaryBuffer::packU32(const U32 value, const char *name) { if (!verifyLength(sizeof(U32), name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -434,28 +434,28 @@ BOOL LLDataPackerBinaryBuffer::packU32(const U32 value, const char *name) htolememcpy(mCurBufferp, &value, MVT_U32, 4); } mCurBufferp += 4; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackU32(U32 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackU32(U32 &value, const char *name) { if (!verifyLength(sizeof(U32), name)) { - return FALSE; + return false; } htolememcpy(&value, mCurBufferp, MVT_U32, 4); mCurBufferp += 4; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packS32(const S32 value, const char *name) +bool LLDataPackerBinaryBuffer::packS32(const S32 value, const char *name) { if (!verifyLength(sizeof(S32), name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -463,28 +463,28 @@ BOOL LLDataPackerBinaryBuffer::packS32(const S32 value, const char *name) htolememcpy(mCurBufferp, &value, MVT_S32, 4); } mCurBufferp += 4; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackS32(S32 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackS32(S32 &value, const char *name) { if(!verifyLength(sizeof(S32), name)) { - return FALSE; + return false; } htolememcpy(&value, mCurBufferp, MVT_S32, 4); mCurBufferp += 4; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packF32(const F32 value, const char *name) +bool LLDataPackerBinaryBuffer::packF32(const F32 value, const char *name) { if (!verifyLength(sizeof(F32), name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -492,28 +492,28 @@ BOOL LLDataPackerBinaryBuffer::packF32(const F32 value, const char *name) htolememcpy(mCurBufferp, &value, MVT_F32, 4); } mCurBufferp += 4; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackF32(F32 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackF32(F32 &value, const char *name) { if (!verifyLength(sizeof(F32), name)) { - return FALSE; + return false; } htolememcpy(&value, mCurBufferp, MVT_F32, 4); mCurBufferp += 4; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packColor4(const LLColor4 &value, const char *name) +bool LLDataPackerBinaryBuffer::packColor4(const LLColor4 &value, const char *name) { if (!verifyLength(16, name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -521,28 +521,28 @@ BOOL LLDataPackerBinaryBuffer::packColor4(const LLColor4 &value, const char *nam htolememcpy(mCurBufferp, value.mV, MVT_LLVector4, 16); } mCurBufferp += 16; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackColor4(LLColor4 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackColor4(LLColor4 &value, const char *name) { if (!verifyLength(16, name)) { - return FALSE; + return false; } htolememcpy(value.mV, mCurBufferp, MVT_LLVector4, 16); mCurBufferp += 16; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packColor4U(const LLColor4U &value, const char *name) +bool LLDataPackerBinaryBuffer::packColor4U(const LLColor4U &value, const char *name) { if (!verifyLength(4, name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -550,29 +550,29 @@ BOOL LLDataPackerBinaryBuffer::packColor4U(const LLColor4U &value, const char *n htolememcpy(mCurBufferp, value.mV, MVT_VARIABLE, 4); } mCurBufferp += 4; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackColor4U(LLColor4U &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackColor4U(LLColor4U &value, const char *name) { if (!verifyLength(4, name)) { - return FALSE; + return false; } htolememcpy(value.mV, mCurBufferp, MVT_VARIABLE, 4); mCurBufferp += 4; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packVector2(const LLVector2 &value, const char *name) +bool LLDataPackerBinaryBuffer::packVector2(const LLVector2 &value, const char *name) { if (!verifyLength(8, name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -581,29 +581,29 @@ BOOL LLDataPackerBinaryBuffer::packVector2(const LLVector2 &value, const char *n htolememcpy(mCurBufferp+4, &value.mV[1], MVT_F32, 4); } mCurBufferp += 8; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackVector2(LLVector2 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackVector2(LLVector2 &value, const char *name) { if (!verifyLength(8, name)) { - return FALSE; + return false; } htolememcpy(&value.mV[0], mCurBufferp, MVT_F32, 4); htolememcpy(&value.mV[1], mCurBufferp+4, MVT_F32, 4); mCurBufferp += 8; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packVector3(const LLVector3 &value, const char *name) +bool LLDataPackerBinaryBuffer::packVector3(const LLVector3 &value, const char *name) { if (!verifyLength(12, name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -611,27 +611,27 @@ BOOL LLDataPackerBinaryBuffer::packVector3(const LLVector3 &value, const char *n htolememcpy(mCurBufferp, value.mV, MVT_LLVector3, 12); } mCurBufferp += 12; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackVector3(LLVector3 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackVector3(LLVector3 &value, const char *name) { if (!verifyLength(12, name)) { - return FALSE; + return false; } htolememcpy(value.mV, mCurBufferp, MVT_LLVector3, 12); mCurBufferp += 12; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packVector4(const LLVector4 &value, const char *name) +bool LLDataPackerBinaryBuffer::packVector4(const LLVector4 &value, const char *name) { if (!verifyLength(16, name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -639,27 +639,27 @@ BOOL LLDataPackerBinaryBuffer::packVector4(const LLVector4 &value, const char *n htolememcpy(mCurBufferp, value.mV, MVT_LLVector4, 16); } mCurBufferp += 16; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackVector4(LLVector4 &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackVector4(LLVector4 &value, const char *name) { if (!verifyLength(16, name)) { - return FALSE; + return false; } htolememcpy(value.mV, mCurBufferp, MVT_LLVector4, 16); mCurBufferp += 16; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::packUUID(const LLUUID &value, const char *name) +bool LLDataPackerBinaryBuffer::packUUID(const LLUUID &value, const char *name) { if (!verifyLength(16, name)) { - return FALSE; + return false; } if (mWriteEnabled) @@ -667,20 +667,20 @@ BOOL LLDataPackerBinaryBuffer::packUUID(const LLUUID &value, const char *name) htolememcpy(mCurBufferp, value.mData, MVT_LLUUID, 16); } mCurBufferp += 16; - return TRUE; + return true; } -BOOL LLDataPackerBinaryBuffer::unpackUUID(LLUUID &value, const char *name) +bool LLDataPackerBinaryBuffer::unpackUUID(LLUUID &value, const char *name) { if (!verifyLength(16, name)) { - return FALSE; + return false; } htolememcpy(value.mData, mCurBufferp, MVT_LLUUID, 16); mCurBufferp += 16; - return TRUE; + return true; } const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLDataPackerBinaryBuffer &a) @@ -722,9 +722,9 @@ void LLDataPackerBinaryBuffer::dumpBufferToLog() //--------------------------------------------------------------------------- // LLDataPackerAsciiBuffer implementation //--------------------------------------------------------------------------- -BOOL LLDataPackerAsciiBuffer::packString(const std::string& value, const char *name) +bool LLDataPackerAsciiBuffer::packString(const std::string& value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -752,21 +752,21 @@ BOOL LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n return success; } -BOOL LLDataPackerAsciiBuffer::unpackString(std::string& value, const char *name) +bool LLDataPackerAsciiBuffer::unpackString(std::string& value, const char *name) { char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore*/ if (!getValueStr(name, valuestr, DP_BUFSIZE)) // NULL terminated { - return FALSE; + return false; } value = valuestr; - return TRUE; + return true; } -BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const char *name) +bool LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; @@ -789,7 +789,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch S32 i; - BOOL bBufferFull = FALSE; + bool bBufferFull = false; for (i = 0; i < size && !bBufferFull; i++) { numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */ @@ -797,7 +797,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch { numCopied = getBufferSize()-getCurrentSize(); LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: data truncated: " << LL_ENDL; - bBufferFull = TRUE; + bBufferFull = true; } mCurBufferp += numCopied; } @@ -829,13 +829,13 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch } -BOOL LLDataPackerAsciiBuffer::unpackBinaryData(U8 *value, S32 &size, const char *name) +bool LLDataPackerAsciiBuffer::unpackBinaryData(U8 *value, S32 &size, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } char *cur_pos = &valuestr[0]; @@ -854,16 +854,16 @@ BOOL LLDataPackerAsciiBuffer::unpackBinaryData(U8 *value, S32 &size, const char } -BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, const char *name) +bool LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mWriteEnabled) { S32 i; int numCopied = 0; - BOOL bBufferFull = FALSE; + bool bBufferFull = false; for (i = 0; i < size && !bBufferFull; i++) { numCopied = snprintf(mCurBufferp, getBufferSize()-getCurrentSize(), "%02x ", value[i]); /* Flawfinder: ignore */ @@ -871,7 +871,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con { numCopied = getBufferSize()-getCurrentSize(); LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryDataFixed: data truncated: " << LL_ENDL; - bBufferFull = TRUE; + bBufferFull = true; } mCurBufferp += numCopied; @@ -901,13 +901,13 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con } -BOOL LLDataPackerAsciiBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const char *name) +bool LLDataPackerAsciiBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } char *cur_pos = &valuestr[0]; @@ -925,9 +925,9 @@ BOOL LLDataPackerAsciiBuffer::unpackBinaryDataFixed(U8 *value, S32 size, const c -BOOL LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name) +bool LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -958,13 +958,13 @@ BOOL LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name) } -BOOL LLDataPackerAsciiBuffer::unpackU8(U8 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackU8(U8 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } S32 in_val; @@ -973,9 +973,9 @@ BOOL LLDataPackerAsciiBuffer::unpackU8(U8 &value, const char *name) return success; } -BOOL LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name) +bool LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1005,13 +1005,13 @@ BOOL LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name) } -BOOL LLDataPackerAsciiBuffer::unpackU16(U16 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackU16(U16 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } S32 in_val; @@ -1020,9 +1020,9 @@ BOOL LLDataPackerAsciiBuffer::unpackU16(U16 &value, const char *name) return success; } -BOOL LLDataPackerAsciiBuffer::packS16(const S16 value, const char *name) +bool LLDataPackerAsciiBuffer::packS16(const S16 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1052,13 +1052,13 @@ BOOL LLDataPackerAsciiBuffer::packS16(const S16 value, const char *name) } -BOOL LLDataPackerAsciiBuffer::unpackS16(S16 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackS16(S16 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } S32 in_val; @@ -1067,9 +1067,9 @@ BOOL LLDataPackerAsciiBuffer::unpackS16(S16 &value, const char *name) return success; } -BOOL LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name) +bool LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1097,13 +1097,13 @@ BOOL LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name) } -BOOL LLDataPackerAsciiBuffer::unpackU32(U32 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackU32(U32 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%u", &value); @@ -1111,9 +1111,9 @@ BOOL LLDataPackerAsciiBuffer::unpackU32(U32 &value, const char *name) } -BOOL LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name) +bool LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1141,13 +1141,13 @@ BOOL LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name) } -BOOL LLDataPackerAsciiBuffer::unpackS32(S32 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackS32(S32 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%d", &value); @@ -1155,9 +1155,9 @@ BOOL LLDataPackerAsciiBuffer::unpackS32(S32 &value, const char *name) } -BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name) +bool LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1185,13 +1185,13 @@ BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name) } -BOOL LLDataPackerAsciiBuffer::unpackF32(F32 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackF32(F32 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f", &value); @@ -1199,9 +1199,9 @@ BOOL LLDataPackerAsciiBuffer::unpackF32(F32 &value, const char *name) } -BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name) +bool LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1229,22 +1229,22 @@ BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name } -BOOL LLDataPackerAsciiBuffer::unpackColor4(LLColor4 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackColor4(LLColor4 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); return success; } -BOOL LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *name) +bool LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1272,13 +1272,13 @@ BOOL LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *na } -BOOL LLDataPackerAsciiBuffer::unpackColor4U(LLColor4U &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackColor4U(LLColor4U &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } S32 r, g, b, a; @@ -1292,9 +1292,9 @@ BOOL LLDataPackerAsciiBuffer::unpackColor4U(LLColor4U &value, const char *name) } -BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *name) +bool LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1322,13 +1322,13 @@ BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *na } -BOOL LLDataPackerAsciiBuffer::unpackVector2(LLVector2 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackVector2(LLVector2 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f %f", &value.mV[0], &value.mV[1]); @@ -1336,9 +1336,9 @@ BOOL LLDataPackerAsciiBuffer::unpackVector2(LLVector2 &value, const char *name) } -BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *name) +bool LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1366,22 +1366,22 @@ BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *na } -BOOL LLDataPackerAsciiBuffer::unpackVector3(LLVector3 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackVector3(LLVector3 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f %f %f", &value.mV[0], &value.mV[1], &value.mV[2]); return success; } -BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *name) +bool LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; if (mWriteEnabled) @@ -1409,13 +1409,13 @@ BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *na } -BOOL LLDataPackerAsciiBuffer::unpackVector4(LLVector4 &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackVector4(LLVector4 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); @@ -1423,9 +1423,9 @@ BOOL LLDataPackerAsciiBuffer::unpackVector4(LLVector4 &value, const char *name) } -BOOL LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name) +bool LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); int numCopied = 0; @@ -1449,20 +1449,20 @@ BOOL LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name) { numCopied = getBufferSize()-getCurrentSize(); LL_WARNS() << "LLDataPackerAsciiBuffer::packUUID: truncated: " << LL_ENDL; - success = FALSE; + success = false; } mCurBufferp += numCopied; return success; } -BOOL LLDataPackerAsciiBuffer::unpackUUID(LLUUID &value, const char *name) +bool LLDataPackerAsciiBuffer::unpackUUID(LLUUID &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } char tmp_str[64]; /* Flawfinder: ignore */ @@ -1507,9 +1507,9 @@ void LLDataPackerAsciiBuffer::writeIndentedName(const char *name) } } -BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32 value_len) +bool LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32 value_len) { - BOOL success = TRUE; + bool success = true; char buffer[DP_BUFSIZE]; /* Flawfinder: ignore */ char keyword[DP_BUFSIZE]; /* Flawfinder: ignore */ char value[DP_BUFSIZE]; /* Flawfinder: ignore */ @@ -1530,7 +1530,7 @@ BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32 if (strcmp(keyword, name)) { LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL; - return FALSE; + return false; } } else @@ -1565,9 +1565,9 @@ std::string convertF32ToString(F32 val) //--------------------------------------------------------------------------- // LLDataPackerAsciiFile implementation //--------------------------------------------------------------------------- -BOOL LLDataPackerAsciiFile::packString(const std::string& value, const char *name) +bool LLDataPackerAsciiFile::packString(const std::string& value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1580,22 +1580,22 @@ BOOL LLDataPackerAsciiFile::packString(const std::string& value, const char *nam return success; } -BOOL LLDataPackerAsciiFile::unpackString(std::string& value, const char *name) +bool LLDataPackerAsciiFile::unpackString(std::string& value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /* Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } value = valuestr; return success; } -BOOL LLDataPackerAsciiFile::packBinaryData(const U8 *value, S32 size, const char *name) +bool LLDataPackerAsciiFile::packBinaryData(const U8 *value, S32 size, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) @@ -1627,13 +1627,13 @@ BOOL LLDataPackerAsciiFile::packBinaryData(const U8 *value, S32 size, const char } -BOOL LLDataPackerAsciiFile::unpackBinaryData(U8 *value, S32 &size, const char *name) +bool LLDataPackerAsciiFile::unpackBinaryData(U8 *value, S32 &size, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore*/ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } char *cur_pos = &valuestr[0]; @@ -1652,9 +1652,9 @@ BOOL LLDataPackerAsciiFile::unpackBinaryData(U8 *value, S32 &size, const char *n } -BOOL LLDataPackerAsciiFile::packBinaryDataFixed(const U8 *value, S32 size, const char *name) +bool LLDataPackerAsciiFile::packBinaryDataFixed(const U8 *value, S32 size, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) @@ -1681,13 +1681,13 @@ BOOL LLDataPackerAsciiFile::packBinaryDataFixed(const U8 *value, S32 size, const } -BOOL LLDataPackerAsciiFile::unpackBinaryDataFixed(U8 *value, S32 size, const char *name) +bool LLDataPackerAsciiFile::unpackBinaryDataFixed(U8 *value, S32 size, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore*/ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } char *cur_pos = &valuestr[0]; @@ -1705,9 +1705,9 @@ BOOL LLDataPackerAsciiFile::unpackBinaryDataFixed(U8 *value, S32 size, const cha -BOOL LLDataPackerAsciiFile::packU8(const U8 value, const char *name) +bool LLDataPackerAsciiFile::packU8(const U8 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1723,13 +1723,13 @@ BOOL LLDataPackerAsciiFile::packU8(const U8 value, const char *name) } -BOOL LLDataPackerAsciiFile::unpackU8(U8 &value, const char *name) +bool LLDataPackerAsciiFile::unpackU8(U8 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } S32 in_val; @@ -1738,9 +1738,9 @@ BOOL LLDataPackerAsciiFile::unpackU8(U8 &value, const char *name) return success; } -BOOL LLDataPackerAsciiFile::packU16(const U16 value, const char *name) +bool LLDataPackerAsciiFile::packU16(const U16 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1754,13 +1754,13 @@ BOOL LLDataPackerAsciiFile::packU16(const U16 value, const char *name) } -BOOL LLDataPackerAsciiFile::unpackU16(U16 &value, const char *name) +bool LLDataPackerAsciiFile::unpackU16(U16 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } S32 in_val; @@ -1769,9 +1769,9 @@ BOOL LLDataPackerAsciiFile::unpackU16(U16 &value, const char *name) return success; } -BOOL LLDataPackerAsciiFile::packS16(const S16 value, const char *name) +bool LLDataPackerAsciiFile::packS16(const S16 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1785,13 +1785,13 @@ BOOL LLDataPackerAsciiFile::packS16(const S16 value, const char *name) } -BOOL LLDataPackerAsciiFile::unpackS16(S16 &value, const char *name) +bool LLDataPackerAsciiFile::unpackS16(S16 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } S32 in_val; @@ -1800,9 +1800,9 @@ BOOL LLDataPackerAsciiFile::unpackS16(S16 &value, const char *name) return success; } -BOOL LLDataPackerAsciiFile::packU32(const U32 value, const char *name) +bool LLDataPackerAsciiFile::packU32(const U32 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1816,13 +1816,13 @@ BOOL LLDataPackerAsciiFile::packU32(const U32 value, const char *name) } -BOOL LLDataPackerAsciiFile::unpackU32(U32 &value, const char *name) +bool LLDataPackerAsciiFile::unpackU32(U32 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%u", &value); @@ -1830,9 +1830,9 @@ BOOL LLDataPackerAsciiFile::unpackU32(U32 &value, const char *name) } -BOOL LLDataPackerAsciiFile::packS32(const S32 value, const char *name) +bool LLDataPackerAsciiFile::packS32(const S32 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1846,13 +1846,13 @@ BOOL LLDataPackerAsciiFile::packS32(const S32 value, const char *name) } -BOOL LLDataPackerAsciiFile::unpackS32(S32 &value, const char *name) +bool LLDataPackerAsciiFile::unpackS32(S32 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%d", &value); @@ -1860,9 +1860,9 @@ BOOL LLDataPackerAsciiFile::unpackS32(S32 &value, const char *name) } -BOOL LLDataPackerAsciiFile::packF32(const F32 value, const char *name) +bool LLDataPackerAsciiFile::packF32(const F32 value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1876,13 +1876,13 @@ BOOL LLDataPackerAsciiFile::packF32(const F32 value, const char *name) } -BOOL LLDataPackerAsciiFile::unpackF32(F32 &value, const char *name) +bool LLDataPackerAsciiFile::unpackF32(F32 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f", &value); @@ -1890,9 +1890,9 @@ BOOL LLDataPackerAsciiFile::unpackF32(F32 &value, const char *name) } -BOOL LLDataPackerAsciiFile::packColor4(const LLColor4 &value, const char *name) +bool LLDataPackerAsciiFile::packColor4(const LLColor4 &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1906,22 +1906,22 @@ BOOL LLDataPackerAsciiFile::packColor4(const LLColor4 &value, const char *name) } -BOOL LLDataPackerAsciiFile::unpackColor4(LLColor4 &value, const char *name) +bool LLDataPackerAsciiFile::unpackColor4(LLColor4 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); return success; } -BOOL LLDataPackerAsciiFile::packColor4U(const LLColor4U &value, const char *name) +bool LLDataPackerAsciiFile::packColor4U(const LLColor4U &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1935,13 +1935,13 @@ BOOL LLDataPackerAsciiFile::packColor4U(const LLColor4U &value, const char *name } -BOOL LLDataPackerAsciiFile::unpackColor4U(LLColor4U &value, const char *name) +bool LLDataPackerAsciiFile::unpackColor4U(LLColor4U &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } S32 r, g, b, a; @@ -1955,9 +1955,9 @@ BOOL LLDataPackerAsciiFile::unpackColor4U(LLColor4U &value, const char *name) } -BOOL LLDataPackerAsciiFile::packVector2(const LLVector2 &value, const char *name) +bool LLDataPackerAsciiFile::packVector2(const LLVector2 &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -1971,13 +1971,13 @@ BOOL LLDataPackerAsciiFile::packVector2(const LLVector2 &value, const char *name } -BOOL LLDataPackerAsciiFile::unpackVector2(LLVector2 &value, const char *name) +bool LLDataPackerAsciiFile::unpackVector2(LLVector2 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f %f", &value.mV[0], &value.mV[1]); @@ -1985,9 +1985,9 @@ BOOL LLDataPackerAsciiFile::unpackVector2(LLVector2 &value, const char *name) } -BOOL LLDataPackerAsciiFile::packVector3(const LLVector3 &value, const char *name) +bool LLDataPackerAsciiFile::packVector3(const LLVector3 &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -2001,22 +2001,22 @@ BOOL LLDataPackerAsciiFile::packVector3(const LLVector3 &value, const char *name } -BOOL LLDataPackerAsciiFile::unpackVector3(LLVector3 &value, const char *name) +bool LLDataPackerAsciiFile::unpackVector3(LLVector3 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f %f %f", &value.mV[0], &value.mV[1], &value.mV[2]); return success; } -BOOL LLDataPackerAsciiFile::packVector4(const LLVector4 &value, const char *name) +bool LLDataPackerAsciiFile::packVector4(const LLVector4 &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); if (mFP) { @@ -2030,13 +2030,13 @@ BOOL LLDataPackerAsciiFile::packVector4(const LLVector4 &value, const char *name } -BOOL LLDataPackerAsciiFile::unpackVector4(LLVector4 &value, const char *name) +bool LLDataPackerAsciiFile::unpackVector4(LLVector4 &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } sscanf(valuestr,"%f %f %f %f", &value.mV[0], &value.mV[1], &value.mV[2], &value.mV[3]); @@ -2044,9 +2044,9 @@ BOOL LLDataPackerAsciiFile::unpackVector4(LLVector4 &value, const char *name) } -BOOL LLDataPackerAsciiFile::packUUID(const LLUUID &value, const char *name) +bool LLDataPackerAsciiFile::packUUID(const LLUUID &value, const char *name) { - BOOL success = TRUE; + bool success = true; writeIndentedName(name); std::string tmp_str; value.toString(tmp_str); @@ -2062,13 +2062,13 @@ BOOL LLDataPackerAsciiFile::packUUID(const LLUUID &value, const char *name) } -BOOL LLDataPackerAsciiFile::unpackUUID(LLUUID &value, const char *name) +bool LLDataPackerAsciiFile::unpackUUID(LLUUID &value, const char *name) { - BOOL success = TRUE; + bool success = true; char valuestr[DP_BUFSIZE]; /*Flawfinder: ignore */ if (!getValueStr(name, valuestr, DP_BUFSIZE)) { - return FALSE; + return false; } char tmp_str[64]; /*Flawfinder: ignore */ @@ -2100,9 +2100,9 @@ void LLDataPackerAsciiFile::writeIndentedName(const char *name) } } -BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 value_len) +bool LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 value_len) { - BOOL success = FALSE; + bool success = false; char buffer[DP_BUFSIZE]; /*Flawfinder: ignore*/ char keyword[DP_BUFSIZE]; /*Flawfinder: ignore*/ char value[DP_BUFSIZE]; /*Flawfinder: ignore*/ @@ -2117,7 +2117,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v if (0 != fgetpos(mFP, &last_pos)) // 0==success for fgetpos { LL_WARNS() << "Data packer failed to fgetpos" << LL_ENDL; - return FALSE; + return false; } if (fgets(buffer, DP_BUFSIZE, mFP) == NULL) @@ -2131,20 +2131,20 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v { LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL; fsetpos(mFP, &last_pos); - return FALSE; + return false; } if (strcmp(keyword, name)) { LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL; fsetpos(mFP, &last_pos); - return FALSE; + return false; } S32 in_value_len = (S32)strlen(value)+1; /*Flawfinder: ignore*/ S32 min_len = llmin(in_value_len, value_len); memcpy(out_value, value, min_len); /*Flawfinder: ignore*/ out_value[min_len-1] = 0; - success = TRUE; + success = true; } else if (mInputStream) { @@ -2154,19 +2154,19 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v if (!keyword[0]) { LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL; - return FALSE; + return false; } if (strcmp(keyword, name)) { LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL; - return FALSE; + return false; } S32 in_value_len = (S32)strlen(value)+1; /*Flawfinder: ignore*/ S32 min_len = llmin(in_value_len, value_len); memcpy(out_value, value, min_len); /*Flawfinder: ignore*/ out_value[min_len-1] = 0; - success = TRUE; + success = true; } return success; diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h index ac28cadbce..8e980d8611 100644 --- a/indra/llmessage/lldatapacker.h +++ b/indra/llmessage/lldatapacker.h @@ -43,72 +43,72 @@ public: virtual void reset(); virtual void dumpBufferToLog(); - virtual BOOL hasNext() const = 0; + virtual bool hasNext() const = 0; - virtual BOOL packString(const std::string& value, const char *name) = 0; - virtual BOOL unpackString(std::string& value, const char *name) = 0; + virtual bool packString(const std::string& value, const char *name) = 0; + virtual bool unpackString(std::string& value, const char *name) = 0; - virtual BOOL packBinaryData(const U8 *value, S32 size, const char *name) = 0; - virtual BOOL unpackBinaryData(U8 *value, S32 &size, const char *name) = 0; + virtual bool packBinaryData(const U8 *value, S32 size, const char *name) = 0; + virtual bool unpackBinaryData(U8 *value, S32 &size, const char *name) = 0; // Constant size binary data packing - virtual BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name) = 0; - virtual BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name) = 0; + virtual bool packBinaryDataFixed(const U8 *value, S32 size, const char *name) = 0; + virtual bool unpackBinaryDataFixed(U8 *value, S32 size, const char *name) = 0; - virtual BOOL packU8(const U8 value, const char *name) = 0; - virtual BOOL unpackU8(U8 &value, const char *name) = 0; + virtual bool packU8(const U8 value, const char *name) = 0; + virtual bool unpackU8(U8 &value, const char *name) = 0; - virtual BOOL packU16(const U16 value, const char *name) = 0; - virtual BOOL unpackU16(U16 &value, const char *name) = 0; - BOOL unpackU16s(U16 *value, S32 count, const char *name); + virtual bool packU16(const U16 value, const char *name) = 0; + virtual bool unpackU16(U16 &value, const char *name) = 0; + bool unpackU16s(U16 *value, S32 count, const char *name); - virtual BOOL packS16(const S16 value, const char *name) = 0; - virtual BOOL unpackS16(S16 &value, const char *name) = 0; - BOOL unpackS16s(S16 *value, S32 count, const char *name); + virtual bool packS16(const S16 value, const char *name) = 0; + virtual bool unpackS16(S16 &value, const char *name) = 0; + bool unpackS16s(S16 *value, S32 count, const char *name); - virtual BOOL packU32(const U32 value, const char *name) = 0; - virtual BOOL unpackU32(U32 &value, const char *name) = 0; + virtual bool packU32(const U32 value, const char *name) = 0; + virtual bool unpackU32(U32 &value, const char *name) = 0; - virtual BOOL packS32(const S32 value, const char *name) = 0; - virtual BOOL unpackS32(S32 &value, const char *name) = 0; + virtual bool packS32(const S32 value, const char *name) = 0; + virtual bool unpackS32(S32 &value, const char *name) = 0; - virtual BOOL packF32(const F32 value, const char *name) = 0; - virtual BOOL unpackF32(F32 &value, const char *name) = 0; - BOOL unpackF32s(F32 *values, S32 count, const char *name); + virtual bool packF32(const F32 value, const char *name) = 0; + virtual bool unpackF32(F32 &value, const char *name) = 0; + bool unpackF32s(F32 *values, S32 count, const char *name); // Packs a float into an integer, using the given size // and picks the right U* data type to pack into. - BOOL packFixed(const F32 value, const char *name, - const BOOL is_signed, const U32 int_bits, const U32 frac_bits); - BOOL unpackFixed(F32 &value, const char *name, - const BOOL is_signed, const U32 int_bits, const U32 frac_bits); + bool packFixed(const F32 value, const char *name, + const bool is_signed, const U32 int_bits, const U32 frac_bits); + bool unpackFixed(F32 &value, const char *name, + const bool is_signed, const U32 int_bits, const U32 frac_bits); - virtual BOOL packColor4(const LLColor4 &value, const char *name) = 0; - virtual BOOL unpackColor4(LLColor4 &value, const char *name) = 0; + virtual bool packColor4(const LLColor4 &value, const char *name) = 0; + virtual bool unpackColor4(LLColor4 &value, const char *name) = 0; - virtual BOOL packColor4U(const LLColor4U &value, const char *name) = 0; - virtual BOOL unpackColor4U(LLColor4U &value, const char *name) = 0; - BOOL unpackColor4Us(LLColor4U *values, S32 count, const char *name); + virtual bool packColor4U(const LLColor4U &value, const char *name) = 0; + virtual bool unpackColor4U(LLColor4U &value, const char *name) = 0; + bool unpackColor4Us(LLColor4U *values, S32 count, const char *name); - virtual BOOL packVector2(const LLVector2 &value, const char *name) = 0; - virtual BOOL unpackVector2(LLVector2 &value, const char *name) = 0; + virtual bool packVector2(const LLVector2 &value, const char *name) = 0; + virtual bool unpackVector2(LLVector2 &value, const char *name) = 0; - virtual BOOL packVector3(const LLVector3 &value, const char *name) = 0; - virtual BOOL unpackVector3(LLVector3 &value, const char *name) = 0; + virtual bool packVector3(const LLVector3 &value, const char *name) = 0; + virtual bool unpackVector3(LLVector3 &value, const char *name) = 0; - virtual BOOL packVector4(const LLVector4 &value, const char *name) = 0; - virtual BOOL unpackVector4(LLVector4 &value, const char *name) = 0; + virtual bool packVector4(const LLVector4 &value, const char *name) = 0; + virtual bool unpackVector4(LLVector4 &value, const char *name) = 0; - virtual BOOL packUUID(const LLUUID &value, const char *name) = 0; - virtual BOOL unpackUUID(LLUUID &value, const char *name) = 0; - BOOL unpackUUIDs(LLUUID *values, S32 count, const char *name); + virtual bool packUUID(const LLUUID &value, const char *name) = 0; + virtual bool unpackUUID(LLUUID &value, const char *name) = 0; + bool unpackUUIDs(LLUUID *values, S32 count, const char *name); U32 getPassFlags() const { return mPassFlags; } void setPassFlags(U32 flags) { mPassFlags = flags; } protected: LLDataPacker(); protected: U32 mPassFlags; - BOOL mWriteEnabled; // disable this to do things like determine filesize without actually copying data + bool mWriteEnabled; // disable this to do things like determine filesize without actually copying data }; class LLDataPackerBinaryBuffer : public LLDataPacker @@ -120,7 +120,7 @@ public: mCurBufferp(bufferp), mBufferSize(size) { - mWriteEnabled = TRUE; + mWriteEnabled = true; } LLDataPackerBinaryBuffer() @@ -131,58 +131,58 @@ public: { } - /*virtual*/ BOOL packString(const std::string& value, const char *name); - /*virtual*/ BOOL unpackString(std::string& value, const char *name); + /*virtual*/ bool packString(const std::string& value, const char *name); + /*virtual*/ bool unpackString(std::string& value, const char *name); - /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name); + /*virtual*/ bool packBinaryData(const U8 *value, S32 size, const char *name); + /*virtual*/ bool unpackBinaryData(U8 *value, S32 &size, const char *name); // Constant size binary data packing - /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name); + /*virtual*/ bool packBinaryDataFixed(const U8 *value, S32 size, const char *name); + /*virtual*/ bool unpackBinaryDataFixed(U8 *value, S32 size, const char *name); - /*virtual*/ BOOL packU8(const U8 value, const char *name); - /*virtual*/ BOOL unpackU8(U8 &value, const char *name); + /*virtual*/ bool packU8(const U8 value, const char *name); + /*virtual*/ bool unpackU8(U8 &value, const char *name); - /*virtual*/ BOOL packU16(const U16 value, const char *name); - /*virtual*/ BOOL unpackU16(U16 &value, const char *name); + /*virtual*/ bool packU16(const U16 value, const char *name); + /*virtual*/ bool unpackU16(U16 &value, const char *name); - /*virtual*/ BOOL packS16(const S16 value, const char *name); - /*virtual*/ BOOL unpackS16(S16 &value, const char *name); + /*virtual*/ bool packS16(const S16 value, const char *name); + /*virtual*/ bool unpackS16(S16 &value, const char *name); - /*virtual*/ BOOL packU32(const U32 value, const char *name); - /*virtual*/ BOOL unpackU32(U32 &value, const char *name); + /*virtual*/ bool packU32(const U32 value, const char *name); + /*virtual*/ bool unpackU32(U32 &value, const char *name); - /*virtual*/ BOOL packS32(const S32 value, const char *name); - /*virtual*/ BOOL unpackS32(S32 &value, const char *name); + /*virtual*/ bool packS32(const S32 value, const char *name); + /*virtual*/ bool unpackS32(S32 &value, const char *name); - /*virtual*/ BOOL packF32(const F32 value, const char *name); - /*virtual*/ BOOL unpackF32(F32 &value, const char *name); + /*virtual*/ bool packF32(const F32 value, const char *name); + /*virtual*/ bool unpackF32(F32 &value, const char *name); - /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name); - /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name); + /*virtual*/ bool packColor4(const LLColor4 &value, const char *name); + /*virtual*/ bool unpackColor4(LLColor4 &value, const char *name); - /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name); - /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name); + /*virtual*/ bool packColor4U(const LLColor4U &value, const char *name); + /*virtual*/ bool unpackColor4U(LLColor4U &value, const char *name); - /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name); - /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name); + /*virtual*/ bool packVector2(const LLVector2 &value, const char *name); + /*virtual*/ bool unpackVector2(LLVector2 &value, const char *name); - /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name); - /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name); + /*virtual*/ bool packVector3(const LLVector3 &value, const char *name); + /*virtual*/ bool unpackVector3(LLVector3 &value, const char *name); - /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name); - /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name); + /*virtual*/ bool packVector4(const LLVector4 &value, const char *name); + /*virtual*/ bool unpackVector4(LLVector4 &value, const char *name); - /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name); - /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name); + /*virtual*/ bool packUUID(const LLUUID &value, const char *name); + /*virtual*/ bool unpackUUID(LLUUID &value, const char *name); S32 getCurrentSize() const { return (S32)(mCurBufferp - mBufferp); } S32 getBufferSize() const { return mBufferSize; } const U8* getBuffer() const { return mBufferp; } void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); } void shift(S32 offset) { reset(); mCurBufferp += offset;} - void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; } + void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = false; } void assignBuffer(U8 *bufferp, S32 size) { if(mBufferp && mBufferp != bufferp) @@ -192,31 +192,31 @@ public: mBufferp = bufferp; mCurBufferp = bufferp; mBufferSize = size; - mWriteEnabled = TRUE; + mWriteEnabled = true; } const LLDataPackerBinaryBuffer& operator=(const LLDataPackerBinaryBuffer &a); - /*virtual*/ BOOL hasNext() const { return getCurrentSize() < getBufferSize(); } + /*virtual*/ bool hasNext() const { return getCurrentSize() < getBufferSize(); } /*virtual*/ void dumpBufferToLog(); protected: - inline BOOL verifyLength(const S32 data_size, const char *name); + inline bool verifyLength(const S32 data_size, const char *name); U8 *mBufferp; U8 *mCurBufferp; S32 mBufferSize; }; -inline BOOL LLDataPackerBinaryBuffer::verifyLength(const S32 data_size, const char *name) +inline bool LLDataPackerBinaryBuffer::verifyLength(const S32 data_size, const char *name) { if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size) { LL_WARNS() << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << LL_ENDL; LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL; - return FALSE; + return false; } - return TRUE; + return true; } class LLDataPackerAsciiBuffer : public LLDataPacker @@ -228,8 +228,8 @@ public: mCurBufferp = bufferp; mBufferSize = size; mPassFlags = 0; - mIncludeNames = FALSE; - mWriteEnabled = TRUE; + mIncludeNames = false; + mWriteEnabled = true; } LLDataPackerAsciiBuffer() @@ -238,57 +238,57 @@ public: mCurBufferp = NULL; mBufferSize = 0; mPassFlags = 0; - mIncludeNames = FALSE; - mWriteEnabled = FALSE; + mIncludeNames = false; + mWriteEnabled = false; } - /*virtual*/ BOOL packString(const std::string& value, const char *name); - /*virtual*/ BOOL unpackString(std::string& value, const char *name); + /*virtual*/ bool packString(const std::string& value, const char *name); + /*virtual*/ bool unpackString(std::string& value, const char *name); - /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name); + /*virtual*/ bool packBinaryData(const U8 *value, S32 size, const char *name); + /*virtual*/ bool unpackBinaryData(U8 *value, S32 &size, const char *name); // Constant size binary data packing - /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name); + /*virtual*/ bool packBinaryDataFixed(const U8 *value, S32 size, const char *name); + /*virtual*/ bool unpackBinaryDataFixed(U8 *value, S32 size, const char *name); - /*virtual*/ BOOL packU8(const U8 value, const char *name); - /*virtual*/ BOOL unpackU8(U8 &value, const char *name); + /*virtual*/ bool packU8(const U8 value, const char *name); + /*virtual*/ bool unpackU8(U8 &value, const char *name); - /*virtual*/ BOOL packU16(const U16 value, const char *name); - /*virtual*/ BOOL unpackU16(U16 &value, const char *name); + /*virtual*/ bool packU16(const U16 value, const char *name); + /*virtual*/ bool unpackU16(U16 &value, const char *name); - /*virtual*/ BOOL packS16(const S16 value, const char *name); - /*virtual*/ BOOL unpackS16(S16 &value, const char *name); + /*virtual*/ bool packS16(const S16 value, const char *name); + /*virtual*/ bool unpackS16(S16 &value, const char *name); - /*virtual*/ BOOL packU32(const U32 value, const char *name); - /*virtual*/ BOOL unpackU32(U32 &value, const char *name); + /*virtual*/ bool packU32(const U32 value, const char *name); + /*virtual*/ bool unpackU32(U32 &value, const char *name); - /*virtual*/ BOOL packS32(const S32 value, const char *name); - /*virtual*/ BOOL unpackS32(S32 &value, const char *name); + /*virtual*/ bool packS32(const S32 value, const char *name); + /*virtual*/ bool unpackS32(S32 &value, const char *name); - /*virtual*/ BOOL packF32(const F32 value, const char *name); - /*virtual*/ BOOL unpackF32(F32 &value, const char *name); + /*virtual*/ bool packF32(const F32 value, const char *name); + /*virtual*/ bool unpackF32(F32 &value, const char *name); - /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name); - /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name); + /*virtual*/ bool packColor4(const LLColor4 &value, const char *name); + /*virtual*/ bool unpackColor4(LLColor4 &value, const char *name); - /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name); - /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name); + /*virtual*/ bool packColor4U(const LLColor4U &value, const char *name); + /*virtual*/ bool unpackColor4U(LLColor4U &value, const char *name); - /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name); - /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name); + /*virtual*/ bool packVector2(const LLVector2 &value, const char *name); + /*virtual*/ bool unpackVector2(LLVector2 &value, const char *name); - /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name); - /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name); + /*virtual*/ bool packVector3(const LLVector3 &value, const char *name); + /*virtual*/ bool unpackVector3(LLVector3 &value, const char *name); - /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name); - /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name); + /*virtual*/ bool packVector4(const LLVector4 &value, const char *name); + /*virtual*/ bool unpackVector4(LLVector4 &value, const char *name); - /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name); - /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name); + /*virtual*/ bool packUUID(const LLUUID &value, const char *name); + /*virtual*/ bool unpackUUID(LLUUID &value, const char *name); - void setIncludeNames(BOOL b) { mIncludeNames = b; } + void setIncludeNames(bool b) { mIncludeNames = b; } // Include the trailing NULL so it's always a valid string S32 getCurrentSize() const { return (S32)(mCurBufferp - mBufferp) + 1; } @@ -296,7 +296,7 @@ public: S32 getBufferSize() const { return mBufferSize; } /*virtual*/ void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); } - /*virtual*/ BOOL hasNext() const { return getCurrentSize() < getBufferSize(); } + /*virtual*/ bool hasNext() const { return getCurrentSize() < getBufferSize(); } inline void freeBuffer(); inline void assignBuffer(char* bufferp, S32 size); @@ -304,15 +304,15 @@ public: protected: void writeIndentedName(const char *name); - BOOL getValueStr(const char *name, char *out_value, const S32 value_len); + bool getValueStr(const char *name, char *out_value, const S32 value_len); protected: - inline BOOL verifyLength(const S32 data_size, const char *name); + inline bool verifyLength(const S32 data_size, const char *name); char *mBufferp; char *mCurBufferp; S32 mBufferSize; - BOOL mIncludeNames; // useful for debugging, print the name of each field + bool mIncludeNames; // useful for debugging, print the name of each field }; inline void LLDataPackerAsciiBuffer::freeBuffer() @@ -320,7 +320,7 @@ inline void LLDataPackerAsciiBuffer::freeBuffer() delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; - mWriteEnabled = FALSE; + mWriteEnabled = false; } inline void LLDataPackerAsciiBuffer::assignBuffer(char* bufferp, S32 size) @@ -328,19 +328,19 @@ inline void LLDataPackerAsciiBuffer::assignBuffer(char* bufferp, S32 size) mBufferp = bufferp; mCurBufferp = bufferp; mBufferSize = size; - mWriteEnabled = TRUE; + mWriteEnabled = true; } -inline BOOL LLDataPackerAsciiBuffer::verifyLength(const S32 data_size, const char *name) +inline bool LLDataPackerAsciiBuffer::verifyLength(const S32 data_size, const char *name) { if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size) { LL_WARNS() << "Buffer overflow in AsciiBuffer length verify, field name " << name << "!" << LL_ENDL; LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL; - return FALSE; + return false; } - return TRUE; + return true; } class LLDataPackerAsciiFile : public LLDataPacker @@ -362,7 +362,7 @@ public: mOutputStream(&output_stream), mInputStream(NULL) { - mWriteEnabled = TRUE; + mWriteEnabled = true; } LLDataPackerAsciiFile(std::istream& input_stream, const S32 indent = 2) @@ -374,55 +374,55 @@ public: { } - /*virtual*/ BOOL packString(const std::string& value, const char *name); - /*virtual*/ BOOL unpackString(std::string& value, const char *name); + /*virtual*/ bool packString(const std::string& value, const char *name); + /*virtual*/ bool unpackString(std::string& value, const char *name); - /*virtual*/ BOOL packBinaryData(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryData(U8 *value, S32 &size, const char *name); + /*virtual*/ bool packBinaryData(const U8 *value, S32 size, const char *name); + /*virtual*/ bool unpackBinaryData(U8 *value, S32 &size, const char *name); - /*virtual*/ BOOL packBinaryDataFixed(const U8 *value, S32 size, const char *name); - /*virtual*/ BOOL unpackBinaryDataFixed(U8 *value, S32 size, const char *name); + /*virtual*/ bool packBinaryDataFixed(const U8 *value, S32 size, const char *name); + /*virtual*/ bool unpackBinaryDataFixed(U8 *value, S32 size, const char *name); - /*virtual*/ BOOL packU8(const U8 value, const char *name); - /*virtual*/ BOOL unpackU8(U8 &value, const char *name); + /*virtual*/ bool packU8(const U8 value, const char *name); + /*virtual*/ bool unpackU8(U8 &value, const char *name); - /*virtual*/ BOOL packU16(const U16 value, const char *name); - /*virtual*/ BOOL unpackU16(U16 &value, const char *name); + /*virtual*/ bool packU16(const U16 value, const char *name); + /*virtual*/ bool unpackU16(U16 &value, const char *name); - /*virtual*/ BOOL packS16(const S16 value, const char *name); - /*virtual*/ BOOL unpackS16(S16 &value, const char *name); + /*virtual*/ bool packS16(const S16 value, const char *name); + /*virtual*/ bool unpackS16(S16 &value, const char *name); - /*virtual*/ BOOL packU32(const U32 value, const char *name); - /*virtual*/ BOOL unpackU32(U32 &value, const char *name); + /*virtual*/ bool packU32(const U32 value, const char *name); + /*virtual*/ bool unpackU32(U32 &value, const char *name); - /*virtual*/ BOOL packS32(const S32 value, const char *name); - /*virtual*/ BOOL unpackS32(S32 &value, const char *name); + /*virtual*/ bool packS32(const S32 value, const char *name); + /*virtual*/ bool unpackS32(S32 &value, const char *name); - /*virtual*/ BOOL packF32(const F32 value, const char *name); - /*virtual*/ BOOL unpackF32(F32 &value, const char *name); + /*virtual*/ bool packF32(const F32 value, const char *name); + /*virtual*/ bool unpackF32(F32 &value, const char *name); - /*virtual*/ BOOL packColor4(const LLColor4 &value, const char *name); - /*virtual*/ BOOL unpackColor4(LLColor4 &value, const char *name); + /*virtual*/ bool packColor4(const LLColor4 &value, const char *name); + /*virtual*/ bool unpackColor4(LLColor4 &value, const char *name); - /*virtual*/ BOOL packColor4U(const LLColor4U &value, const char *name); - /*virtual*/ BOOL unpackColor4U(LLColor4U &value, const char *name); + /*virtual*/ bool packColor4U(const LLColor4U &value, const char *name); + /*virtual*/ bool unpackColor4U(LLColor4U &value, const char *name); - /*virtual*/ BOOL packVector2(const LLVector2 &value, const char *name); - /*virtual*/ BOOL unpackVector2(LLVector2 &value, const char *name); + /*virtual*/ bool packVector2(const LLVector2 &value, const char *name); + /*virtual*/ bool unpackVector2(LLVector2 &value, const char *name); - /*virtual*/ BOOL packVector3(const LLVector3 &value, const char *name); - /*virtual*/ BOOL unpackVector3(LLVector3 &value, const char *name); + /*virtual*/ bool packVector3(const LLVector3 &value, const char *name); + /*virtual*/ bool unpackVector3(LLVector3 &value, const char *name); - /*virtual*/ BOOL packVector4(const LLVector4 &value, const char *name); - /*virtual*/ BOOL unpackVector4(LLVector4 &value, const char *name); + /*virtual*/ bool packVector4(const LLVector4 &value, const char *name); + /*virtual*/ bool unpackVector4(LLVector4 &value, const char *name); - /*virtual*/ BOOL packUUID(const LLUUID &value, const char *name); - /*virtual*/ BOOL unpackUUID(LLUUID &value, const char *name); + /*virtual*/ bool packUUID(const LLUUID &value, const char *name); + /*virtual*/ bool unpackUUID(LLUUID &value, const char *name); protected: void writeIndentedName(const char *name); - BOOL getValueStr(const char *name, char *out_value, const S32 value_len); + bool getValueStr(const char *name, char *out_value, const S32 value_len); - /*virtual*/ BOOL hasNext() const { return true; } + /*virtual*/ bool hasNext() const { return true; } protected: S32 mIndent; diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 98b8919660..3ac07626b0 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -460,7 +460,7 @@ bool LLPhysicsMotionController::onUpdate(F32 time, U8* joint_mask) return true; } - BOOL update_visuals = false; + bool update_visuals = false; for (motion_vec_t::iterator iter = mMotions.begin(); iter != mMotions.end(); ++iter) @@ -707,7 +707,7 @@ bool LLPhysicsMotion::onUpdate(F32 time) const F32 min_delta = (1.0001f-lod_factor)*0.4f; if (llabs(position_diff_local) > min_delta) { - update_visuals = TRUE; + update_visuals = true; mPositionLastUpdate_local = position_new_local; } } From 17cb28ec2b4f290f7492eb9c765be114b0cd435f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Sat, 17 Feb 2024 17:10:22 +0100 Subject: [PATCH 6/7] remove obsolete Mac Rez file --- indra/newview/CMakeLists.txt | 1 - indra/newview/macview.r | 123 ----------------------------------- 2 files changed, 124 deletions(-) delete mode 100755 indra/newview/macview.r diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4fac765f80..52593cca5b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1404,7 +1404,6 @@ if (DARWIN) # Add resource files to the project. set(viewer_RESOURCE_FILES secondlife.icns - macview.r Info-SecondLife.plist SecondLife.xib/ # CMake doesn't seem to support Xcode language variants well just yet diff --git a/indra/newview/macview.r b/indra/newview/macview.r deleted file mode 100755 index 8124232cf1..0000000000 --- a/indra/newview/macview.r +++ /dev/null @@ -1,123 +0,0 @@ -/* main.r */ - -#include -#include "macmain.h" - -resource 'MBAR' (rMenuBar, preload) { - { /* array MenuArray: 3 elements */ - /* [1] */ - 128, - /* [2] */ - 129, - /* [3] */ - 130 - } -}; - -resource 'MENU' (mApple, preload) { - 128, - textMenuProc, - 0x7FFFFFFD, - enabled, - apple, - { /* array: 2 elements */ - /* [1] */ - "About Second Life", noIcon, noKey, noMark, plain, - /* [2] */ - "-", noIcon, noKey, noMark, plain - } -}; - -resource 'MENU' (mFile, preload) { - 129, - textMenuProc, - 0x1400, - enabled, - "File", - { /* array: 11 elements */ - /* [1] */ - "New", noIcon, "N", noMark, plain, - /* [2] */ - "Open", noIcon, "O", noMark, plain, - /* [3] */ - "-", noIcon, noKey, noMark, plain, - /* [4] */ - "Close", noIcon, "W", noMark, plain, - /* [5] */ - "Save", noIcon, "S", noMark, plain, - /* [6] */ - "Save AsÉ", noIcon, noKey, noMark, plain, - /* [7] */ - "-", noIcon, noKey, noMark, plain, - /* [8] */ - "Page SetupÉ", noIcon, noKey, noMark, plain, - /* [9] */ - "PrintÉ", noIcon, noKey, noMark, plain, - /* [10] */ - "-", noIcon, noKey, noMark, plain, - /* [11] */ - "Quit", noIcon, "Q", noMark, plain - } -}; - -resource 'MENU' (mEdit, preload) { - 130, - textMenuProc, - 0x0, - enabled, - "Edit", - { /* array: 6 elements */ - /* [1] */ - "Undo", noIcon, "Z", noMark, plain, - /* [2] */ - "-", noIcon, noKey, noMark, plain, - /* [3] */ - "Cut", noIcon, "X", noMark, plain, - /* [4] */ - "Copy", noIcon, "C", noMark, plain, - /* [5] */ - "Paste", noIcon, "V", noMark, plain, - /* [6] */ - "Clear", noIcon, noKey, noMark, plain - } -}; - -resource 'DITL' (kAboutBox) { - { /* array DITLarray: 3 elements */ - /* [1] */ - {16, 21, 38, 208}, - StaticText { - disabled, - "Hello hello hello..." - }, - /* [2] */ - {116, 287, 136, 345}, - Button { - enabled, - "OK" - }, - /* [3] */ - {54, 139, 74, 197}, - Button { - enabled, - "OK" - } - } -}; - -resource 'ALRT' (kAboutBox) { - {40, 40, 139, 280}, - 200, - { /* array: 4 elements */ - /* [1] */ - OK, visible, sound1, - /* [2] */ - OK, visible, sound1, - /* [3] */ - OK, visible, sound1, - /* [4] */ - OK, visible, sound1 - }, - noAutoCenter -}; - From 088f2f4f6545ebc2ee01945938a40ae5c87ad27a Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 17 Feb 2024 00:51:13 +0100 Subject: [PATCH 7/7] More BOOL to bool replacements primarily in llappearance and llxml --- .../llappearance/llavatarappearancedefines.h | 2 +- indra/llappearance/llavatarjointmesh.h | 3 - indra/llappearance/llpolymorph.h | 2 +- indra/llcharacter/lljoint.h | 16 +- indra/llcommon/tests/llstring_test.cpp | 2 +- indra/llfilesystem/lldir_linux.cpp | 4 +- indra/llfilesystem/lldir_win32.cpp | 11 +- indra/llfilesystem/lldir_win32.h | 2 +- indra/llrender/llfontregistry.cpp | 2 +- indra/llui/llxuiparser.cpp | 4 +- indra/llxml/llxmlnode.cpp | 265 ++++++++---------- indra/llxml/llxmlnode.h | 94 +++---- indra/llxml/llxmlparser.cpp | 14 +- indra/llxml/llxmlparser.h | 2 +- indra/llxml/llxmltree.cpp | 98 +++---- indra/llxml/llxmltree.h | 76 ++--- indra/newview/llagentwearables.cpp | 90 +++--- indra/newview/llagentwearables.h | 28 +- indra/newview/llmimetypes.cpp | 8 +- indra/newview/llviewerjoint.cpp | 2 +- indra/newview/llviewerjointattachment.cpp | 24 +- indra/newview/llviewerjointattachment.h | 10 +- indra/newview/llviewerjointmesh.cpp | 10 +- indra/newview/llviewerjointmesh.h | 16 +- indra/newview/llviewertexlayer.h | 2 +- indra/newview/llvograss.cpp | 6 +- indra/newview/llvotree.cpp | 9 +- 27 files changed, 378 insertions(+), 424 deletions(-) diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index 21c0dedeba..0bba3ddfcc 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -40,7 +40,7 @@ namespace LLAvatarAppearanceDefines extern const S32 SCRATCH_TEX_WIDTH; extern const S32 SCRATCH_TEX_HEIGHT; -static const U32 AVATAR_HOVER = 11001; +static constexpr U32 AVATAR_HOVER = 11001; //-------------------------------------------------------------------- // Enums diff --git a/indra/llappearance/llavatarjointmesh.h b/indra/llappearance/llavatarjointmesh.h index 57cf5a26f8..0d815643e9 100644 --- a/indra/llappearance/llavatarjointmesh.h +++ b/indra/llappearance/llavatarjointmesh.h @@ -122,9 +122,6 @@ public: // Sets up joint matrix data for rendering void setupJoint(LLAvatarJoint* current_joint); - // Render time method to upload batches of joint matrices - void uploadJointMatrices(); - // Sets ID for picking void setMeshID( S32 id ) {mMeshID = id;} diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index 5544344036..a932433819 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -183,7 +183,7 @@ protected: LLPolyVertexMask * mVertMask; ESex mLastSex; // number of morph masks that haven't been generated, must be 0 before this morph is applied - BOOL mNumMorphMasksPending; + S32 mNumMorphMasksPending; typedef std::vector volume_list_t; volume_list_t mVolumeMorphs; diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index f0bfb3ba89..e1a378e4c3 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -40,21 +40,21 @@ #include "xform.h" #include "llmatrix4a.h" -const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15; +constexpr S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15; // Need to set this to count of animate-able joints, // currently = #bones + #collision_volumes + #attachments + 2, // rounded to next multiple of 4. -const U32 LL_CHARACTER_MAX_ANIMATED_JOINTS = 216; // must be divisible by 4! -const U32 LL_MAX_JOINTS_PER_MESH_OBJECT = 110; +constexpr U32 LL_CHARACTER_MAX_ANIMATED_JOINTS = 216; // must be divisible by 4! +constexpr U32 LL_MAX_JOINTS_PER_MESH_OBJECT = 110; // These should be higher than the joint_num of any // other joint, to avoid conflicts in updateMotionsByType() -const U32 LL_HAND_JOINT_NUM = (LL_CHARACTER_MAX_ANIMATED_JOINTS-1); -const U32 LL_FACE_JOINT_NUM = (LL_CHARACTER_MAX_ANIMATED_JOINTS-2); -const S32 LL_CHARACTER_MAX_PRIORITY = 7; -const F32 LL_MAX_PELVIS_OFFSET = 5.f; +constexpr U32 LL_HAND_JOINT_NUM = (LL_CHARACTER_MAX_ANIMATED_JOINTS-1); +constexpr U32 LL_FACE_JOINT_NUM = (LL_CHARACTER_MAX_ANIMATED_JOINTS-2); +constexpr S32 LL_CHARACTER_MAX_PRIORITY = 7; +constexpr F32 LL_MAX_PELVIS_OFFSET = 5.f; -const F32 LL_JOINT_TRESHOLD_POS_OFFSET = 0.0001f; //0.1 mm +constexpr F32 LL_JOINT_TRESHOLD_POS_OFFSET = 0.0001f; //0.1 mm class LLVector3OverrideMap { diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp index a7aa347222..3e31a5d667 100644 --- a/indra/llcommon/tests/llstring_test.cpp +++ b/indra/llcommon/tests/llstring_test.cpp @@ -231,7 +231,7 @@ namespace tut template<> template<> void string_index_object_t::test<17>() { - BOOL value; + bool value; std::string str_val("1"); ensure("convertToBOOL 1 failed", LLStringUtil::convertToBOOL(str_val, value) && value); str_val = "T"; diff --git a/indra/llfilesystem/lldir_linux.cpp b/indra/llfilesystem/lldir_linux.cpp index 80ad05345a..44e24a1625 100644 --- a/indra/llfilesystem/lldir_linux.cpp +++ b/indra/llfilesystem/lldir_linux.cpp @@ -247,11 +247,11 @@ bool LLDir_Linux::fileExists(const std::string &filename) const int res = stat(filename.c_str(), &stat_data); if (!res) { - return TRUE; + return true; } else { - return FALSE; + return false; } } diff --git a/indra/llfilesystem/lldir_win32.cpp b/indra/llfilesystem/lldir_win32.cpp index b3b3afb37e..41a70bf724 100644 --- a/indra/llfilesystem/lldir_win32.cpp +++ b/indra/llfilesystem/lldir_win32.cpp @@ -47,7 +47,9 @@ DWORD GetDllVersion(LPCTSTR lpszDllName); namespace { // anonymous - enum class prst { INIT, OPEN, SKIP } state = prst::INIT; + enum class prst { INIT, OPEN, SKIP }; + prst state{ prst::INIT }; + // This is called so early that we can't count on static objects being // properly constructed yet, so declare a pointer instead of an instance. std::ofstream* prelogf = nullptr; @@ -75,6 +77,7 @@ namespace (*prelogf) << "========================================================================" << std::endl; // fall through, don't break + [[fallthrough]]; case prst::OPEN: (*prelogf) << message << std::endl; @@ -253,7 +256,7 @@ LLDir_Win32::LLDir_Win32() // Determine the location of the App-Read-Only-Data // Try the working directory then the exe's dir. - mAppRODataDir = mWorkingDir; + mAppRODataDir = mWorkingDir; // if (mExecutableDir.find("indra") == std::string::npos) @@ -379,11 +382,11 @@ bool LLDir_Win32::fileExists(const std::string &filename) const int res = LLFile::stat(filename, &stat_data); if (!res) { - return TRUE; + return true; } else { - return FALSE; + return false; } } diff --git a/indra/llfilesystem/lldir_win32.h b/indra/llfilesystem/lldir_win32.h index 450efaf9da..fa6d5fd320 100644 --- a/indra/llfilesystem/lldir_win32.h +++ b/indra/llfilesystem/lldir_win32.h @@ -50,7 +50,7 @@ public: /*virtual*/ std::string getLLPluginFilename(std::string base_name); private: - void* mDirSearch_h; + void* mDirSearch_h{ nullptr }; llutf16string mCurrentDir; }; diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index 032396ca33..ae27fcbe48 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -277,7 +277,7 @@ bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc) if (child->hasAttribute("load_collection")) { - BOOL col = FALSE; + bool col = false; child->getAttributeBOOL("load_collection", col); if (col) { diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 138ba8bf02..c122ab1c9b 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -930,10 +930,10 @@ bool LLXUIParser::writeFlag(Parser& parser, const void* val_ptr, name_stack_t& s bool LLXUIParser::readBoolValue(Parser& parser, void* val_ptr) { - S32 value; + bool value; LLXUIParser& self = static_cast(parser); bool success = self.mCurReadNode->getBoolValue(1, &value); - *((bool*)val_ptr) = (value != FALSE); + *((bool*)val_ptr) = (value != false); return success; } diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 455df13e48..9c7ac66f01 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -44,13 +44,13 @@ #include "lldir.h" // static -BOOL LLXMLNode::sStripEscapedStrings = TRUE; -BOOL LLXMLNode::sStripWhitespaceValues = FALSE; +bool LLXMLNode::sStripEscapedStrings = true; +bool LLXMLNode::sStripWhitespaceValues = false; LLXMLNode::LLXMLNode() : mID(""), mParser(NULL), - mIsAttribute(FALSE), + mIsAttribute(false), mVersionMajor(0), mVersionMinor(0), mLength(0), @@ -69,7 +69,7 @@ LLXMLNode::LLXMLNode() : { } -LLXMLNode::LLXMLNode(const char* name, BOOL is_attribute) : +LLXMLNode::LLXMLNode(const char* name, bool is_attribute) : mID(""), mParser(NULL), mIsAttribute(is_attribute), @@ -91,7 +91,7 @@ LLXMLNode::LLXMLNode(const char* name, BOOL is_attribute) : mName = gStringTable.addStringEntry(name); } -LLXMLNode::LLXMLNode(LLStringTableEntry* name, BOOL is_attribute) : +LLXMLNode::LLXMLNode(LLStringTableEntry* name, bool is_attribute) : mID(""), mParser(NULL), mIsAttribute(is_attribute), @@ -193,17 +193,17 @@ LLXMLNode::~LLXMLNode() mDefault = NULL; } -BOOL LLXMLNode::isNull() +bool LLXMLNode::isNull() { return (mName == NULL); } // protected -BOOL LLXMLNode::removeChild(LLXMLNode *target_child) +bool LLXMLNode::removeChild(LLXMLNode *target_child) { if (!target_child) { - return FALSE; + return false; } if (target_child->mIsAttribute) { @@ -212,7 +212,7 @@ BOOL LLXMLNode::removeChild(LLXMLNode *target_child) { target_child->mParent = NULL; mAttributes.erase(children_itr); - return TRUE; + return true; } } else if (mChildren.notNull()) @@ -244,7 +244,7 @@ BOOL LLXMLNode::removeChild(LLXMLNode *target_child) { mChildren = NULL; } - return TRUE; + return true; } else if (children_itr->first != target_child->mName) { @@ -256,7 +256,7 @@ BOOL LLXMLNode::removeChild(LLXMLNode *target_child) } } } - return FALSE; + return false; } void LLXMLNode::addChild(LLXMLNodePtr& new_child) @@ -302,13 +302,13 @@ void LLXMLNode::addChild(LLXMLNodePtr& new_child) } // virtual -LLXMLNodePtr LLXMLNode::createChild(const char* name, BOOL is_attribute) +LLXMLNodePtr LLXMLNode::createChild(const char* name, bool is_attribute) { return createChild(gStringTable.addStringEntry(name), is_attribute); } // virtual -LLXMLNodePtr LLXMLNode::createChild(LLStringTableEntry* name, BOOL is_attribute) +LLXMLNodePtr LLXMLNode::createChild(LLStringTableEntry* name, bool is_attribute) { LLXMLNodePtr ret(new LLXMLNode(name, is_attribute)); ret->mID.clear(); @@ -317,13 +317,13 @@ LLXMLNodePtr LLXMLNode::createChild(LLStringTableEntry* name, BOOL is_attribute) return ret; } -BOOL LLXMLNode::deleteChild(LLXMLNode *child) +bool LLXMLNode::deleteChild(LLXMLNode *child) { if (removeChild(child)) { - return TRUE; + return true; } - return FALSE; + return false; } void LLXMLNode::setParent(LLXMLNodePtr& new_parent) @@ -375,7 +375,7 @@ void XMLCALL StartXMLNode(void *userData, const XML_Char **atts) { // Create a new node - LLXMLNode *new_node_ptr = new LLXMLNode(name, FALSE); + LLXMLNode *new_node_ptr = new LLXMLNode(name, false); LLXMLNodePtr new_node = new_node_ptr; new_node->mID.clear(); @@ -480,9 +480,9 @@ void XMLCALL StartXMLNode(void *userData, // only one attribute child per description LLXMLNodePtr attr_node; - if (!new_node->getAttribute(attr_name.c_str(), attr_node, FALSE)) + if (!new_node->getAttribute(attr_name.c_str(), attr_node, false)) { - attr_node = new LLXMLNode(attr_name.c_str(), TRUE); + attr_node = new LLXMLNode(attr_name.c_str(), true); attr_node->setLineNumber(XML_GetCurrentLineNumber(*new_node_ptr->mParser)); } attr_node->setValue(attr_value); @@ -508,13 +508,13 @@ void XMLCALL EndXMLNode(void *userData, if (LLXMLNode::sStripWhitespaceValues) { std::string value = node->getValue(); - BOOL is_empty = TRUE; + bool is_empty = true; for (std::string::size_type s = 0; s < value.length(); s++) { char c = value[s]; if (c != ' ' && c != '\t' && c != '\n') { - is_empty = FALSE; + is_empty = false; break; } } @@ -575,7 +575,7 @@ bool LLXMLNode::updateNode( if (!node || !update_node) { LL_WARNS() << "Node invalid" << LL_ENDL; - return FALSE; + return false; } //update the node value @@ -647,7 +647,7 @@ bool LLXMLNode::updateNode( } } - return TRUE; + return true; } // static @@ -688,7 +688,7 @@ bool LLXMLNode::parseBuffer( XML_SetCharacterDataHandler(my_parser, XMLData); // Create a root node - LLXMLNode *file_node_ptr = new LLXMLNode("XML", FALSE); + LLXMLNode *file_node_ptr = new LLXMLNode("XML", false); LLXMLNodePtr file_node = file_node_ptr; file_node->mParser = &my_parser; @@ -696,7 +696,7 @@ bool LLXMLNode::parseBuffer( XML_SetUserData(my_parser, (void *)file_node_ptr); // Do the parsing - if (XML_Parse(my_parser, (const char *)buffer, length, TRUE) != XML_STATUS_OK) + if (XML_Parse(my_parser, (const char *)buffer, length, true) != XML_STATUS_OK) { LL_WARNS() << "Error parsing xml error code: " << XML_ErrorString(XML_GetErrorCode(my_parser)) @@ -736,7 +736,7 @@ bool LLXMLNode::parseStream( XML_SetCharacterDataHandler(my_parser, XMLData); // Create a root node - LLXMLNode *file_node_ptr = new LLXMLNode("XML", FALSE); + LLXMLNode *file_node_ptr = new LLXMLNode("XML", false); LLXMLNodePtr file_node = file_node_ptr; file_node->mParser = &my_parser; @@ -784,18 +784,18 @@ bool LLXMLNode::parseStream( } -BOOL LLXMLNode::isFullyDefault() +bool LLXMLNode::isFullyDefault() { if (mDefault.isNull()) { - return FALSE; + return false; } - BOOL has_default_value = (mValue == mDefault->mValue); - BOOL has_default_attribute = (mIsAttribute == mDefault->mIsAttribute); - BOOL has_default_type = mIsAttribute || (mType == mDefault->mType); - BOOL has_default_encoding = mIsAttribute || (mEncoding == mDefault->mEncoding); - BOOL has_default_precision = mIsAttribute || (mPrecision == mDefault->mPrecision); - BOOL has_default_length = mIsAttribute || (mLength == mDefault->mLength); + bool has_default_value = (mValue == mDefault->mValue); + bool has_default_attribute = (mIsAttribute == mDefault->mIsAttribute); + bool has_default_type = mIsAttribute || (mType == mDefault->mType); + bool has_default_encoding = mIsAttribute || (mEncoding == mDefault->mEncoding); + bool has_default_precision = mIsAttribute || (mPrecision == mDefault->mPrecision); + bool has_default_length = mIsAttribute || (mLength == mDefault->mLength); if (has_default_value && has_default_type @@ -813,14 +813,14 @@ BOOL LLXMLNode::isFullyDefault() LLXMLNodePtr child = (*children_itr).second; if (!child->isFullyDefault()) { - return FALSE; + return false; } } } - return TRUE; + return true; } - return FALSE; + return false; } // static @@ -908,10 +908,10 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const std::string& i return; } - BOOL has_default_type = mDefault.isNull()?FALSE:(mType == mDefault->mType); - BOOL has_default_encoding = mDefault.isNull()?FALSE:(mEncoding == mDefault->mEncoding); - BOOL has_default_precision = mDefault.isNull()?FALSE:(mPrecision == mDefault->mPrecision); - BOOL has_default_length = mDefault.isNull()?FALSE:(mLength == mDefault->mLength); + bool has_default_type = mDefault.isNull()?false:(mType == mDefault->mType); + bool has_default_encoding = mDefault.isNull()?false:(mEncoding == mDefault->mEncoding); + bool has_default_precision = mDefault.isNull()?false:(mPrecision == mDefault->mPrecision); + bool has_default_length = mDefault.isNull()?false:(mLength == mDefault->mLength); // stream the name output_stream << indent << "<" << mName->mString << "\n"; @@ -1153,12 +1153,12 @@ void LLXMLNode::scrubToTree(LLXMLNode *tree) } } -bool LLXMLNode::getChild(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing) +bool LLXMLNode::getChild(const char* name, LLXMLNodePtr& node, bool use_default_if_missing) { return getChild(gStringTable.checkStringEntry(name), node, use_default_if_missing); } -bool LLXMLNode::getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing) +bool LLXMLNode::getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, bool use_default_if_missing) { if (mChildren.notNull()) { @@ -1171,18 +1171,18 @@ bool LLXMLNode::getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, BOO } if (use_default_if_missing && !mDefault.isNull()) { - return mDefault->getChild(name, node, FALSE); + return mDefault->getChild(name, node, false); } node = NULL; return false; } -void LLXMLNode::getChildren(const char* name, LLXMLNodeList &children, BOOL use_default_if_missing) const +void LLXMLNode::getChildren(const char* name, LLXMLNodeList &children, bool use_default_if_missing) const { getChildren(gStringTable.checkStringEntry(name), children, use_default_if_missing); } -void LLXMLNode::getChildren(const LLStringTableEntry* name, LLXMLNodeList &children, BOOL use_default_if_missing) const +void LLXMLNode::getChildren(const LLStringTableEntry* name, LLXMLNodeList &children, bool use_default_if_missing) const { if (mChildren.notNull()) { @@ -1204,7 +1204,7 @@ void LLXMLNode::getChildren(const LLStringTableEntry* name, LLXMLNodeList &child } if (children.size() == 0 && use_default_if_missing && !mDefault.isNull()) { - mDefault->getChildren(name, children, FALSE); + mDefault->getChildren(name, children, false); } } @@ -1227,12 +1227,12 @@ void LLXMLNode::getDescendants(const LLStringTableEntry* name, LLXMLNodeList &ch } } -bool LLXMLNode::getAttribute(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing) +bool LLXMLNode::getAttribute(const char* name, LLXMLNodePtr& node, bool use_default_if_missing) { return getAttribute(gStringTable.checkStringEntry(name), node, use_default_if_missing); } -bool LLXMLNode::getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing) +bool LLXMLNode::getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, bool use_default_if_missing) { LLXMLAttribList::const_iterator child_itr = mAttributes.find(name); if (child_itr != mAttributes.end()) @@ -1242,7 +1242,7 @@ bool LLXMLNode::getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, } if (use_default_if_missing && !mDefault.isNull()) { - return mDefault->getAttribute(name, node, FALSE); + return mDefault->getAttribute(name, node, false); } return false; @@ -1261,42 +1261,25 @@ bool LLXMLNode::setAttributeString(const char* attr, const std::string& value) return false; } -BOOL LLXMLNode::hasAttribute(const char* name ) +bool LLXMLNode::hasAttribute(const char* name ) { LLXMLNodePtr node; return getAttribute(name, node); } -// the structure of these getAttribute_ functions is ugly, but it's because the -// underlying system is based on BOOL and LLString; if we change -// so that they're based on more generic mechanisms, these will be -// simplified. -bool LLXMLNode::getAttribute_bool(const char* name, bool& value ) -{ - LLXMLNodePtr node; - if (!getAttribute(name, node)) - { - return false; - } - BOOL temp; - bool retval = node->getBoolValue(1, &temp); - value = temp; - return retval; -} - -BOOL LLXMLNode::getAttributeBOOL(const char* name, BOOL& value ) +bool LLXMLNode::getAttributeBOOL(const char* name, bool& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getBoolValue(1, &value)); } -BOOL LLXMLNode::getAttributeU8(const char* name, U8& value ) +bool LLXMLNode::getAttributeU8(const char* name, U8& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getByteValue(1, &value)); } -BOOL LLXMLNode::getAttributeS8(const char* name, S8& value ) +bool LLXMLNode::getAttributeS8(const char* name, S8& value ) { LLXMLNodePtr node; S32 val; @@ -1308,7 +1291,7 @@ BOOL LLXMLNode::getAttributeS8(const char* name, S8& value ) return true; } -BOOL LLXMLNode::getAttributeU16(const char* name, U16& value ) +bool LLXMLNode::getAttributeU16(const char* name, U16& value ) { LLXMLNodePtr node; U32 val; @@ -1320,7 +1303,7 @@ BOOL LLXMLNode::getAttributeU16(const char* name, U16& value ) return true; } -BOOL LLXMLNode::getAttributeS16(const char* name, S16& value ) +bool LLXMLNode::getAttributeS16(const char* name, S16& value ) { LLXMLNodePtr node; S32 val; @@ -1332,73 +1315,73 @@ BOOL LLXMLNode::getAttributeS16(const char* name, S16& value ) return true; } -BOOL LLXMLNode::getAttributeU32(const char* name, U32& value ) +bool LLXMLNode::getAttributeU32(const char* name, U32& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getUnsignedValue(1, &value)); } -BOOL LLXMLNode::getAttributeS32(const char* name, S32& value ) +bool LLXMLNode::getAttributeS32(const char* name, S32& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getIntValue(1, &value)); } -BOOL LLXMLNode::getAttributeF32(const char* name, F32& value ) +bool LLXMLNode::getAttributeF32(const char* name, F32& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getFloatValue(1, &value)); } -BOOL LLXMLNode::getAttributeF64(const char* name, F64& value ) +bool LLXMLNode::getAttributeF64(const char* name, F64& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getDoubleValue(1, &value)); } -BOOL LLXMLNode::getAttributeColor(const char* name, LLColor4& value ) +bool LLXMLNode::getAttributeColor(const char* name, LLColor4& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getFloatValue(4, value.mV)); } -BOOL LLXMLNode::getAttributeColor4(const char* name, LLColor4& value ) +bool LLXMLNode::getAttributeColor4(const char* name, LLColor4& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getFloatValue(4, value.mV)); } -BOOL LLXMLNode::getAttributeColor4U(const char* name, LLColor4U& value ) +bool LLXMLNode::getAttributeColor4U(const char* name, LLColor4U& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getByteValue(4, value.mV)); } -BOOL LLXMLNode::getAttributeVector3(const char* name, LLVector3& value ) +bool LLXMLNode::getAttributeVector3(const char* name, LLVector3& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getFloatValue(3, value.mV)); } -BOOL LLXMLNode::getAttributeVector3d(const char* name, LLVector3d& value ) +bool LLXMLNode::getAttributeVector3d(const char* name, LLVector3d& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getDoubleValue(3, value.mdV)); } -BOOL LLXMLNode::getAttributeQuat(const char* name, LLQuaternion& value ) +bool LLXMLNode::getAttributeQuat(const char* name, LLQuaternion& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getFloatValue(4, value.mQ)); } -BOOL LLXMLNode::getAttributeUUID(const char* name, LLUUID& value ) +bool LLXMLNode::getAttributeUUID(const char* name, LLUUID& value ) { LLXMLNodePtr node; return (getAttribute(name, node) && node->getUUIDValue(1, &value)); } -BOOL LLXMLNode::getAttributeString(const char* name, std::string& value ) +bool LLXMLNode::getAttributeString(const char* name, std::string& value ) { LLXMLNodePtr node; if (!getAttribute(name, node)) @@ -1435,10 +1418,10 @@ const char *LLXMLNode::skipNonWhitespace(const char *str) } /*static */ -const char *LLXMLNode::parseInteger(const char *str, U64 *dest, BOOL *is_negative, U32 precision, Encoding encoding) +const char *LLXMLNode::parseInteger(const char *str, U64 *dest, bool *is_negative, U32 precision, Encoding encoding) { *dest = 0; - *is_negative = FALSE; + *is_negative = false; str = skipWhitespace(str); @@ -1452,7 +1435,7 @@ const char *LLXMLNode::parseInteger(const char *str, U64 *dest, BOOL *is_negativ } if (str[0] == '-') { - *is_negative = TRUE; + *is_negative = true; ++str; } @@ -1653,7 +1636,7 @@ const char *LLXMLNode::parseFloat(const char *str, F64 *dest, U32 precision, Enc // Scientific notation! ++str; U64 exp; - BOOL is_negative; + bool is_negative; str = parseInteger(str, &exp, &is_negative, 64, ENCODING_DECIMAL); if (str == NULL) { @@ -1677,7 +1660,7 @@ const char *LLXMLNode::parseFloat(const char *str, F64 *dest, U32 precision, Enc if (encoding == ENCODING_HEX) { U64 bytes_dest; - BOOL is_negative; + bool is_negative; str = parseInteger(str, (U64 *)&bytes_dest, &is_negative, precision, ENCODING_HEX); // Upcast to F64 switch (precision) @@ -1700,7 +1683,7 @@ const char *LLXMLNode::parseFloat(const char *str, F64 *dest, U32 precision, Enc return NULL; } -U32 LLXMLNode::getBoolValue(U32 expected_length, BOOL *array) +U32 LLXMLNode::getBoolValue(U32 expected_length, bool *array) { llassert(array); @@ -1720,11 +1703,11 @@ U32 LLXMLNode::getBoolValue(U32 expected_length, BOOL *array) LLStringUtil::toLower(str_array[i]); if (str_array[i] == "false") { - array[ret_length++] = FALSE; + array[ret_length++] = false; } else if (str_array[i] == "true") { - array[ret_length++] = TRUE; + array[ret_length++] = true; } } @@ -1770,7 +1753,7 @@ U32 LLXMLNode::getByteValue(U32 expected_length, U8 *array, Encoding encoding) for (i=0; i 0 ? TRUE : FALSE; + return removed_count > 0; } -BOOL LLXMLNode::deleteChildren(LLStringTableEntry* name) +bool LLXMLNode::deleteChildren(LLStringTableEntry* name) { U32 removed_count = 0; LLXMLNodeList node_list; @@ -2655,7 +2638,7 @@ BOOL LLXMLNode::deleteChildren(LLStringTableEntry* name) } } } - return removed_count > 0 ? TRUE : FALSE; + return removed_count > 0; } void LLXMLNode::setAttributes(LLXMLNode::ValueType type, U32 precision, LLXMLNode::Encoding encoding, U32 length) @@ -2778,7 +2761,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children) child_name.append(1, c); } - LLXMLNode *new_child = createChild(child_name.c_str(), FALSE); + LLXMLNode *new_child = createChild(child_name.c_str(), false); // Random ID std::string child_id; @@ -2805,7 +2788,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children) break; case 1: // TYPE_BOOLEAN { - BOOL random_bool_values[30]; + bool random_bool_values[30]; for (U32 value=0; valuesetUnsignedValue(1, &integer_checksum, LLXMLNode::ENCODING_HEX); - createChild("long_checksum", TRUE)->setLongValue(1, &long_checksum, LLXMLNode::ENCODING_HEX); - createChild("bool_true_count", TRUE)->setUnsignedValue(1, &bool_true_count, LLXMLNode::ENCODING_HEX); - createChild("uuid_checksum", TRUE)->setUUIDValue(1, &uuid_checksum); - createChild("noderef_checksum", TRUE)->setUnsignedValue(1, &noderef_checksum, LLXMLNode::ENCODING_HEX); - createChild("float_checksum", TRUE)->setUnsignedValue(1, &float_checksum, LLXMLNode::ENCODING_HEX); + createChild("integer_checksum", true)->setUnsignedValue(1, &integer_checksum, LLXMLNode::ENCODING_HEX); + createChild("long_checksum", true)->setLongValue(1, &long_checksum, LLXMLNode::ENCODING_HEX); + createChild("bool_true_count", true)->setUnsignedValue(1, &bool_true_count, LLXMLNode::ENCODING_HEX); + createChild("uuid_checksum", true)->setUUIDValue(1, &uuid_checksum); + createChild("noderef_checksum", true)->setUnsignedValue(1, &noderef_checksum, LLXMLNode::ENCODING_HEX); + createChild("float_checksum", true)->setUnsignedValue(1, &float_checksum, LLXMLNode::ENCODING_HEX); } -BOOL LLXMLNode::performUnitTest(std::string &error_buffer) +bool LLXMLNode::performUnitTest(std::string &error_buffer) { if (mChildren.isNull()) { error_buffer.append(llformat("ERROR Node %s: No children found.\n", mName->mString)); - return FALSE; + return false; } // Checksums @@ -2950,14 +2933,14 @@ BOOL LLXMLNode::performUnitTest(std::string &error_buffer) if (!node->performUnitTest(error_buffer)) { error_buffer.append(llformat("Child test failed for %s.\n", mName->mString)); - //return FALSE; + //return false; } continue; } if (node->mLength < 1 || node->mLength > 30) { error_buffer.append(llformat("ERROR Node %s: Invalid array length %d, child %s.\n", mName->mString, node->mLength, node->mName->mString)); - return FALSE; + return false; } switch (node->mType) { @@ -2966,11 +2949,11 @@ BOOL LLXMLNode::performUnitTest(std::string &error_buffer) break; case TYPE_BOOLEAN: { - BOOL bool_array[30]; + bool bool_array[30]; if (node->getBoolValue(node->mLength, bool_array) < node->mLength) { error_buffer.append(llformat("ERROR Node %s: Could not read boolean array, child %s.\n", mName->mString, node->mName->mString)); - return FALSE; + return false; } for (U32 pos=0; pos<(U32)node->mLength; ++pos) { @@ -2989,7 +2972,7 @@ BOOL LLXMLNode::performUnitTest(std::string &error_buffer) if (node->getUnsignedValue(node->mLength, integer_array, node->mEncoding) < node->mLength) { error_buffer.append(llformat("ERROR Node %s: Could not read integer array, child %s.\n", mName->mString, node->mName->mString)); - return FALSE; + return false; } for (U32 pos=0; pos<(U32)node->mLength; ++pos) { @@ -3002,7 +2985,7 @@ BOOL LLXMLNode::performUnitTest(std::string &error_buffer) if (node->getLongValue(node->mLength, integer_array, node->mEncoding) < node->mLength) { error_buffer.append(llformat("ERROR Node %s: Could not read long integer array, child %s.\n", mName->mString, node->mName->mString)); - return FALSE; + return false; } for (U32 pos=0; pos<(U32)node->mLength; ++pos) { @@ -3019,7 +3002,7 @@ BOOL LLXMLNode::performUnitTest(std::string &error_buffer) if (node->getFloatValue(node->mLength, float_array, node->mEncoding) < node->mLength) { error_buffer.append(llformat("ERROR Node %s: Could not read float array, child %s.\n", mName->mString, node->mName->mString)); - return FALSE; + return false; } for (U32 pos=0; pos<(U32)node->mLength; ++pos) { @@ -3033,7 +3016,7 @@ BOOL LLXMLNode::performUnitTest(std::string &error_buffer) if (node->getDoubleValue(node->mLength, float_array, node->mEncoding) < node->mLength) { error_buffer.append(llformat("ERROR Node %s: Could not read float array, child %s.\n", mName->mString, node->mName->mString)); - return FALSE; + return false; } for (U32 pos=0; pos<(U32)node->mLength; ++pos) { @@ -3051,7 +3034,7 @@ BOOL LLXMLNode::performUnitTest(std::string &error_buffer) if (node->getUUIDValue(node->mLength, uuid_array) < node->mLength) { error_buffer.append(llformat("ERROR Node %s: Could not read uuid array, child %s.\n", mName->mString, node->mName->mString)); - return FALSE; + return false; } for (U32 pos=0; pos<(U32)node->mLength; ++pos) { @@ -3068,7 +3051,7 @@ BOOL LLXMLNode::performUnitTest(std::string &error_buffer) if (node->getNodeRefValue(node->mLength, node_array) < node->mLength) { error_buffer.append(llformat("ERROR Node %s: Could not read node ref array, child %s.\n", mName->mString, node->mName->mString)); - return FALSE; + return false; } for (U32 pos=0; posmLength; ++pos) { @@ -3089,97 +3072,97 @@ BOOL LLXMLNode::performUnitTest(std::string &error_buffer) // Compare checksums { U32 node_integer_checksum = 0; - if (!getAttribute("integer_checksum", checksum_node, FALSE) || + if (!getAttribute("integer_checksum", checksum_node, false) || checksum_node->getUnsignedValue(1, &node_integer_checksum, ENCODING_HEX) != 1) { error_buffer.append(llformat("ERROR Node %s: Integer checksum missing.\n", mName->mString)); - return FALSE; + return false; } if (node_integer_checksum != integer_checksum) { error_buffer.append(llformat("ERROR Node %s: Integer checksum mismatch: read %X / calc %X.\n", mName->mString, node_integer_checksum, integer_checksum)); - return FALSE; + return false; } } { U64 node_long_checksum = 0; - if (!getAttribute("long_checksum", checksum_node, FALSE) || + if (!getAttribute("long_checksum", checksum_node, false) || checksum_node->getLongValue(1, &node_long_checksum, ENCODING_HEX) != 1) { error_buffer.append(llformat("ERROR Node %s: Long Integer checksum missing.\n", mName->mString)); - return FALSE; + return false; } if (node_long_checksum != long_checksum) { U32 *pp1 = (U32 *)&node_long_checksum; U32 *pp2 = (U32 *)&long_checksum; error_buffer.append(llformat("ERROR Node %s: Long Integer checksum mismatch: read %08X%08X / calc %08X%08X.\n", mName->mString, pp1[1], pp1[0], pp2[1], pp2[0])); - return FALSE; + return false; } } { U32 node_bool_true_count = 0; - if (!getAttribute("bool_true_count", checksum_node, FALSE) || + if (!getAttribute("bool_true_count", checksum_node, false) || checksum_node->getUnsignedValue(1, &node_bool_true_count, ENCODING_HEX) != 1) { error_buffer.append(llformat("ERROR Node %s: Boolean checksum missing.\n", mName->mString)); - return FALSE; + return false; } if (node_bool_true_count != bool_true_count) { error_buffer.append(llformat("ERROR Node %s: Boolean checksum mismatch: read %X / calc %X.\n", mName->mString, node_bool_true_count, bool_true_count)); - return FALSE; + return false; } } { LLUUID node_uuid_checksum; - if (!getAttribute("uuid_checksum", checksum_node, FALSE) || + if (!getAttribute("uuid_checksum", checksum_node, false) || checksum_node->getUUIDValue(1, &node_uuid_checksum) != 1) { error_buffer.append(llformat("ERROR Node %s: UUID checksum missing.\n", mName->mString)); - return FALSE; + return false; } if (node_uuid_checksum != uuid_checksum) { error_buffer.append(llformat("ERROR Node %s: UUID checksum mismatch: read %s / calc %s.\n", mName->mString, node_uuid_checksum.asString().c_str(), uuid_checksum.asString().c_str())); - return FALSE; + return false; } } { U32 node_noderef_checksum = 0; - if (!getAttribute("noderef_checksum", checksum_node, FALSE) || + if (!getAttribute("noderef_checksum", checksum_node, false) || checksum_node->getUnsignedValue(1, &node_noderef_checksum, ENCODING_HEX) != 1) { error_buffer.append(llformat("ERROR Node %s: Node Ref checksum missing.\n", mName->mString)); - return FALSE; + return false; } if (node_noderef_checksum != noderef_checksum) { error_buffer.append(llformat("ERROR Node %s: Node Ref checksum mismatch: read %X / calc %X.\n", mName->mString, node_noderef_checksum, noderef_checksum)); - return FALSE; + return false; } } { U32 node_float_checksum = 0; - if (!getAttribute("float_checksum", checksum_node, FALSE) || + if (!getAttribute("float_checksum", checksum_node, false) || checksum_node->getUnsignedValue(1, &node_float_checksum, ENCODING_HEX) != 1) { error_buffer.append(llformat("ERROR Node %s: Float checksum missing.\n", mName->mString)); - return FALSE; + return false; } if (node_float_checksum != float_checksum) { error_buffer.append(llformat("ERROR Node %s: Float checksum mismatch: read %X / calc %X.\n", mName->mString, node_float_checksum, float_checksum)); - return FALSE; + return false; } } - return TRUE; + return true; } LLXMLNodePtr LLXMLNode::getFirstChild() const diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h index 0b8da5dc5d..21a7dee4cc 100644 --- a/indra/llxml/llxmlnode.h +++ b/indra/llxml/llxmlnode.h @@ -57,9 +57,9 @@ struct CompareAttributes bool operator()(const LLStringTableEntry* const lhs, const LLStringTableEntry* const rhs) const { if (lhs == NULL) - return TRUE; + return true; if (rhs == NULL) - return FALSE; + return true; return strcmp(lhs->mString, rhs->mString) < 0; } @@ -118,14 +118,14 @@ protected: public: LLXMLNode(); - LLXMLNode(const char* name, BOOL is_attribute); - LLXMLNode(LLStringTableEntry* name, BOOL is_attribute); + LLXMLNode(const char* name, bool is_attribute); + LLXMLNode(LLStringTableEntry* name, bool is_attribute); LLXMLNode(const LLXMLNode& rhs); LLXMLNodePtr deepCopy(); - BOOL isNull(); + bool isNull(); - BOOL deleteChild(LLXMLNode* child); + bool deleteChild(LLXMLNode* child); void addChild(LLXMLNodePtr& new_child); void setParent(LLXMLNodePtr& new_parent); // reparent if necessary @@ -165,12 +165,12 @@ public: void findID(const std::string& id, LLXMLNodeList &results); - virtual LLXMLNodePtr createChild(const char* name, BOOL is_attribute); - virtual LLXMLNodePtr createChild(LLStringTableEntry* name, BOOL is_attribute); + virtual LLXMLNodePtr createChild(const char* name, bool is_attribute); + virtual LLXMLNodePtr createChild(LLStringTableEntry* name, bool is_attribute); // Getters - U32 getBoolValue(U32 expected_length, BOOL *array); + U32 getBoolValue(U32 expected_length, bool *array); U32 getByteValue(U32 expected_length, U8 *array, Encoding encoding = ENCODING_DEFAULT); U32 getIntValue(U32 expected_length, S32 *array, Encoding encoding = ENCODING_DEFAULT); U32 getUnsignedValue(U32 expected_length, U32 *array, Encoding encoding = ENCODING_DEFAULT); @@ -181,29 +181,25 @@ public: U32 getUUIDValue(U32 expected_length, LLUUID *array); U32 getNodeRefValue(U32 expected_length, LLXMLNode **array); - BOOL hasAttribute(const char* name ); + bool hasAttribute(const char* name ); - // these are designed to be more generic versions of the functions - // rather than relying on LL-types - bool getAttribute_bool(const char* name, bool& value ); - - BOOL getAttributeBOOL(const char* name, BOOL& value ); - BOOL getAttributeU8(const char* name, U8& value ); - BOOL getAttributeS8(const char* name, S8& value ); - BOOL getAttributeU16(const char* name, U16& value ); - BOOL getAttributeS16(const char* name, S16& value ); - BOOL getAttributeU32(const char* name, U32& value ); - BOOL getAttributeS32(const char* name, S32& value ); - BOOL getAttributeF32(const char* name, F32& value ); - BOOL getAttributeF64(const char* name, F64& value ); - BOOL getAttributeColor(const char* name, LLColor4& value ); - BOOL getAttributeColor4(const char* name, LLColor4& value ); - BOOL getAttributeColor4U(const char* name, LLColor4U& value ); - BOOL getAttributeVector3(const char* name, LLVector3& value ); - BOOL getAttributeVector3d(const char* name, LLVector3d& value ); - BOOL getAttributeQuat(const char* name, LLQuaternion& value ); - BOOL getAttributeUUID(const char* name, LLUUID& value ); - BOOL getAttributeString(const char* name, std::string& value ); + bool getAttributeBOOL(const char* name, bool& value ); + bool getAttributeU8(const char* name, U8& value ); + bool getAttributeS8(const char* name, S8& value ); + bool getAttributeU16(const char* name, U16& value ); + bool getAttributeS16(const char* name, S16& value ); + bool getAttributeU32(const char* name, U32& value ); + bool getAttributeS32(const char* name, S32& value ); + bool getAttributeF32(const char* name, F32& value ); + bool getAttributeF64(const char* name, F64& value ); + bool getAttributeColor(const char* name, LLColor4& value ); + bool getAttributeColor4(const char* name, LLColor4& value ); + bool getAttributeColor4U(const char* name, LLColor4U& value ); + bool getAttributeVector3(const char* name, LLVector3& value ); + bool getAttributeVector3d(const char* name, LLVector3d& value ); + bool getAttributeQuat(const char* name, LLQuaternion& value ); + bool getAttributeUUID(const char* name, LLUUID& value ); + bool getAttributeString(const char* name, std::string& value ); const ValueType& getType() const { return mType; } U32 getLength() const { return mLength; } @@ -212,23 +208,23 @@ public: std::string getSanitizedValue() const; std::string getTextContents() const; const LLStringTableEntry* getName() const { return mName; } - BOOL hasName(const char* name) const { return mName == gStringTable.checkStringEntry(name); } - BOOL hasName(const std::string& name) const { return mName == gStringTable.checkStringEntry(name.c_str()); } + bool hasName(const char* name) const { return mName == gStringTable.checkStringEntry(name); } + bool hasName(const std::string& name) const { return mName == gStringTable.checkStringEntry(name.c_str()); } const std::string& getID() const { return mID; } U32 getChildCount() const; // getChild returns a Null LLXMLNode (not a NULL pointer) if there is no such child. // This child has no value so any getTYPEValue() calls on it will return 0. - bool getChild(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); - bool getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); - void getChildren(const char* name, LLXMLNodeList &children, BOOL use_default_if_missing = TRUE) const; - void getChildren(const LLStringTableEntry* name, LLXMLNodeList &children, BOOL use_default_if_missing = TRUE) const; + bool getChild(const char* name, LLXMLNodePtr& node, bool use_default_if_missing = true); + bool getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, bool use_default_if_missing = true); + void getChildren(const char* name, LLXMLNodeList &children, bool use_default_if_missing = true) const; + void getChildren(const LLStringTableEntry* name, LLXMLNodeList &children, bool use_default_if_missing = true) const; // recursively finds all children at any level matching name void getDescendants(const LLStringTableEntry* name, LLXMLNodeList &children) const; - bool getAttribute(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); - bool getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); + bool getAttribute(const char* name, LLXMLNodePtr& node, bool use_default_if_missing = true); + bool getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, bool use_default_if_missing = true); S32 getLineNumber(); @@ -242,7 +238,7 @@ public: bool setAttributeString(const char* attr, const std::string& value); - void setBoolValue(const BOOL value) { setBoolValue(1, &value); } + void setBoolValue(const bool value) { setBoolValue(1, &value); } void setByteValue(const U8 value, Encoding encoding = ENCODING_DEFAULT) { setByteValue(1, &value, encoding); } void setIntValue(const S32 value, Encoding encoding = ENCODING_DEFAULT) { setIntValue(1, &value, encoding); } void setUnsignedValue(const U32 value, Encoding encoding = ENCODING_DEFAULT) { setUnsignedValue(1, &value, encoding); } @@ -253,7 +249,7 @@ public: void setUUIDValue(const LLUUID value) { setUUIDValue(1, &value); } void setNodeRefValue(const LLXMLNode *value) { setNodeRefValue(1, &value); } - void setBoolValue(U32 length, const BOOL *array); + void setBoolValue(U32 length, const bool *array); void setByteValue(U32 length, const U8 *array, Encoding encoding = ENCODING_DEFAULT); void setIntValue(U32 length, const S32 *array, Encoding encoding = ENCODING_DEFAULT); void setUnsignedValue(U32 length, const U32* array, Encoding encoding = ENCODING_DEFAULT); @@ -283,17 +279,17 @@ public: // Delete any child nodes that aren't among the tree's children, recursive void scrubToTree(LLXMLNode *tree); - BOOL deleteChildren(const std::string& name); - BOOL deleteChildren(LLStringTableEntry* name); + bool deleteChildren(const std::string& name); + bool deleteChildren(LLStringTableEntry* name); void setAttributes(ValueType type, U32 precision, Encoding encoding, U32 length); // void appendValue(const std::string& value); // Unused // Unit Testing void createUnitTest(S32 max_num_children); - BOOL performUnitTest(std::string &error_buffer); + bool performUnitTest(std::string &error_buffer); protected: - BOOL removeChild(LLXMLNode* child); + bool removeChild(LLXMLNode* child); public: std::string mID; // The ID attribute of this node @@ -315,8 +311,8 @@ public: LLXMLNodePtr mPrev; // Double-linked list previous node LLXMLNodePtr mNext; // Double-linked list next node - static BOOL sStripEscapedStrings; - static BOOL sStripWhitespaceValues; + static bool sStripEscapedStrings; + static bool sStripWhitespaceValues; protected: LLStringTableEntry *mName; // The name of this node @@ -330,10 +326,10 @@ protected: static const char *skipWhitespace(const char *str); static const char *skipNonWhitespace(const char *str); - static const char *parseInteger(const char *str, U64 *dest, BOOL *is_negative, U32 precision, Encoding encoding); + static const char *parseInteger(const char *str, U64 *dest, bool *is_negative, U32 precision, Encoding encoding); static const char *parseFloat(const char *str, F64 *dest, U32 precision, Encoding encoding); - BOOL isFullyDefault(); + bool isFullyDefault(); }; #endif // LL_LLXMLNODE diff --git a/indra/llxml/llxmlparser.cpp b/indra/llxml/llxmlparser.cpp index 1bdc283f67..f4116626f6 100644 --- a/indra/llxml/llxmlparser.cpp +++ b/indra/llxml/llxmlparser.cpp @@ -66,17 +66,17 @@ LLXmlParser::~LLXmlParser() } -BOOL LLXmlParser::parseFile(const std::string &path) +bool LLXmlParser::parseFile(const std::string &path) { llassert( !mDepth ); - BOOL success = TRUE; + bool success = true; LLFILE* file = LLFile::fopen(path, "rb"); /* Flawfinder: ignore */ if( !file ) { mAuxErrorString = llformat( "Couldn't open file %s", path.c_str()); - success = FALSE; + success = false; } else { @@ -90,7 +90,7 @@ BOOL LLXmlParser::parseFile(const std::string &path) if( !buffer ) { mAuxErrorString = llformat( "Unable to allocate XML buffer while reading file %s", path.c_str() ); - success = FALSE; + success = false; goto exit_label; } @@ -98,14 +98,14 @@ BOOL LLXmlParser::parseFile(const std::string &path) if( bytes_read <= 0 ) { mAuxErrorString = llformat( "Error while reading file %s", path.c_str() ); - success = FALSE; + success = false; goto exit_label; } - if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) ) + if( !XML_ParseBuffer(mParser, bytes_read, true ) ) { mAuxErrorString = llformat( "Error while parsing file %s", path.c_str() ); - success = FALSE; + success = false; } exit_label: diff --git a/indra/llxml/llxmlparser.h b/indra/llxml/llxmlparser.h index a5b210404f..c5025ef450 100644 --- a/indra/llxml/llxmlparser.h +++ b/indra/llxml/llxmlparser.h @@ -43,7 +43,7 @@ public: virtual ~LLXmlParser(); // Parses entire file - BOOL parseFile(const std::string &path); + bool parseFile(const std::string &path); // Parses some input. Returns 0 if a fatal error is detected. // The last call must have isFinal true; diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp index 4991e99a96..be3bcf2a66 100644 --- a/indra/llxml/llxmltree.cpp +++ b/indra/llxml/llxmltree.cpp @@ -61,13 +61,13 @@ void LLXmlTree::cleanup() } -BOOL LLXmlTree::parseFile(const std::string &path, BOOL keep_contents) +bool LLXmlTree::parseFile(const std::string &path, bool keep_contents) { delete mRoot; mRoot = NULL; LLXmlTreeParser parser(this); - BOOL success = parser.parseFile( path, &mRoot, keep_contents ); + bool success = parser.parseFile( path, &mRoot, keep_contents ); if( !success ) { S32 line_number = parser.getCurrentLineNumber(); @@ -135,7 +135,7 @@ void LLXmlTreeNode::dump( const std::string& prefix ) LL_CONT << LL_ENDL; } -BOOL LLXmlTreeNode::hasAttribute(const std::string& name) +bool LLXmlTreeNode::hasAttribute(const std::string& name) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); attribute_map_t::iterator iter = mAttributes.find(canonical_name); @@ -205,106 +205,106 @@ bool LLXmlTreeNode::getFastAttributeBOOL(LLStdStringHandle canonical_name, bool& return s && LLStringUtil::convertToBOOL( *s, value ); } -BOOL LLXmlTreeNode::getFastAttributeU8(LLStdStringHandle canonical_name, U8& value) +bool LLXmlTreeNode::getFastAttributeU8(LLStdStringHandle canonical_name, U8& value) { const std::string *s = getAttribute( canonical_name ); return s && LLStringUtil::convertToU8( *s, value ); } -BOOL LLXmlTreeNode::getFastAttributeS8(LLStdStringHandle canonical_name, S8& value) +bool LLXmlTreeNode::getFastAttributeS8(LLStdStringHandle canonical_name, S8& value) { const std::string *s = getAttribute( canonical_name ); return s && LLStringUtil::convertToS8( *s, value ); } -BOOL LLXmlTreeNode::getFastAttributeS16(LLStdStringHandle canonical_name, S16& value) +bool LLXmlTreeNode::getFastAttributeS16(LLStdStringHandle canonical_name, S16& value) { const std::string *s = getAttribute( canonical_name ); return s && LLStringUtil::convertToS16( *s, value ); } -BOOL LLXmlTreeNode::getFastAttributeU16(LLStdStringHandle canonical_name, U16& value) +bool LLXmlTreeNode::getFastAttributeU16(LLStdStringHandle canonical_name, U16& value) { const std::string *s = getAttribute( canonical_name ); return s && LLStringUtil::convertToU16( *s, value ); } -BOOL LLXmlTreeNode::getFastAttributeU32(LLStdStringHandle canonical_name, U32& value) +bool LLXmlTreeNode::getFastAttributeU32(LLStdStringHandle canonical_name, U32& value) { const std::string *s = getAttribute( canonical_name ); return s && LLStringUtil::convertToU32( *s, value ); } -BOOL LLXmlTreeNode::getFastAttributeS32(LLStdStringHandle canonical_name, S32& value) +bool LLXmlTreeNode::getFastAttributeS32(LLStdStringHandle canonical_name, S32& value) { const std::string *s = getAttribute( canonical_name ); return s && LLStringUtil::convertToS32( *s, value ); } -BOOL LLXmlTreeNode::getFastAttributeF32(LLStdStringHandle canonical_name, F32& value) +bool LLXmlTreeNode::getFastAttributeF32(LLStdStringHandle canonical_name, F32& value) { const std::string *s = getAttribute( canonical_name ); return s && LLStringUtil::convertToF32( *s, value ); } -BOOL LLXmlTreeNode::getFastAttributeF64(LLStdStringHandle canonical_name, F64& value) +bool LLXmlTreeNode::getFastAttributeF64(LLStdStringHandle canonical_name, F64& value) { const std::string *s = getAttribute( canonical_name ); return s && LLStringUtil::convertToF64( *s, value ); } -BOOL LLXmlTreeNode::getFastAttributeColor(LLStdStringHandle canonical_name, LLColor4& value) +bool LLXmlTreeNode::getFastAttributeColor(LLStdStringHandle canonical_name, LLColor4& value) { const std::string *s = getAttribute( canonical_name ); - return s ? LLColor4::parseColor(*s, &value) : FALSE; + return s ? LLColor4::parseColor(*s, &value) : false; } -BOOL LLXmlTreeNode::getFastAttributeColor4(LLStdStringHandle canonical_name, LLColor4& value) +bool LLXmlTreeNode::getFastAttributeColor4(LLStdStringHandle canonical_name, LLColor4& value) { const std::string *s = getAttribute( canonical_name ); - return s ? LLColor4::parseColor4(*s, &value) : FALSE; + return s ? LLColor4::parseColor4(*s, &value) : false; } -BOOL LLXmlTreeNode::getFastAttributeColor4U(LLStdStringHandle canonical_name, LLColor4U& value) +bool LLXmlTreeNode::getFastAttributeColor4U(LLStdStringHandle canonical_name, LLColor4U& value) { const std::string *s = getAttribute( canonical_name ); - return s ? LLColor4U::parseColor4U(*s, &value ) : FALSE; + return s ? LLColor4U::parseColor4U(*s, &value ) : false; } -BOOL LLXmlTreeNode::getFastAttributeVector3(LLStdStringHandle canonical_name, LLVector3& value) +bool LLXmlTreeNode::getFastAttributeVector3(LLStdStringHandle canonical_name, LLVector3& value) { const std::string *s = getAttribute( canonical_name ); - return s ? LLVector3::parseVector3(*s, &value ) : FALSE; + return s ? LLVector3::parseVector3(*s, &value ) : false; } -BOOL LLXmlTreeNode::getFastAttributeVector3d(LLStdStringHandle canonical_name, LLVector3d& value) +bool LLXmlTreeNode::getFastAttributeVector3d(LLStdStringHandle canonical_name, LLVector3d& value) { const std::string *s = getAttribute( canonical_name ); - return s ? LLVector3d::parseVector3d(*s, &value ) : FALSE; + return s ? LLVector3d::parseVector3d(*s, &value ) : false; } -BOOL LLXmlTreeNode::getFastAttributeQuat(LLStdStringHandle canonical_name, LLQuaternion& value) +bool LLXmlTreeNode::getFastAttributeQuat(LLStdStringHandle canonical_name, LLQuaternion& value) { const std::string *s = getAttribute( canonical_name ); - return s ? LLQuaternion::parseQuat(*s, &value ) : FALSE; + return s ? LLQuaternion::parseQuat(*s, &value ) : false; } -BOOL LLXmlTreeNode::getFastAttributeUUID(LLStdStringHandle canonical_name, LLUUID& value) +bool LLXmlTreeNode::getFastAttributeUUID(LLStdStringHandle canonical_name, LLUUID& value) { const std::string *s = getAttribute( canonical_name ); - return s ? LLUUID::parseUUID(*s, &value ) : FALSE; + return s ? LLUUID::parseUUID(*s, &value ) : false; } -BOOL LLXmlTreeNode::getFastAttributeString(LLStdStringHandle canonical_name, std::string& value) +bool LLXmlTreeNode::getFastAttributeString(LLStdStringHandle canonical_name, std::string& value) { const std::string *s = getAttribute( canonical_name ); if( !s ) { - return FALSE; + return false; } value = *s; - return TRUE; + return true; } @@ -316,97 +316,97 @@ bool LLXmlTreeNode::getAttributeBOOL(const std::string& name, bool& value) return getFastAttributeBOOL(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeU8(const std::string& name, U8& value) +bool LLXmlTreeNode::getAttributeU8(const std::string& name, U8& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeU8(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeS8(const std::string& name, S8& value) +bool LLXmlTreeNode::getAttributeS8(const std::string& name, S8& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeS8(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeS16(const std::string& name, S16& value) +bool LLXmlTreeNode::getAttributeS16(const std::string& name, S16& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeS16(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeU16(const std::string& name, U16& value) +bool LLXmlTreeNode::getAttributeU16(const std::string& name, U16& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeU16(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeU32(const std::string& name, U32& value) +bool LLXmlTreeNode::getAttributeU32(const std::string& name, U32& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeU32(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeS32(const std::string& name, S32& value) +bool LLXmlTreeNode::getAttributeS32(const std::string& name, S32& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeS32(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeF32(const std::string& name, F32& value) +bool LLXmlTreeNode::getAttributeF32(const std::string& name, F32& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeF32(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeF64(const std::string& name, F64& value) +bool LLXmlTreeNode::getAttributeF64(const std::string& name, F64& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeF64(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeColor(const std::string& name, LLColor4& value) +bool LLXmlTreeNode::getAttributeColor(const std::string& name, LLColor4& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeColor(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeColor4(const std::string& name, LLColor4& value) +bool LLXmlTreeNode::getAttributeColor4(const std::string& name, LLColor4& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeColor4(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeColor4U(const std::string& name, LLColor4U& value) +bool LLXmlTreeNode::getAttributeColor4U(const std::string& name, LLColor4U& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeColor4U(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeVector3(const std::string& name, LLVector3& value) +bool LLXmlTreeNode::getAttributeVector3(const std::string& name, LLVector3& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeVector3(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeVector3d(const std::string& name, LLVector3d& value) +bool LLXmlTreeNode::getAttributeVector3d(const std::string& name, LLVector3d& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeVector3d(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeQuat(const std::string& name, LLQuaternion& value) +bool LLXmlTreeNode::getAttributeQuat(const std::string& name, LLQuaternion& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeQuat(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeUUID(const std::string& name, LLUUID& value) +bool LLXmlTreeNode::getAttributeUUID(const std::string& name, LLUUID& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeUUID(canonical_name, value); } -BOOL LLXmlTreeNode::getAttributeString(const std::string& name, std::string& value) +bool LLXmlTreeNode::getAttributeString(const std::string& name, std::string& value) { LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); return getFastAttributeString(canonical_name, value); @@ -506,8 +506,8 @@ LLXmlTreeParser::LLXmlTreeParser(LLXmlTree* tree) : mTree(tree), mRoot( NULL ), mCurrent( NULL ), - mDump( FALSE ), - mKeepContents(FALSE) + mDump( false ), + mKeepContents(false) { } @@ -515,14 +515,14 @@ LLXmlTreeParser::~LLXmlTreeParser() { } -BOOL LLXmlTreeParser::parseFile(const std::string &path, LLXmlTreeNode** root, BOOL keep_contents) +bool LLXmlTreeParser::parseFile(const std::string &path, LLXmlTreeNode** root, bool keep_contents) { llassert( !mRoot ); llassert( !mCurrent ); mKeepContents = keep_contents; - BOOL success = LLXmlParser::parseFile(path); + bool success = LLXmlParser::parseFile(path); *root = mRoot; mRoot = NULL; @@ -685,7 +685,7 @@ void LLXmlTreeParser::unparsedEntityDecl( void test_llxmltree() { LLXmlTree tree; - BOOL success = tree.parseFile( "test.xml" ); + bool success = tree.parseFile( "test.xml" ); if( success ) { tree.dump(); diff --git a/indra/llxml/llxmltree.h b/indra/llxml/llxmltree.h index 5d33e2c660..5d15c4c7f5 100644 --- a/indra/llxml/llxmltree.h +++ b/indra/llxml/llxmltree.h @@ -55,7 +55,7 @@ public: virtual ~LLXmlTree(); void cleanup(); - virtual BOOL parseFile(const std::string &path, BOOL keep_contents = TRUE); + virtual bool parseFile(const std::string &path, bool keep_contents = true); LLXmlTreeNode* getRoot() { return mRoot; } @@ -97,50 +97,50 @@ public: { return mName; } - BOOL hasName( const std::string& name ) + bool hasName( const std::string& name ) { return mName == name; } - BOOL hasAttribute( const std::string& name ); + bool hasAttribute( const std::string& name ); // Fast versions use cannonical_name handlee to entru in LLXmlTree::sAttributeKeys string table bool getFastAttributeBOOL( LLStdStringHandle cannonical_name, bool& value ); - BOOL getFastAttributeU8( LLStdStringHandle cannonical_name, U8& value ); - BOOL getFastAttributeS8( LLStdStringHandle cannonical_name, S8& value ); - BOOL getFastAttributeU16( LLStdStringHandle cannonical_name, U16& value ); - BOOL getFastAttributeS16( LLStdStringHandle cannonical_name, S16& value ); - BOOL getFastAttributeU32( LLStdStringHandle cannonical_name, U32& value ); - BOOL getFastAttributeS32( LLStdStringHandle cannonical_name, S32& value ); - BOOL getFastAttributeF32( LLStdStringHandle cannonical_name, F32& value ); - BOOL getFastAttributeF64( LLStdStringHandle cannonical_name, F64& value ); - BOOL getFastAttributeColor( LLStdStringHandle cannonical_name, LLColor4& value ); - BOOL getFastAttributeColor4( LLStdStringHandle cannonical_name, LLColor4& value ); - BOOL getFastAttributeColor4U( LLStdStringHandle cannonical_name, LLColor4U& value ); - BOOL getFastAttributeVector3( LLStdStringHandle cannonical_name, LLVector3& value ); - BOOL getFastAttributeVector3d( LLStdStringHandle cannonical_name, LLVector3d& value ); - BOOL getFastAttributeQuat( LLStdStringHandle cannonical_name, LLQuaternion& value ); - BOOL getFastAttributeUUID( LLStdStringHandle cannonical_name, LLUUID& value ); - BOOL getFastAttributeString( LLStdStringHandle cannonical_name, std::string& value ); + bool getFastAttributeU8( LLStdStringHandle cannonical_name, U8& value ); + bool getFastAttributeS8( LLStdStringHandle cannonical_name, S8& value ); + bool getFastAttributeU16( LLStdStringHandle cannonical_name, U16& value ); + bool getFastAttributeS16( LLStdStringHandle cannonical_name, S16& value ); + bool getFastAttributeU32( LLStdStringHandle cannonical_name, U32& value ); + bool getFastAttributeS32( LLStdStringHandle cannonical_name, S32& value ); + bool getFastAttributeF32( LLStdStringHandle cannonical_name, F32& value ); + bool getFastAttributeF64( LLStdStringHandle cannonical_name, F64& value ); + bool getFastAttributeColor( LLStdStringHandle cannonical_name, LLColor4& value ); + bool getFastAttributeColor4( LLStdStringHandle cannonical_name, LLColor4& value ); + bool getFastAttributeColor4U( LLStdStringHandle cannonical_name, LLColor4U& value ); + bool getFastAttributeVector3( LLStdStringHandle cannonical_name, LLVector3& value ); + bool getFastAttributeVector3d( LLStdStringHandle cannonical_name, LLVector3d& value ); + bool getFastAttributeQuat( LLStdStringHandle cannonical_name, LLQuaternion& value ); + bool getFastAttributeUUID( LLStdStringHandle cannonical_name, LLUUID& value ); + bool getFastAttributeString( LLStdStringHandle cannonical_name, std::string& value ); // Normal versions find 'name' in LLXmlTree::sAttributeKeys then call fast versions virtual bool getAttributeBOOL( const std::string& name, bool& value ); - virtual BOOL getAttributeU8( const std::string& name, U8& value ); - virtual BOOL getAttributeS8( const std::string& name, S8& value ); - virtual BOOL getAttributeU16( const std::string& name, U16& value ); - virtual BOOL getAttributeS16( const std::string& name, S16& value ); - virtual BOOL getAttributeU32( const std::string& name, U32& value ); - virtual BOOL getAttributeS32( const std::string& name, S32& value ); - virtual BOOL getAttributeF32( const std::string& name, F32& value ); - virtual BOOL getAttributeF64( const std::string& name, F64& value ); - virtual BOOL getAttributeColor( const std::string& name, LLColor4& value ); - virtual BOOL getAttributeColor4( const std::string& name, LLColor4& value ); - virtual BOOL getAttributeColor4U( const std::string& name, LLColor4U& value ); - virtual BOOL getAttributeVector3( const std::string& name, LLVector3& value ); - virtual BOOL getAttributeVector3d( const std::string& name, LLVector3d& value ); - virtual BOOL getAttributeQuat( const std::string& name, LLQuaternion& value ); - virtual BOOL getAttributeUUID( const std::string& name, LLUUID& value ); - virtual BOOL getAttributeString( const std::string& name, std::string& value ); + virtual bool getAttributeU8( const std::string& name, U8& value ); + virtual bool getAttributeS8( const std::string& name, S8& value ); + virtual bool getAttributeU16( const std::string& name, U16& value ); + virtual bool getAttributeS16( const std::string& name, S16& value ); + virtual bool getAttributeU32( const std::string& name, U32& value ); + virtual bool getAttributeS32( const std::string& name, S32& value ); + virtual bool getAttributeF32( const std::string& name, F32& value ); + virtual bool getAttributeF64( const std::string& name, F64& value ); + virtual bool getAttributeColor( const std::string& name, LLColor4& value ); + virtual bool getAttributeColor4( const std::string& name, LLColor4& value ); + virtual bool getAttributeColor4U( const std::string& name, LLColor4U& value ); + virtual bool getAttributeVector3( const std::string& name, LLVector3& value ); + virtual bool getAttributeVector3d( const std::string& name, LLVector3d& value ); + virtual bool getAttributeQuat( const std::string& name, LLQuaternion& value ); + virtual bool getAttributeUUID( const std::string& name, LLUUID& value ); + virtual bool getAttributeString( const std::string& name, std::string& value ); const std::string& getContents() { @@ -199,7 +199,7 @@ public: LLXmlTreeParser(LLXmlTree* tree); virtual ~LLXmlTreeParser(); - BOOL parseFile(const std::string &path, LLXmlTreeNode** root, BOOL keep_contents ); + bool parseFile(const std::string &path, LLXmlTreeNode** root, bool keep_contents ); protected: const std::string& tabs(); @@ -227,8 +227,8 @@ protected: LLXmlTree* mTree; LLXmlTreeNode* mRoot; LLXmlTreeNode* mCurrent; - BOOL mDump; // Dump parse tree to LL_INFOS() as it is read. - BOOL mKeepContents; + bool mDump; // Dump parse tree to LL_INFOS() as it is read. + bool mKeepContents; }; #endif // LL_LLXMLTREE_H diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 405432fe90..4a66bef86e 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -56,7 +56,7 @@ LLAgentWearables gAgentWearables; -BOOL LLAgentWearables::mInitialWearablesUpdateReceived = FALSE; +bool LLAgentWearables::mInitialWearablesUpdateReceived = false; using namespace LLAvatarAppearanceDefines; @@ -194,7 +194,7 @@ struct LLAgentDumper LLAgentWearables::LLAgentWearables() : LLWearableData(), - mWearablesLoaded(FALSE) + mWearablesLoaded(false) , mCOFChangeInProgress(false) { } @@ -375,7 +375,7 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, const std::string& description, - BOOL save_in_lost_and_found) + bool save_in_lost_and_found) { if (!isWearableCopyable(type, index)) { @@ -493,13 +493,13 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& } -BOOL LLAgentWearables::isWearableModifiable(LLWearableType::EType type, U32 index) const +bool LLAgentWearables::isWearableModifiable(LLWearableType::EType type, U32 index) const { LLUUID item_id = getWearableItemID(type, index); - return item_id.notNull() ? isWearableModifiable(item_id) : FALSE; + return item_id.notNull() ? isWearableModifiable(item_id) : false; } -BOOL LLAgentWearables::isWearableModifiable(const LLUUID& item_id) const +bool LLAgentWearables::isWearableModifiable(const LLUUID& item_id) const { const LLUUID& linked_id = gInventory.getLinkedItemID(item_id); if (linked_id.notNull()) @@ -508,13 +508,13 @@ BOOL LLAgentWearables::isWearableModifiable(const LLUUID& item_id) const if (item && item->getPermissions().allowModifyBy(gAgent.getID(), gAgent.getGroupID())) { - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL LLAgentWearables::isWearableCopyable(LLWearableType::EType type, U32 index) const +bool LLAgentWearables::isWearableCopyable(LLWearableType::EType type, U32 index) const { LLUUID item_id = getWearableItemID(type, index); if (!item_id.isNull()) @@ -523,28 +523,12 @@ BOOL LLAgentWearables::isWearableCopyable(LLWearableType::EType type, U32 index) if (item && item->getPermissions().allowCopyBy(gAgent.getID(), gAgent.getGroupID())) { - return TRUE; + return true; } } - return FALSE; + return false; } -/* - U32 LLAgentWearables::getWearablePermMask(LLWearableType::EType type) - { - LLUUID item_id = getWearableItemID(type); - if (!item_id.isNull()) - { - LLInventoryItem* item = gInventory.getItem(item_id); - if (item) - { - return item->getPermissions().getMaskOwner(); - } - } - return PERM_NONE; - } -*/ - LLInventoryItem* LLAgentWearables::getWearableInventoryItem(LLWearableType::EType type, U32 index) { LLUUID item_id = getWearableItemID(type,index); @@ -617,7 +601,7 @@ const LLViewerWearable* LLAgentWearables::getViewerWearable(const LLWearableType } // static -BOOL LLAgentWearables::selfHasWearable(LLWearableType::EType type) +bool LLAgentWearables::selfHasWearable(LLWearableType::EType type) { return (gAgentWearables.getWearableCount(type) > 0); } @@ -675,9 +659,9 @@ const LLUUID LLAgentWearables::getWearableAssetID(LLWearableType::EType type, U3 return LLUUID(); } -BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const +bool LLAgentWearables::isWearingItem(const LLUUID& item_id) const { - return getWearableFromItemID(item_id) != NULL; + return getWearableFromItemID(item_id) != nullptr; } void LLAgentWearables::addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index) @@ -772,21 +756,21 @@ void LLAgentWearables::createStandardWearables() if (!isAgentAvatarValid()) return; - const BOOL create[LLWearableType::WT_COUNT] = + constexpr bool create[LLWearableType::WT_COUNT] = { - TRUE, //LLWearableType::WT_SHAPE - TRUE, //LLWearableType::WT_SKIN - TRUE, //LLWearableType::WT_HAIR - TRUE, //LLWearableType::WT_EYES - TRUE, //LLWearableType::WT_SHIRT - TRUE, //LLWearableType::WT_PANTS - TRUE, //LLWearableType::WT_SHOES - TRUE, //LLWearableType::WT_SOCKS - FALSE, //LLWearableType::WT_JACKET - FALSE, //LLWearableType::WT_GLOVES - TRUE, //LLWearableType::WT_UNDERSHIRT - TRUE, //LLWearableType::WT_UNDERPANTS - FALSE //LLWearableType::WT_SKIRT + true, //LLWearableType::WT_SHAPE + true, //LLWearableType::WT_SKIN + true, //LLWearableType::WT_HAIR + true, //LLWearableType::WT_EYES + true, //LLWearableType::WT_SHIRT + true, //LLWearableType::WT_PANTS + true, //LLWearableType::WT_SHOES + true, //LLWearableType::WT_SOCKS + false, //LLWearableType::WT_JACKET + false, //LLWearableType::WT_GLOVES + true, //LLWearableType::WT_UNDERSHIRT + true, //LLWearableType::WT_UNDERPANTS + false //LLWearableType::WT_SKIRT }; LLPointer cb = new OnWearableItemCreatedCB; @@ -865,7 +849,7 @@ void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) void LLAgentWearables::addWearableToAgentInventory(LLPointer cb, LLViewerWearable* wearable, const LLUUID& category_id, - BOOL notify) + bool notify) { create_inventory_wearable(gAgent.getID(), gAgent.getSessionID(), @@ -987,7 +971,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it S32 matched = 0, mismatched = 0; const S32 arr_size = LLWearableType::WT_COUNT; S32 type_counts[arr_size]; - BOOL update_inventory = FALSE; + bool update_inventory{ false }; std::fill(type_counts,type_counts+arr_size,0); for (S32 i = 0; i < count; i++) { @@ -1025,7 +1009,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it << curr_wearable->getName() << " vs " << new_item->getName() << " item ids " << curr_wearable->getItemID() << " vs " << new_item->getUUID() << LL_ENDL; - update_inventory = TRUE; + update_inventory = true; continue; } // If we got here, everything matches. @@ -1092,7 +1076,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it pushWearable(type,new_wearable); } - const BOOL removed = FALSE; + constexpr bool removed = false; wearableUpdated(new_wearable, removed); } } @@ -1110,7 +1094,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it if (isAgentAvatarValid()) { - gAgentAvatarp->setCompositeUpdatesEnabled(TRUE); + gAgentAvatarp->setCompositeUpdatesEnabled(true); // If we have not yet declouded, we may want to use // baked texture UUIDs sent from the first objectUpdate message @@ -1124,7 +1108,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it } // Start rendering & update the server - mWearablesLoaded = TRUE; + mWearablesLoaded = true; notifyLoadingFinished(); @@ -1434,7 +1418,7 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra ++it) { const LLInventoryItem* item = *it; - LLAttachmentsMgr::instance().addAttachmentRequest(item->getLinkedUUID(), 0, TRUE); + LLAttachmentsMgr::instance().addAttachmentRequest(item->getLinkedUUID(), 0, true); } } @@ -1452,7 +1436,7 @@ bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_bod return wearable != marginal_wearable; } -BOOL LLAgentWearables::areWearablesLoaded() const +bool LLAgentWearables::areWearablesLoaded() const { return mWearablesLoaded; } @@ -1620,7 +1604,7 @@ void LLAgentWearables::editWearable(const LLUUID& item_id) return; } - const BOOL disable_camera_switch = LLWearableType::getInstance()->getDisableCameraSwitch(wearable->getType()); + const bool disable_camera_switch = LLWearableType::getInstance()->getDisableCameraSwitch(wearable->getType()); LLPanel* panel = LLFloaterSidePanelContainer::getPanel("appearance"); LLSidepanelAppearance::editWearable(wearable, panel, disable_camera_switch); } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 2a888573d6..bb7837acf8 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -66,16 +66,14 @@ public: // Queries //-------------------------------------------------------------------- public: - BOOL isWearingItem(const LLUUID& item_id) const; - BOOL isWearableModifiable(LLWearableType::EType type, U32 index /*= 0*/) const; - BOOL isWearableModifiable(const LLUUID& item_id) const; + bool isWearingItem(const LLUUID& item_id) const; + bool isWearableModifiable(LLWearableType::EType type, U32 index /*= 0*/) const; + bool isWearableModifiable(const LLUUID& item_id) const; - BOOL isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const; - BOOL areWearablesLoaded() const; + bool isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const; + bool areWearablesLoaded() const; bool isCOFChangeInProgress() const { return mCOFChangeInProgress; } F32 getCOFChangeTime() const { return mCOFChangeTimer.getElapsedTimeF32(); } - void updateWearablesLoaded(); - void checkWearablesLoaded() const; bool canMoveWearable(const LLUUID& item_id, bool closer_to_body) const; // Note: False for shape, skin, eyes, and hair, unless you have MORE than 1. @@ -95,7 +93,7 @@ public: LLViewerWearable* getViewerWearable(const LLWearableType::EType type, U32 index /*= 0*/); const LLViewerWearable* getViewerWearable(const LLWearableType::EType type, U32 index /*= 0*/) const; LLInventoryItem* getWearableInventoryItem(LLWearableType::EType type, U32 index /*= 0*/); - static BOOL selfHasWearable(LLWearableType::EType type); + static bool selfHasWearable(LLWearableType::EType type); //-------------------------------------------------------------------- // Setters @@ -116,20 +114,18 @@ protected: void addWearableToAgentInventory(LLPointer cb, LLViewerWearable* wearable, const LLUUID& category_id = LLUUID::null, - BOOL notify = TRUE); + bool notify = true); void addWearabletoAgentInventoryDone(const LLWearableType::EType type, const U32 index, const LLUUID& item_id, LLViewerWearable* wearable); - void recoverMissingWearable(const LLWearableType::EType type, U32 index /*= 0*/); - void recoverMissingWearableDone(); //-------------------------------------------------------------------- // Editing/moving wearables //-------------------------------------------------------------------- public: - static void createWearable(LLWearableType::EType type, bool wear = false, const LLUUID& parent_id = LLUUID::null, std::function created_cb = NULL); + static void createWearable(LLWearableType::EType type, bool wear = false, const LLUUID& parent_id = LLUUID::null, std::function created_cb = nullptr); static void editWearable(const LLUUID& item_id); bool moveWearable(const LLViewerInventoryItem* item, bool closer_to_body); @@ -159,7 +155,7 @@ private: // Save Wearables //-------------------------------------------------------------------- public: - void saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, const std::string& description, BOOL save_in_lost_and_found); + void saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, const std::string& description, bool save_in_lost_and_found); void saveWearable(const LLWearableType::EType type, const U32 index, const std::string new_name = ""); void saveAllWearables(); @@ -212,13 +208,13 @@ private: // Member variables //-------------------------------------------------------------------- private: - static BOOL mInitialWearablesUpdateReceived; - BOOL mWearablesLoaded; + static bool mInitialWearablesUpdateReceived; + bool mWearablesLoaded; /** * True if agent's outfit is being changed now. */ - BOOL mCOFChangeInProgress; + bool mCOFChangeInProgress; LLTimer mCOFChangeTimer; //-------------------------------------------------------------------------------- diff --git a/indra/newview/llmimetypes.cpp b/indra/newview/llmimetypes.cpp index 790a184068..d374263c49 100644 --- a/indra/newview/llmimetypes.cpp +++ b/indra/newview/llmimetypes.cpp @@ -131,15 +131,15 @@ bool LLMIMETypes::parseMIMETypes(const std::string& xml_filename) } if (child->hasName("allow_resize")) { - BOOL allow_resize = FALSE; + bool allow_resize = false; child->getBoolValue( 1, &allow_resize ); - info.mAllowResize = (bool)allow_resize; + info.mAllowResize = allow_resize; } if (child->hasName("allow_looping")) { - BOOL allow_looping = FALSE; + bool allow_looping = false; child->getBoolValue( 1, &allow_looping ); - info.mAllowLooping = (bool)allow_looping; + info.mAllowLooping = allow_looping; } } sWidgetMap[set_name] = info; diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index 22d70d482b..08b47d9df3 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -38,7 +38,7 @@ #include "llvoavatar.h" #include "pipeline.h" -static const S32 MIN_PIXEL_AREA_3PASS_HAIR = 64*64; +static constexpr S32 MIN_PIXEL_AREA_3PASS_HAIR = 64*64; //----------------------------------------------------------------------------- // LLViewerJoint() diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index eed482b598..7e99844717 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -45,19 +45,19 @@ #include "llglheaders.h" extern LLPipeline gPipeline; -const F32 MAX_ATTACHMENT_DIST = 3.5f; // meters +constexpr F32 MAX_ATTACHMENT_DIST = 3.5f; // meters //----------------------------------------------------------------------------- // LLViewerJointAttachment() //----------------------------------------------------------------------------- LLViewerJointAttachment::LLViewerJointAttachment() : - mVisibleInFirst(FALSE), + mVisibleInFirst(false), mGroup(0), - mIsHUDAttachment(FALSE), + mIsHUDAttachment(false), mPieSlice(-1) { - mValid = FALSE; - mUpdateXform = FALSE; + mValid = false; + mUpdateXform = false; mAttachedObjects.clear(); } @@ -236,7 +236,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object) } // force object visibile - setAttachmentVisibility(TRUE); + setAttachmentVisibility(true); mAttachedObjects.erase(iter); if (object->mDrawable.notNull()) @@ -309,7 +309,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object) } if (mAttachedObjects.size() == 0) { - mUpdateXform = FALSE; + mUpdateXform = false; } object->setAttachmentItemID(LLUUID::null); } @@ -426,11 +426,11 @@ void LLViewerJointAttachment::calcLOD() //----------------------------------------------------------------------------- bool LLViewerJointAttachment::updateLOD(F32 pixel_area, bool activate) { - BOOL res = FALSE; + bool res{ false }; if (!mValid) { - setValid(TRUE, TRUE); - res = TRUE; + setValid(true, true); + res = true; } return res; } @@ -462,7 +462,7 @@ const LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &o return attached_object; } } - return NULL; + return nullptr; } LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &object_id) @@ -477,5 +477,5 @@ LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &object_ return attached_object; } } - return NULL; + return nullptr; } diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h index 883df5b2c4..c470ad783f 100644 --- a/indra/newview/llviewerjointattachment.h +++ b/indra/newview/llviewerjointattachment.h @@ -47,17 +47,15 @@ public: LLViewerJointAttachment(); virtual ~LLViewerJointAttachment(); - //virtual U32 render( F32 pixelArea ); // Returns triangle count - // Returns true if this object is transparent. // This is used to determine in which order to draw objects. - /*virtual*/ bool isTransparent(); + bool isTransparent() override; // Draws the shape attached to a joint. // Called by render(). - /*virtual*/ U32 drawShape( F32 pixelArea, bool first_pass, bool is_dummy ); + U32 drawShape( F32 pixelArea, bool first_pass, bool is_dummy ) override; - /*virtual*/ bool updateLOD(F32 pixel_area, bool activate); + bool updateLOD(F32 pixel_area, bool activate) override; // // accessors @@ -65,7 +63,7 @@ public: void setPieSlice(S32 pie_slice) { mPieSlice = pie_slice; } void setVisibleInFirstPerson(bool visibility) { mVisibleInFirst = visibility; } - BOOL getVisibleInFirstPerson() const { return mVisibleInFirst; } + bool getVisibleInFirstPerson() const { return mVisibleInFirst; } void setGroup(S32 group) { mGroup = group; } void setOriginalPosition(LLVector3 &position); void setAttachmentVisibility(bool visible); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index fd45bc37b2..ef1ec357fb 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -108,7 +108,7 @@ void LLViewerJointMesh::uploadJointMatrices() S32 joint_num; LLPolyMesh *reference_mesh = mMesh->getReferenceMesh(); LLDrawPool *poolp = mFace ? mFace->getPool() : NULL; - BOOL hardware_skinning = (poolp && poolp->getShaderLevel() > 0) ? TRUE : FALSE; + bool hardware_skinning = (poolp && poolp->getShaderLevel() > 0); //calculate joint matrices for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.size(); joint_num++) @@ -123,7 +123,7 @@ void LLViewerJointMesh::uploadJointMatrices() gJointRotUnaligned[joint_num] = joint_mat.getMat3(); } - BOOL last_pivot_uploaded = FALSE; + bool last_pivot_uploaded{ false }; S32 j = 0; //upload joint pivots @@ -144,11 +144,11 @@ void LLViewerJointMesh::uploadJointMatrices() gJointPivot[j++] = child_pivot; - last_pivot_uploaded = TRUE; + last_pivot_uploaded = true; } else { - last_pivot_uploaded = FALSE; + last_pivot_uploaded = false; } } @@ -358,7 +358,7 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, bool damp_w } LLDrawPool *poolp = mFace->getPool(); - BOOL hardware_skinning = (poolp && poolp->getShaderLevel() > 0) ? TRUE : FALSE; + bool hardware_skinning = (poolp && poolp->getShaderLevel() > 0); if (!hardware_skinning && terse_update) { //no need to do terse updates if we're doing software vertex skinning diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index c7f2b1bbac..1b4fa397ac 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -54,19 +54,19 @@ public: void uploadJointMatrices(); // overloaded from base class - /*virtual*/ U32 drawShape( F32 pixelArea, bool first_pass, bool is_dummy ); + U32 drawShape( F32 pixelArea, bool first_pass, bool is_dummy ) override; // necessary because MS's compiler warns on function inheritance via dominance in the diamond inheritance here. // warns even though LLViewerJoint holds the only non virtual implementation. - /*virtual*/ U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) { return LLViewerJoint::render(pixelArea,first_pass,is_dummy);} + U32 render(F32 pixelArea, bool first_pass = true, bool is_dummy = false) override { return LLViewerJoint::render(pixelArea, first_pass, is_dummy); } - /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); - /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind = false, bool terse_update = false); - /*virtual*/ bool updateLOD(F32 pixel_area, bool activate); - /*virtual*/ void updateJointGeometry(); - /*virtual*/ void dump(); + void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area) override; + void updateFaceData(LLFace *face, F32 pixel_area, bool damp_wind = false, bool terse_update = false) override; + bool updateLOD(F32 pixel_area, bool activate) override; + void updateJointGeometry() override; + void dump() override; - /*virtual*/ bool isAnimatable() const { return false; } + bool isAnimatable() const override { return false; } private: diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h index d1c01bf1ad..832512ab85 100644 --- a/indra/newview/llviewertexlayer.h +++ b/indra/newview/llviewertexlayer.h @@ -124,7 +124,7 @@ protected: void doUpdate(); void restartUpdateTimer(); private: - BOOL mNeedsUpdate; // Whether we need to locally update our baked textures + bool mNeedsUpdate; // Whether we need to locally update our baked textures U32 mNumLowresUpdates; // Number of times we've locally updated with lowres version of our baked textures LLFrameTimer mNeedsUpdateTimer; // Tracks time since update was requested and performed. }; diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 478db3a6fc..9ba02e1ecc 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -135,7 +135,7 @@ void LLVOGrass::initClass() F32 F32_val; LLUUID id; - BOOL success = TRUE; + bool success{ true }; S32 species; static LLStdStringHandle species_id_string = LLXmlTree::addAttributeString("species_id"); @@ -188,7 +188,7 @@ void LLVOGrass::initClass() } } - BOOL have_all_grass = TRUE; + bool have_all_grass{ true }; std::string err; for (S32 i=0;igetFastAttributeS32(species_id_string, species)) @@ -250,7 +247,7 @@ void LLVOTree::initClass() } } - BOOL have_all_trees = TRUE; + bool have_all_trees {true}; std::string err; for (S32 i=0;i