diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-02-19 21:33:38 +0100 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-02-20 02:14:01 +0200 |
commit | c3e6f7b1643076df35a6960f735024078ddbb353 (patch) | |
tree | e7d0830ecac3b5d914aee9f776aebf80bbc20a90 | |
parent | 0a42ed6cc5e70f8cb78dd770aa8edcbae8ab2f02 (diff) |
Convert remaining cases of BOOL to bool in llmath and llprimitive
Changed the return values for LLPrimitive::packTEMessage methods from FALSE to true - these seemed to be strange and wrong, especially considering the following statement in LLVOAvatarSelf:
bool success = packTEMessage(mesgsys);
30 files changed, 464 insertions, 468 deletions
diff --git a/indra/llmath/llbbox.h b/indra/llmath/llbbox.h index f15d4c2061..8ae5f221f7 100644 --- a/indra/llmath/llbbox.h +++ b/indra/llmath/llbbox.h @@ -37,13 +37,13 @@ class LLBBox { public: - LLBBox() {mEmpty = TRUE;} + LLBBox() {mEmpty = true;} LLBBox( const LLVector3& pos_agent, const LLQuaternion& rot, const LLVector3& min_local, const LLVector3& max_local ) : - mMinLocal( min_local ), mMaxLocal( max_local ), mPosAgent(pos_agent), mRotation( rot), mEmpty( TRUE ) + mMinLocal( min_local ), mMaxLocal( max_local ), mPosAgent(pos_agent), mRotation( rot), mEmpty( true ) {} // Default copy constructor is OK. diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp index 0d1ffa5857..dd3d552832 100644 --- a/indra/llmath/llquaternion.cpp +++ b/indra/llmath/llquaternion.cpp @@ -653,14 +653,14 @@ LLQuaternion slerp( F32 u, const LLQuaternion &a, const LLQuaternion &b ) F32 cos_t = a.mQ[0]*b.mQ[0] + a.mQ[1]*b.mQ[1] + a.mQ[2]*b.mQ[2] + a.mQ[3]*b.mQ[3]; // if b is on opposite hemisphere from a, use -a instead - int bflip; + bool bflip; if (cos_t < 0.0f) { cos_t = -cos_t; - bflip = TRUE; + bflip = true; } else - bflip = FALSE; + bflip = false; // if B is (within precision limits) the same as A, // just linear interpolate between A and B. diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 3f40d671a7..292e8f1ff4 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -62,38 +62,38 @@ #define DEBUG_SILHOUETTE_NORMALS 0 // TomY: Use this to display normals using the silhouette #define DEBUG_SILHOUETTE_EDGE_MAP 0 // DaveP: Use this to display edge map using the silhouette -const F32 MIN_CUT_DELTA = 0.02f; +constexpr F32 MIN_CUT_DELTA = 0.02f; -const F32 HOLLOW_MIN = 0.f; -const F32 HOLLOW_MAX = 0.95f; -const F32 HOLLOW_MAX_SQUARE = 0.7f; +constexpr F32 HOLLOW_MIN = 0.f; +constexpr F32 HOLLOW_MAX = 0.95f; +constexpr F32 HOLLOW_MAX_SQUARE = 0.7f; -const F32 TWIST_MIN = -1.f; -const F32 TWIST_MAX = 1.f; +constexpr F32 TWIST_MIN = -1.f; +constexpr F32 TWIST_MAX = 1.f; -const F32 RATIO_MIN = 0.f; -const F32 RATIO_MAX = 2.f; // Tom Y: Inverted sense here: 0 = top taper, 2 = bottom taper +constexpr F32 RATIO_MIN = 0.f; +constexpr F32 RATIO_MAX = 2.f; // Tom Y: Inverted sense here: 0 = top taper, 2 = bottom taper -const F32 HOLE_X_MIN= 0.05f; -const F32 HOLE_X_MAX= 1.0f; +constexpr F32 HOLE_X_MIN= 0.05f; +constexpr F32 HOLE_X_MAX= 1.0f; -const F32 HOLE_Y_MIN= 0.05f; -const F32 HOLE_Y_MAX= 0.5f; +constexpr F32 HOLE_Y_MIN= 0.05f; +constexpr F32 HOLE_Y_MAX= 0.5f; -const F32 SHEAR_MIN = -0.5f; -const F32 SHEAR_MAX = 0.5f; +constexpr F32 SHEAR_MIN = -0.5f; +constexpr F32 SHEAR_MAX = 0.5f; -const F32 REV_MIN = 1.f; -const F32 REV_MAX = 4.f; +constexpr F32 REV_MIN = 1.f; +constexpr F32 REV_MAX = 4.f; -const F32 TAPER_MIN = -1.f; -const F32 TAPER_MAX = 1.f; +constexpr F32 TAPER_MIN = -1.f; +constexpr F32 TAPER_MAX = 1.f; -const F32 SKEW_MIN = -0.95f; -const F32 SKEW_MAX = 0.95f; +constexpr F32 SKEW_MIN = -0.95f; +constexpr F32 SKEW_MAX = 0.95f; -const F32 SCULPT_MIN_AREA = 0.002f; -const S32 SCULPT_MIN_AREA_DETAIL = 1; +constexpr F32 SCULPT_MIN_AREA = 0.002f; +constexpr S32 SCULPT_MIN_AREA_DETAIL = 1; bool gDebugGL = false; // See settings.xml "RenderDebugGL" @@ -439,12 +439,12 @@ LLProfile::Face* LLProfile::addCap(S16 faceID) face->mIndex = 0; face->mCount = mTotal; face->mScaleU= 1.0f; - face->mCap = TRUE; + face->mCap = true; face->mFaceID = faceID; return face; } -LLProfile::Face* LLProfile::addFace(S32 i, S32 count, F32 scaleU, S16 faceID, BOOL flat) +LLProfile::Face* LLProfile::addFace(S32 i, S32 count, F32 scaleU, S16 faceID, bool flat) { Face *face = vector_append(mFaces, 1); @@ -453,7 +453,7 @@ LLProfile::Face* LLProfile::addFace(S32 i, S32 count, F32 scaleU, S16 faceID, BO face->mScaleU= scaleU; face->mFlat = flat; - face->mCap = FALSE; + face->mCap = false; face->mFaceID = faceID; return face; } @@ -528,7 +528,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 { // Generate an n-sided "circular" path. // 0 is (1,0), and we go counter-clockwise along a circular path from there. - static const F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f }; + constexpr F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f }; F32 scale = 0.5f; F32 t, t_step, t_first, t_fraction, ang, ang_step; LLVector4a pt1,pt2; @@ -628,13 +628,13 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 { if ((end - begin)*ang_scale > 0.5f) { - mConcave = TRUE; + mConcave = true; } else { - mConcave = FALSE; + mConcave = false; } - mOpen = TRUE; + mOpen = true; if (params.getHollow() <= 0) { // put center point if not hollow. @@ -644,8 +644,8 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 else { // The profile isn't open. - mOpen = FALSE; - mConcave = FALSE; + mOpen = false; + mConcave = false; } mTotal = mProfile.size(); @@ -654,7 +654,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 // Hollow is percent of the original bounding box, not of this particular // profile's geometry. Thus, a swept triangle needs lower hollow values than // a swept square. -LLProfile::Face* LLProfile::addHole(const LLProfileParams& params, BOOL flat, F32 sides, F32 offset, F32 box_hollow, F32 ang_scale, S32 split) +LLProfile::Face* LLProfile::addHole(const LLProfileParams& params, bool flat, F32 sides, F32 offset, F32 box_hollow, F32 ang_scale, S32 split) { // Note that addHole will NOT work for non-"circular" profiles, if we ever decide to use them. @@ -693,8 +693,8 @@ LLProfile::Face* LLProfile::addHole(const LLProfileParams& params, BOOL flat, F3 } //static -S32 LLProfile::getNumPoints(const LLProfileParams& params, BOOL path_open,F32 detail, S32 split, - BOOL is_sculpted, S32 sculpt_size) +S32 LLProfile::getNumPoints(const LLProfileParams& params, bool path_open,F32 detail, S32 split, + bool is_sculpted, S32 sculpt_size) { // this is basically LLProfile::generate stripped down to only operations that influence the number of points if (detail < MIN_LOD) { @@ -850,7 +850,7 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai for (i = llfloor(begin * 4.f); i < llfloor(end * 4.f + .999f); i++) { - addFace((face_num++) * (split +1), split+2, 1, LL_FACE_OUTER_SIDE_0 << i, TRUE); + addFace((face_num++) * (split +1), split+2, 1, LL_FACE_OUTER_SIDE_0 << i, true); } LLVector4a scale(1,1,4,1); @@ -868,16 +868,16 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai { case LL_PCODE_HOLE_TRIANGLE: // This offset is not correct, but we can't change it now... DK 11/17/04 - addHole(params, TRUE, 3, -0.375f, hollow, 1.f, split); + addHole(params, true, 3, -0.375f, hollow, 1.f, split); break; case LL_PCODE_HOLE_CIRCLE: // TODO: Compute actual detail levels for cubes - addHole(params, FALSE, MIN_DETAIL_FACES * detail, -0.375f, hollow, 1.f); + addHole(params, false, MIN_DETAIL_FACES * detail, -0.375f, hollow, 1.f); break; case LL_PCODE_HOLE_SAME: case LL_PCODE_HOLE_SQUARE: default: - addHole(params, TRUE, 4, -0.375f, hollow, 1.f, split); + addHole(params, true, 4, -0.375f, hollow, 1.f, split); break; } } @@ -907,7 +907,7 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai for (i = llfloor(begin * 3.f); i < llfloor(end * 3.f + .999f); i++) { - addFace((face_num++) * (split +1), split+2, 1, LL_FACE_OUTER_SIDE_0 << i, TRUE); + addFace((face_num++) * (split +1), split+2, 1, LL_FACE_OUTER_SIDE_0 << i, true); } if (hollow) { @@ -919,15 +919,15 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai { case LL_PCODE_HOLE_CIRCLE: // TODO: Actually generate level of detail for triangles - addHole(params, FALSE, MIN_DETAIL_FACES * detail, 0, triangle_hollow, 1.f); + addHole(params, false, MIN_DETAIL_FACES * detail, 0, triangle_hollow, 1.f); break; case LL_PCODE_HOLE_SQUARE: - addHole(params, TRUE, 4, 0, triangle_hollow, 1.f, split); + addHole(params, true, 4, 0, triangle_hollow, 1.f, split); break; case LL_PCODE_HOLE_SAME: case LL_PCODE_HOLE_TRIANGLE: default: - addHole(params, TRUE, 3, 0, triangle_hollow, 1.f, split); + addHole(params, true, 3, 0, triangle_hollow, 1.f, split); break; } } @@ -964,11 +964,11 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai if (mOpen && !hollow) { - 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) @@ -976,15 +976,15 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai switch (hole_type) { case LL_PCODE_HOLE_SQUARE: - addHole(params, TRUE, 4, 0, hollow, 1.f, split); + addHole(params, true, 4, 0, hollow, 1.f, split); break; case LL_PCODE_HOLE_TRIANGLE: - addHole(params, TRUE, 3, 0, hollow, 1.f, split); + addHole(params, true, 3, 0, hollow, 1.f, split); break; case LL_PCODE_HOLE_CIRCLE: case LL_PCODE_HOLE_SAME: default: - addHole(params, FALSE, circle_detail, 0, hollow, 1.f); + addHole(params, true, circle_detail, 0, hollow, 1.f); break; } } @@ -1291,7 +1291,7 @@ void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 en LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME // Generates a circular path, starting at (1, 0, 0), counterclockwise along the xz plane. - static const F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f }; + constexpr F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f }; F32 revolutions = params.getRevolutions(); F32 skew = params.getSkew(); @@ -2025,7 +2025,7 @@ LLProfile::~LLProfile() S32 LLVolume::sNumMeshPoints = 0; -LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL generate_single_face, const BOOL is_unique) +LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const bool generate_single_face, const bool is_unique) : mParams(params) { mUnique = is_unique; @@ -2036,8 +2036,8 @@ LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL ge mIsMeshAssetLoaded = false; mIsMeshAssetUnavaliable = false; mLODScaleBias.setVec(1,1,1); - mHullPoints = NULL; - mHullIndices = NULL; + mHullPoints = nullptr; + mHullIndices = nullptr; mNumHullPoints = 0; mNumHullIndices = 0; @@ -2857,10 +2857,10 @@ void LLVolume::createVolumeFaces() else { S32 num_faces = getNumFaces(); - BOOL partial_build = TRUE; + bool partial_build = true; if (num_faces != mVolumeFaces.size()) { - partial_build = FALSE; + partial_build = false; mVolumeFaces.resize(num_faces); } // Initialize volume faces with parameter data @@ -3095,9 +3095,9 @@ void LLVolume::sculptGenerateSpherePlaceholder() void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type) { U8 sculpt_stitching = sculpt_type & LL_SCULPT_TYPE_MASK; - BOOL sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT; - BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR; - BOOL reverse_horizontal = (sculpt_invert ? !sculpt_mirror : sculpt_mirror); // XOR + bool sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT; + bool sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR; + bool reverse_horizontal = (sculpt_invert ? !sculpt_mirror : sculpt_mirror); // XOR S32 sizeS = mPathp->mPath.size(); S32 sizeT = mProfilep->mProfile.size(); @@ -3182,14 +3182,13 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 } -const S32 SCULPT_REZ_1 = 6; // changed from 4 to 6 - 6 looks round whereas 4 looks square -const S32 SCULPT_REZ_2 = 8; -const S32 SCULPT_REZ_3 = 16; -const S32 SCULPT_REZ_4 = 32; +constexpr S32 SCULPT_REZ_1 = 6; // changed from 4 to 6 - 6 looks round whereas 4 looks square +constexpr S32 SCULPT_REZ_2 = 8; +constexpr S32 SCULPT_REZ_3 = 16; +constexpr S32 SCULPT_REZ_4 = 32; S32 sculpt_sides(F32 detail) { - // detail is usually one of: 1, 1.5, 2.5, 4.0. if (detail <= 1.0) @@ -3252,12 +3251,12 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, { U8 sculpt_type = mParams.getSculptType(); - BOOL data_is_empty = FALSE; + bool data_is_empty = false; if (sculpt_width == 0 || sculpt_height == 0 || sculpt_components < 3 || sculpt_data == NULL) { sculpt_level = -1; - data_is_empty = TRUE; + data_is_empty = true; } S32 requested_sizeS = 0; @@ -3265,8 +3264,8 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, sculpt_calc_mesh_resolution(sculpt_width, sculpt_height, sculpt_type, mDetail, requested_sizeS, requested_sizeT); - mPathp->generate(mParams.getPathParams(), mDetail, 0, TRUE, requested_sizeS); - mProfilep->generate(mParams.getProfileParams(), mPathp->isOpen(), mDetail, 0, TRUE, requested_sizeT); + mPathp->generate(mParams.getPathParams(), mDetail, 0, true, requested_sizeS); + mProfilep->generate(mParams.getProfileParams(), mPathp->isOpen(), mDetail, 0, true, requested_sizeT); S32 sizeS = mPathp->mPath.size(); // we requested a specific size, now see what we really got S32 sizeT = mProfilep->mProfile.size(); // we requested a specific size, now see what we really got @@ -3297,7 +3296,7 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, if (area < SCULPT_MIN_AREA || area > SCULPT_MAX_AREA) { - data_is_empty = TRUE; + data_is_empty = true; visible_placeholder = true; } } @@ -3316,8 +3315,6 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, } } - - for (S32 i = 0; i < (S32)mProfilep->mFaces.size(); i++) { mFaceMask |= mProfilep->mFaces[i].mFaceID; @@ -3402,7 +3399,7 @@ void LLVolumeParams::copyParams(const LLVolumeParams ¶ms) } // Less restricitve approx 0 for volumes -const F32 APPROXIMATELY_ZERO = 0.001f; +constexpr F32 APPROXIMATELY_ZERO = 0.001f; bool approx_zero( F32 f, F32 tolerance = APPROXIMATELY_ZERO) { return (f >= -tolerance) && (f <= tolerance); @@ -3658,7 +3655,7 @@ bool LLVolumeParams::setSkew(const F32 skew_value) return valid; } -bool LLVolumeParams::setSculptID(const LLUUID sculpt_id, U8 sculpt_type) +bool LLVolumeParams::setSculptID(const LLUUID& sculpt_id, U8 sculpt_type) { mSculptID = sculpt_id; mSculptType = sculpt_type; @@ -3888,7 +3885,6 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices, } else { - //============================================== //DEBUG draw edge map instead of silhouette edge //============================================== @@ -3970,8 +3966,8 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices, //DEBUG //============================================== - static const U8 AWAY = 0x01, - TOWARDS = 0x02; + constexpr U8 AWAY = 0x01, + TOWARDS = 0x02; //for each triangle std::vector<U8> fFacing; @@ -4241,7 +4237,7 @@ LLVertexIndexPair::LLVertexIndexPair(const LLVector3 &vertex, const S32 index) mIndex = index; } -const F32 VERTEX_SLOP = 0.00001f; +constexpr F32 VERTEX_SLOP = 0.00001f; struct lessVertex { @@ -4251,32 +4247,32 @@ struct lessVertex if (a->mVertex.mV[0] + slop < b->mVertex.mV[0]) { - return TRUE; + return true; } else if (a->mVertex.mV[0] - slop > b->mVertex.mV[0]) { - return FALSE; + return false; } if (a->mVertex.mV[1] + slop < b->mVertex.mV[1]) { - return TRUE; + return true; } else if (a->mVertex.mV[1] - slop > b->mVertex.mV[1]) { - return FALSE; + return false; } if (a->mVertex.mV[2] + slop < b->mVertex.mV[2]) { - return TRUE; + return true; } else if (a->mVertex.mV[2] - slop > b->mVertex.mV[2]) { - return FALSE; + return false; } - return FALSE; + return false; } }; @@ -4286,42 +4282,42 @@ struct lessTriangle { if (*a < *b) { - return TRUE; + return true; } else if (*a > *b) { - return FALSE; + return false; } if (*(a+1) < *(b+1)) { - return TRUE; + return true; } else if (*(a+1) > *(b+1)) { - return FALSE; + return false; } if (*(a+2) < *(b+2)) { - return TRUE; + return true; } else if (*(a+2) > *(b+2)) { - return FALSE; + return false; } - return FALSE; + return false; } }; -BOOL equalTriangle(const S32 *a, const S32 *b) +bool equalTriangle(const S32 *a, const S32 *b) { if ((*a == *b) && (*(a+1) == *(b+1)) && (*(a+2) == *(b+2))) { - return TRUE; + return true; } - return FALSE; + return false; } bool LLVolumeParams::importFile(LLFILE *fp) @@ -4520,7 +4516,7 @@ bool LLVolumeParams::isConvex() const } F32 profile_length = mProfileParams.getEnd() - mProfileParams.getBegin(); - BOOL same_hole = hollow == 0.f + bool same_hole = hollow == 0.f || (mProfileParams.getCurveType() & LL_PCODE_HOLE_MASK) == LL_PCODE_HOLE_SAME; F32 min_profile_wedge = MIN_CONCAVE_PROFILE_WEDGE; @@ -4531,7 +4527,7 @@ bool LLVolumeParams::isConvex() const min_profile_wedge = 2.f * MIN_CONCAVE_PROFILE_WEDGE; } - BOOL convex_profile = ( ( profile_length == 1.f + bool convex_profile = ( ( profile_length == 1.f || profile_length <= 0.5f ) && hollow == 0.f ) // trivially convex || ( profile_length <= min_profile_wedge @@ -4797,7 +4793,7 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src) mJustWeights(NULL), mJointIndices(NULL), #endif - mWeightsScrubbed(FALSE), + mWeightsScrubbed(false), mOctree(NULL), mOctreeTriangles(NULL) { @@ -4864,14 +4860,14 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) { llassert(!mWeights); // don't orphan an old alloc here accidentally allocateWeights(src.mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mWeights, (F32*) src.mWeights, vert_size); + LLVector4a::memcpyNonAliased16((F32*) mWeights, (F32*) src.mWeights, vert_size); mWeightsScrubbed = src.mWeightsScrubbed; } else { - ll_aligned_free_16(mWeights); - mWeights = NULL; - mWeightsScrubbed = FALSE; + ll_aligned_free_16(mWeights); + mWeights = NULL; + mWeightsScrubbed = false; } #if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS @@ -4944,7 +4940,7 @@ void LLVolumeFace::freeData() destroyOctree(); } -bool LLVolumeFace::create(LLVolume* volume, BOOL partial_build) +bool LLVolumeFace::create(LLVolume* volume, bool partial_build) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME @@ -5088,7 +5084,7 @@ void LLVolumeFace::optimize(F32 angle_cutoff) LLVolumeFace::VertexData cv; getVertexData(index, cv); - BOOL found = FALSE; + bool found = false; LLVector4a pos; pos.setSub(mPositions[index], mExtents[0]); @@ -5109,7 +5105,7 @@ void LLVolumeFace::optimize(F32 angle_cutoff) LLVolumeFace::VertexData& tv = (point_iter->second)[j]; if (tv.compareNormal(cv, angle_cutoff)) { - found = TRUE; + found = true; new_face.pushIndex((point_iter->second)[j].mIndex); break; } @@ -5216,12 +5212,12 @@ public: } }; -const F64 FindVertexScore_CacheDecayPower = 1.5; -const F64 FindVertexScore_LastTriScore = 0.75; -const F64 FindVertexScore_ValenceBoostScale = 2.0; -const F64 FindVertexScore_ValenceBoostPower = 0.5; -const U32 MaxSizeVertexCache = 32; -const F64 FindVertexScore_Scaler = 1.0/(MaxSizeVertexCache-3); +constexpr F64 FindVertexScore_CacheDecayPower = 1.5; +constexpr F64 FindVertexScore_LastTriScore = 0.75; +constexpr F64 FindVertexScore_ValenceBoostScale = 2.0; +constexpr F64 FindVertexScore_ValenceBoostPower = 0.5; +constexpr U32 MaxSizeVertexCache = 32; +constexpr F64 FindVertexScore_Scaler = 1.0/(MaxSizeVertexCache-3); F64 find_vertex_score(LLVCacheVertexData& data) { @@ -5491,7 +5487,7 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents) { //optimize for vertex cache according to Forsyth method: LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME; llassert(!mOptimized); - mOptimized = TRUE; + mOptimized = true; if (gen_tangents && mNormals && mTexCoords) { // generate mikkt space tangents before cache optimizing since the index buffer may change @@ -6161,7 +6157,7 @@ bool LLVolumeFace::createCap(LLVolume* volume, bool partial_build) //if (partial_build) //{ - // return TRUE; + // return true; //} if (mTypeMask & HOLLOW_MASK) @@ -6684,7 +6680,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) num_vertices = mNumS*mNumT; num_indices = (mNumS-1)*(mNumT-1)*6; - partial_build = (num_vertices > mNumVertices || num_indices > mNumIndices) ? FALSE : partial_build; + partial_build = (num_vertices > mNumVertices || num_indices > mNumIndices) ? false : partial_build; if (!partial_build) { @@ -6855,7 +6851,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) S32 cur_index = 0; S32 cur_edge = 0; - BOOL flat_face = mTypeMask & FLAT_MASK; + bool flat_face = mTypeMask & FLAT_MASK; if (!partial_build) { @@ -6875,7 +6871,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) if (t < mNumT-2) { //top right/top left neighbor face mEdge[cur_edge++] = (mNumS-1)*2*(t+1)+s*2+1; } - else if (mNumT <= 3 || volume->getPath().isOpen() == TRUE) { //no neighbor + else if (mNumT <= 3 || volume->getPath().isOpen() == true) { //no neighbor mEdge[cur_edge++] = -1; } else { //wrap on T @@ -6884,7 +6880,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) if (s > 0) { //top left/bottom left neighbor face mEdge[cur_edge++] = (mNumS-1)*2*t+s*2-1; } - else if (flat_face || volume->getProfile().isOpen() == TRUE) { //no neighbor + else if (flat_face || volume->getProfile().isOpen() == true) { //no neighbor mEdge[cur_edge++] = -1; } else { //wrap on S @@ -6894,7 +6890,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) if (t > 0) { //bottom left/bottom right neighbor face mEdge[cur_edge++] = (mNumS-1)*2*(t-1)+s*2; } - else if (mNumT <= 3 || volume->getPath().isOpen() == TRUE) { //no neighbor + else if (mNumT <= 3 || volume->getPath().isOpen() == true) { //no neighbor mEdge[cur_edge++] = -1; } else { //wrap on T @@ -6903,7 +6899,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) if (s < mNumS-2) { //bottom right/top right neighbor face mEdge[cur_edge++] = (mNumS-1)*2*t+(s+1)*2; } - else if (flat_face || volume->getProfile().isOpen() == TRUE) { //no neighbor + else if (flat_face || volume->getProfile().isOpen() == true) { //no neighbor mEdge[cur_edge++] = -1; } else { //wrap on S @@ -7046,7 +7042,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) if (sculpt_stitching == LL_SCULPT_TYPE_NONE) // logic for non-sculpt volumes { - if (volume->getPath().isOpen() == FALSE) + if (volume->getPath().isOpen() == false) { //wrap normals on T for (S32 i = 0; i < mNumS; i++) { @@ -7057,7 +7053,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) } } - if ((volume->getProfile().isOpen() == FALSE) && !(s_bottom_converges)) + if ((volume->getProfile().isOpen() == false) && !(s_bottom_converges)) { //wrap normals on S for (S32 i = 0; i < mNumT; i++) { diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 4ea0604f26..0df46da9d0 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -62,144 +62,144 @@ class LLVolumeTriangle; //============================================================================ -const S32 MIN_DETAIL_FACES = 6; -const S32 MIN_LOD = 0; -const S32 MAX_LOD = 3; +constexpr S32 MIN_DETAIL_FACES = 6; +constexpr S32 MIN_LOD = 0; +constexpr S32 MAX_LOD = 3; // These are defined here but are not enforced at this level, // rather they are here for the convenience of code that uses // the LLVolume class. -const F32 MIN_VOLUME_PROFILE_WIDTH = 0.05f; -const F32 MIN_VOLUME_PATH_WIDTH = 0.05f; +constexpr F32 MIN_VOLUME_PROFILE_WIDTH = 0.05f; +constexpr F32 MIN_VOLUME_PATH_WIDTH = 0.05f; -const F32 CUT_QUANTA = 0.00002f; -const F32 SCALE_QUANTA = 0.01f; -const F32 SHEAR_QUANTA = 0.01f; -const F32 TAPER_QUANTA = 0.01f; -const F32 REV_QUANTA = 0.015f; -const F32 HOLLOW_QUANTA = 0.00002f; +constexpr F32 CUT_QUANTA = 0.00002f; +constexpr F32 SCALE_QUANTA = 0.01f; +constexpr F32 SHEAR_QUANTA = 0.01f; +constexpr F32 TAPER_QUANTA = 0.01f; +constexpr F32 REV_QUANTA = 0.015f; +constexpr F32 HOLLOW_QUANTA = 0.00002f; -const S32 MAX_VOLUME_TRIANGLE_INDICES = 10000; +constexpr S32 MAX_VOLUME_TRIANGLE_INDICES = 10000; //============================================================================ // useful masks -const LLPCode LL_PCODE_HOLLOW_MASK = 0x80; // has a thickness -const LLPCode LL_PCODE_SEGMENT_MASK = 0x40; // segments (1 angle) -const LLPCode LL_PCODE_PATCH_MASK = 0x20; // segmented segments (2 angles) -const LLPCode LL_PCODE_HEMI_MASK = 0x10; // half-primitives get their own type per PR's dictum -const LLPCode LL_PCODE_BASE_MASK = 0x0F; +constexpr LLPCode LL_PCODE_HOLLOW_MASK = 0x80; // has a thickness +constexpr LLPCode LL_PCODE_SEGMENT_MASK = 0x40; // segments (1 angle) +constexpr LLPCode LL_PCODE_PATCH_MASK = 0x20; // segmented segments (2 angles) +constexpr LLPCode LL_PCODE_HEMI_MASK = 0x10; // half-primitives get their own type per PR's dictum +constexpr LLPCode LL_PCODE_BASE_MASK = 0x0F; // primitive shapes -const LLPCode LL_PCODE_CUBE = 1; -const LLPCode LL_PCODE_PRISM = 2; -const LLPCode LL_PCODE_TETRAHEDRON = 3; -const LLPCode LL_PCODE_PYRAMID = 4; -const LLPCode LL_PCODE_CYLINDER = 5; -const LLPCode LL_PCODE_CONE = 6; -const LLPCode LL_PCODE_SPHERE = 7; -const LLPCode LL_PCODE_TORUS = 8; -const LLPCode LL_PCODE_VOLUME = 9; +constexpr LLPCode LL_PCODE_CUBE = 1; +constexpr LLPCode LL_PCODE_PRISM = 2; +constexpr LLPCode LL_PCODE_TETRAHEDRON = 3; +constexpr LLPCode LL_PCODE_PYRAMID = 4; +constexpr LLPCode LL_PCODE_CYLINDER = 5; +constexpr LLPCode LL_PCODE_CONE = 6; +constexpr LLPCode LL_PCODE_SPHERE = 7; +constexpr LLPCode LL_PCODE_TORUS = 8; +constexpr LLPCode LL_PCODE_VOLUME = 9; // surfaces -//const LLPCode LL_PCODE_SURFACE_TRIANGLE = 10; -//const LLPCode LL_PCODE_SURFACE_SQUARE = 11; -//const LLPCode LL_PCODE_SURFACE_DISC = 12; +//constexpr LLPCode LL_PCODE_SURFACE_TRIANGLE = 10; +//constexpr LLPCode LL_PCODE_SURFACE_SQUARE = 11; +//constexpr LLPCode LL_PCODE_SURFACE_DISC = 12; -const LLPCode LL_PCODE_APP = 14; // App specific pcode (for viewer/sim side only objects) -const LLPCode LL_PCODE_LEGACY = 15; +constexpr LLPCode LL_PCODE_APP = 14; // App specific pcode (for viewer/sim side only objects) +constexpr LLPCode LL_PCODE_LEGACY = 15; // Pcodes for legacy objects -//const LLPCode LL_PCODE_LEGACY_ATOR = 0x10 | LL_PCODE_LEGACY; // ATOR -const LLPCode LL_PCODE_LEGACY_AVATAR = 0x20 | LL_PCODE_LEGACY; // PLAYER -//const LLPCode LL_PCODE_LEGACY_BIRD = 0x30 | LL_PCODE_LEGACY; // BIRD -//const LLPCode LL_PCODE_LEGACY_DEMON = 0x40 | LL_PCODE_LEGACY; // DEMON -const LLPCode LL_PCODE_LEGACY_GRASS = 0x50 | LL_PCODE_LEGACY; // GRASS -const LLPCode LL_PCODE_TREE_NEW = 0x60 | LL_PCODE_LEGACY; // new trees -//const LLPCode LL_PCODE_LEGACY_ORACLE = 0x70 | LL_PCODE_LEGACY; // ORACLE -const LLPCode LL_PCODE_LEGACY_PART_SYS = 0x80 | LL_PCODE_LEGACY; // PART_SYS -const LLPCode LL_PCODE_LEGACY_ROCK = 0x90 | LL_PCODE_LEGACY; // ROCK -//const LLPCode LL_PCODE_LEGACY_SHOT = 0xA0 | LL_PCODE_LEGACY; // BASIC_SHOT -//const LLPCode LL_PCODE_LEGACY_SHOT_BIG = 0xB0 | LL_PCODE_LEGACY; -//const LLPCode LL_PCODE_LEGACY_SMOKE = 0xC0 | LL_PCODE_LEGACY; // SMOKE -//const LLPCode LL_PCODE_LEGACY_SPARK = 0xD0 | LL_PCODE_LEGACY;// SPARK -const LLPCode LL_PCODE_LEGACY_TEXT_BUBBLE = 0xE0 | LL_PCODE_LEGACY; // TEXTBUBBLE -const LLPCode LL_PCODE_LEGACY_TREE = 0xF0 | LL_PCODE_LEGACY; // TREE +//constexpr LLPCode LL_PCODE_LEGACY_ATOR = 0x10 | LL_PCODE_LEGACY; // ATOR +constexpr LLPCode LL_PCODE_LEGACY_AVATAR = 0x20 | LL_PCODE_LEGACY; // PLAYER +//constexpr LLPCode LL_PCODE_LEGACY_BIRD = 0x30 | LL_PCODE_LEGACY; // BIRD +//constexpr LLPCode LL_PCODE_LEGACY_DEMON = 0x40 | LL_PCODE_LEGACY; // DEMON +constexpr LLPCode LL_PCODE_LEGACY_GRASS = 0x50 | LL_PCODE_LEGACY; // GRASS +constexpr LLPCode LL_PCODE_TREE_NEW = 0x60 | LL_PCODE_LEGACY; // new trees +//constexpr LLPCode LL_PCODE_LEGACY_ORACLE = 0x70 | LL_PCODE_LEGACY; // ORACLE +constexpr LLPCode LL_PCODE_LEGACY_PART_SYS = 0x80 | LL_PCODE_LEGACY; // PART_SYS +constexpr LLPCode LL_PCODE_LEGACY_ROCK = 0x90 | LL_PCODE_LEGACY; // ROCK +//constexpr LLPCode LL_PCODE_LEGACY_SHOT = 0xA0 | LL_PCODE_LEGACY; // BASIC_SHOT +//constexpr LLPCode LL_PCODE_LEGACY_SHOT_BIG = 0xB0 | LL_PCODE_LEGACY; +//constexpr LLPCode LL_PCODE_LEGACY_SMOKE = 0xC0 | LL_PCODE_LEGACY; // SMOKE +//constexpr LLPCode LL_PCODE_LEGACY_SPARK = 0xD0 | LL_PCODE_LEGACY;// SPARK +constexpr LLPCode LL_PCODE_LEGACY_TEXT_BUBBLE = 0xE0 | LL_PCODE_LEGACY; // TEXTBUBBLE +constexpr LLPCode LL_PCODE_LEGACY_TREE = 0xF0 | LL_PCODE_LEGACY; // TREE // hemis -const LLPCode LL_PCODE_CYLINDER_HEMI = LL_PCODE_CYLINDER | LL_PCODE_HEMI_MASK; -const LLPCode LL_PCODE_CONE_HEMI = LL_PCODE_CONE | LL_PCODE_HEMI_MASK; -const LLPCode LL_PCODE_SPHERE_HEMI = LL_PCODE_SPHERE | LL_PCODE_HEMI_MASK; -const LLPCode LL_PCODE_TORUS_HEMI = LL_PCODE_TORUS | LL_PCODE_HEMI_MASK; +constexpr LLPCode LL_PCODE_CYLINDER_HEMI = LL_PCODE_CYLINDER | LL_PCODE_HEMI_MASK; +constexpr LLPCode LL_PCODE_CONE_HEMI = LL_PCODE_CONE | LL_PCODE_HEMI_MASK; +constexpr LLPCode LL_PCODE_SPHERE_HEMI = LL_PCODE_SPHERE | LL_PCODE_HEMI_MASK; +constexpr LLPCode LL_PCODE_TORUS_HEMI = LL_PCODE_TORUS | LL_PCODE_HEMI_MASK; // Volumes consist of a profile at the base that is swept around // a path to make a volume. // The profile code -const U8 LL_PCODE_PROFILE_MASK = 0x0f; -const U8 LL_PCODE_PROFILE_MIN = 0x00; -const U8 LL_PCODE_PROFILE_CIRCLE = 0x00; -const U8 LL_PCODE_PROFILE_SQUARE = 0x01; -const U8 LL_PCODE_PROFILE_ISOTRI = 0x02; -const U8 LL_PCODE_PROFILE_EQUALTRI = 0x03; -const U8 LL_PCODE_PROFILE_RIGHTTRI = 0x04; -const U8 LL_PCODE_PROFILE_CIRCLE_HALF = 0x05; -const U8 LL_PCODE_PROFILE_MAX = 0x05; +constexpr U8 LL_PCODE_PROFILE_MASK = 0x0f; +constexpr U8 LL_PCODE_PROFILE_MIN = 0x00; +constexpr U8 LL_PCODE_PROFILE_CIRCLE = 0x00; +constexpr U8 LL_PCODE_PROFILE_SQUARE = 0x01; +constexpr U8 LL_PCODE_PROFILE_ISOTRI = 0x02; +constexpr U8 LL_PCODE_PROFILE_EQUALTRI = 0x03; +constexpr U8 LL_PCODE_PROFILE_RIGHTTRI = 0x04; +constexpr U8 LL_PCODE_PROFILE_CIRCLE_HALF = 0x05; +constexpr U8 LL_PCODE_PROFILE_MAX = 0x05; // Stored in the profile byte -const U8 LL_PCODE_HOLE_MASK = 0xf0; -const U8 LL_PCODE_HOLE_MIN = 0x00; -const U8 LL_PCODE_HOLE_SAME = 0x00; // same as outside profile -const U8 LL_PCODE_HOLE_CIRCLE = 0x10; -const U8 LL_PCODE_HOLE_SQUARE = 0x20; -const U8 LL_PCODE_HOLE_TRIANGLE = 0x30; -const U8 LL_PCODE_HOLE_MAX = 0x03; // min/max needs to be >> 4 of real min/max - -const U8 LL_PCODE_PATH_IGNORE = 0x00; -const U8 LL_PCODE_PATH_MIN = 0x01; // min/max needs to be >> 4 of real min/max -const U8 LL_PCODE_PATH_LINE = 0x10; -const U8 LL_PCODE_PATH_CIRCLE = 0x20; -const U8 LL_PCODE_PATH_CIRCLE2 = 0x30; -const U8 LL_PCODE_PATH_TEST = 0x40; -const U8 LL_PCODE_PATH_FLEXIBLE = 0x80; -const U8 LL_PCODE_PATH_MAX = 0x08; +constexpr U8 LL_PCODE_HOLE_MASK = 0xf0; +constexpr U8 LL_PCODE_HOLE_MIN = 0x00; +constexpr U8 LL_PCODE_HOLE_SAME = 0x00; // same as outside profile +constexpr U8 LL_PCODE_HOLE_CIRCLE = 0x10; +constexpr U8 LL_PCODE_HOLE_SQUARE = 0x20; +constexpr U8 LL_PCODE_HOLE_TRIANGLE = 0x30; +constexpr U8 LL_PCODE_HOLE_MAX = 0x03; // min/max needs to be >> 4 of real min/max + +constexpr U8 LL_PCODE_PATH_IGNORE = 0x00; +constexpr U8 LL_PCODE_PATH_MIN = 0x01; // min/max needs to be >> 4 of real min/max +constexpr U8 LL_PCODE_PATH_LINE = 0x10; +constexpr U8 LL_PCODE_PATH_CIRCLE = 0x20; +constexpr U8 LL_PCODE_PATH_CIRCLE2 = 0x30; +constexpr U8 LL_PCODE_PATH_TEST = 0x40; +constexpr U8 LL_PCODE_PATH_FLEXIBLE = 0x80; +constexpr U8 LL_PCODE_PATH_MAX = 0x08; //============================================================================ // face identifiers typedef U16 LLFaceID; -const LLFaceID LL_FACE_PATH_BEGIN = 0x1 << 0; -const LLFaceID LL_FACE_PATH_END = 0x1 << 1; -const LLFaceID LL_FACE_INNER_SIDE = 0x1 << 2; -const LLFaceID LL_FACE_PROFILE_BEGIN = 0x1 << 3; -const LLFaceID LL_FACE_PROFILE_END = 0x1 << 4; -const LLFaceID LL_FACE_OUTER_SIDE_0 = 0x1 << 5; -const LLFaceID LL_FACE_OUTER_SIDE_1 = 0x1 << 6; -const LLFaceID LL_FACE_OUTER_SIDE_2 = 0x1 << 7; -const LLFaceID LL_FACE_OUTER_SIDE_3 = 0x1 << 8; +constexpr LLFaceID LL_FACE_PATH_BEGIN = 0x1 << 0; +constexpr LLFaceID LL_FACE_PATH_END = 0x1 << 1; +constexpr LLFaceID LL_FACE_INNER_SIDE = 0x1 << 2; +constexpr LLFaceID LL_FACE_PROFILE_BEGIN = 0x1 << 3; +constexpr LLFaceID LL_FACE_PROFILE_END = 0x1 << 4; +constexpr LLFaceID LL_FACE_OUTER_SIDE_0 = 0x1 << 5; +constexpr LLFaceID LL_FACE_OUTER_SIDE_1 = 0x1 << 6; +constexpr LLFaceID LL_FACE_OUTER_SIDE_2 = 0x1 << 7; +constexpr LLFaceID LL_FACE_OUTER_SIDE_3 = 0x1 << 8; //============================================================================ // sculpt types + flags -const U8 LL_SCULPT_TYPE_NONE = 0; -const U8 LL_SCULPT_TYPE_SPHERE = 1; -const U8 LL_SCULPT_TYPE_TORUS = 2; -const U8 LL_SCULPT_TYPE_PLANE = 3; -const U8 LL_SCULPT_TYPE_CYLINDER = 4; -const U8 LL_SCULPT_TYPE_MESH = 5; -const U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE | +constexpr U8 LL_SCULPT_TYPE_NONE = 0; +constexpr U8 LL_SCULPT_TYPE_SPHERE = 1; +constexpr U8 LL_SCULPT_TYPE_TORUS = 2; +constexpr U8 LL_SCULPT_TYPE_PLANE = 3; +constexpr U8 LL_SCULPT_TYPE_CYLINDER = 4; +constexpr U8 LL_SCULPT_TYPE_MESH = 5; +constexpr U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE | LL_SCULPT_TYPE_CYLINDER | LL_SCULPT_TYPE_MESH; // for value checks, assign new value after adding new types -const U8 LL_SCULPT_TYPE_MAX = LL_SCULPT_TYPE_MESH; +constexpr U8 LL_SCULPT_TYPE_MAX = LL_SCULPT_TYPE_MESH; -const U8 LL_SCULPT_FLAG_INVERT = 64; -const U8 LL_SCULPT_FLAG_MIRROR = 128; -const U8 LL_SCULPT_FLAG_MASK = LL_SCULPT_FLAG_INVERT | LL_SCULPT_FLAG_MIRROR; +constexpr U8 LL_SCULPT_FLAG_INVERT = 64; +constexpr U8 LL_SCULPT_FLAG_MIRROR = 128; +constexpr U8 LL_SCULPT_FLAG_MASK = LL_SCULPT_FLAG_INVERT | LL_SCULPT_FLAG_MIRROR; -const S32 LL_SCULPT_MESH_MAX_FACES = 8; +constexpr S32 LL_SCULPT_MESH_MAX_FACES = 8; extern bool gDebugGL; @@ -620,7 +620,7 @@ public: bool setRevolutions(const F32 revolutions); // 1 to 4 bool setRadiusOffset(const F32 radius_offset); bool setSkew(const F32 skew); - bool setSculptID(const LLUUID sculpt_id, U8 sculpt_type); + bool setSculptID(const LLUUID& sculpt_id, U8 sculpt_type); static bool validate(U8 prof_curve, F32 prof_begin, F32 prof_end, F32 hollow, U8 path_curve, F32 path_begin, F32 path_end, @@ -697,12 +697,12 @@ public: S32 getTotal() const { return mTotal; } S32 getTotalOut() const { return mTotalOut; } // Total number of outside points - BOOL isFlat(S32 face) const { return (mFaces[face].mCount == 2); } - BOOL isOpen() const { return mOpen; } - void setDirty() { mDirty = TRUE; } + bool isFlat(S32 face) const { return (mFaces[face].mCount == 2); } + bool isOpen() const { return mOpen; } + void setDirty() { mDirty = true; } - static S32 getNumPoints(const LLProfileParams& params, BOOL path_open, F32 detail = 1.0f, S32 split = 0, - BOOL is_sculpted = FALSE, S32 sculpt_size = 0); + 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; } @@ -712,8 +712,8 @@ public: S32 mIndex; S32 mCount; F32 mScaleU; - BOOL mCap; - BOOL mFlat; + bool mCap; + bool mFlat; LLFaceID mFaceID; }; @@ -732,14 +732,14 @@ protected: static S32 getNumNGonPoints(const LLProfileParams& params, S32 sides, F32 offset=0.0f, F32 bevel = 0.0f, F32 ang_scale = 1.f, S32 split = 0); void genNGon(const LLProfileParams& params, S32 sides, F32 offset=0.0f, F32 bevel = 0.0f, F32 ang_scale = 1.f, S32 split = 0); - Face* addHole(const LLProfileParams& params, BOOL flat, F32 sides, F32 offset, F32 box_hollow, F32 ang_scale, S32 split = 0); + Face* addHole(const LLProfileParams& params, bool flat, F32 sides, F32 offset, F32 box_hollow, F32 ang_scale, S32 split = 0); Face* addCap (S16 faceID); - Face* addFace(S32 index, S32 count, F32 scaleU, S16 faceID, BOOL flat); + Face* addFace(S32 index, S32 count, F32 scaleU, S16 faceID, bool flat); protected: - BOOL mOpen; - BOOL mConcave; - BOOL mDirty; + bool mOpen; + bool mConcave; + bool mDirty; S32 mTotalOut; S32 mTotal; @@ -795,9 +795,9 @@ public: 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; } + bool isOpen() const { return mOpen; } F32 getStep() const { return mStep; } - void setDirty() { mDirty = TRUE; } + void setDirty() { mDirty = true; } S32 getPathLength() const { return (S32)mPath.size(); } @@ -809,9 +809,9 @@ public: LLAlignedArray<PathPt, 64> mPath; protected: - BOOL mOpen; + bool mOpen; S32 mTotal; - BOOL mDirty; + bool mDirty; F32 mStep; }; @@ -870,7 +870,7 @@ private: void freeData(); public: - bool create(LLVolume* volume, BOOL partial_build = FALSE); + bool create(LLVolume* volume, bool partial_build = false); void createTangents(); void resizeVertices(S32 num_verts); @@ -972,14 +972,14 @@ public: U8* mJointIndices; #endif - mutable BOOL mWeightsScrubbed; + mutable bool mWeightsScrubbed; // Which joints are rigged to, and the bounding box of any rigged // vertices per joint. LLJointRiggingInfoTab mJointRiggingInfoTab; //whether or not face has been cache optimized - BOOL mOptimized; + bool mOptimized; // if this is a mesh asset, scale and translation that were applied // when encoding the source mesh into a unit cube @@ -1014,7 +1014,7 @@ public: S32 mCountT; }; - LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL generate_single_face = FALSE, const BOOL is_unique = FALSE); + LLVolume(const LLVolumeParams ¶ms, const F32 detail, const bool generate_single_face = false, const bool is_unique = false); U8 getProfileType() const { return mParams.getProfileParams().getCurveType(); } U8 getPathType() const { return mParams.getPathParams().getCurveType(); } @@ -1047,7 +1047,7 @@ public: static void getLoDTriangleCounts(const LLVolumeParams& params, S32* counts); - S32 getNumTriangles(S32* vcount = NULL) const; + S32 getNumTriangles(S32* vcount = nullptr) const; void generateSilhouetteVertices(std::vector<LLVector3> &vertices, std::vector<LLVector3> &normals, @@ -1061,10 +1061,10 @@ public: //Line segment must be in volume space. S32 lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face = -1, // which face to check, -1 = ALL_SIDES - LLVector4a* intersection = NULL, // return the intersection point - LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point - LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL // return the surface tangent at the intersection point + LLVector4a* intersection = nullptr, // return the intersection point + LLVector2* tex_coord = nullptr, // return the texture coordinates of the intersection point + LLVector4a* normal = nullptr, // return the surface normal at the intersection point + LLVector4a* tangent = nullptr // return the surface tangent at the intersection point ); LLFaceID generateFaceMask(); @@ -1115,7 +1115,7 @@ public: virtual bool isMeshAssetUnavaliable(); protected: - BOOL mUnique; + bool mUnique; F32 mDetail; S32 mSculptLevel; F32 mSurfaceArea; //unscaled surface area diff --git a/indra/llmath/m3math.cpp b/indra/llmath/m3math.cpp index 65eb3348de..c7777164c0 100644 --- a/indra/llmath/m3math.cpp +++ b/indra/llmath/m3math.cpp @@ -528,10 +528,10 @@ bool operator==(const LLMatrix3 &a, const LLMatrix3 &b) for (j = 0; j < NUM_VALUES_IN_MAT3; j++) { if (a.mMatrix[j][i] != b.mMatrix[j][i]) - return FALSE; + return false; } } - return TRUE; + return true; } bool operator!=(const LLMatrix3 &a, const LLMatrix3 &b) @@ -542,10 +542,10 @@ bool operator!=(const LLMatrix3 &a, const LLMatrix3 &b) for (j = 0; j < NUM_VALUES_IN_MAT3; j++) { if (a.mMatrix[j][i] != b.mMatrix[j][i]) - return TRUE; + return true; } } - return FALSE; + return false; } const LLMatrix3& operator*=(LLMatrix3 &a, const LLMatrix3 &b) diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index 6e40dae30b..ee4f607442 100644 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp @@ -744,10 +744,10 @@ bool operator==(const LLMatrix4 &a, const LLMatrix4 &b) for (j = 0; j < NUM_VALUES_IN_MAT4; j++) { if (a.mMatrix[j][i] != b.mMatrix[j][i]) - return FALSE; + return false; } } - return TRUE; + return true; } bool operator!=(const LLMatrix4 &a, const LLMatrix4 &b) @@ -758,10 +758,10 @@ bool operator!=(const LLMatrix4 &a, const LLMatrix4 &b) for (j = 0; j < NUM_VALUES_IN_MAT4; j++) { if (a.mMatrix[j][i] != b.mMatrix[j][i]) - return TRUE; + return true; } } - return FALSE; + return false; } bool operator<(const LLMatrix4& a, const LLMatrix4 &b) diff --git a/indra/llmath/raytrace.cpp b/indra/llmath/raytrace.cpp index c3956e9995..125374a4c2 100644 --- a/indra/llmath/raytrace.cpp +++ b/indra/llmath/raytrace.cpp @@ -242,7 +242,7 @@ bool ray_cylinder(const LLVector3 &ray_point, const LLVector3 &ray_direction, if (dot > 0.0f) { // ray points away from cylinder bottom - return FALSE; + return false; } // ray hit bottom of cylinder from outside intersection = ray_point - shortest_distance * cyl_axis; diff --git a/indra/llmath/raytrace.h b/indra/llmath/raytrace.h index 3f7014c1b9..df14a9a487 100644 --- a/indra/llmath/raytrace.h +++ b/indra/llmath/raytrace.h @@ -117,12 +117,12 @@ U32 ray_box(const LLVector3 &ray_point, const LLVector3 &ray_direction, /* TODO -BOOL ray_ellipsoid(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_ellipsoid(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &e_center, const LLVector3 &e_scale, const LLQuaternion &e_rotation, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL ray_cone(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_cone(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &cone_tip, const LLVector3 &cone_bottom, const LLVector3 &cone_scale, const LLQuaternion &cone_rotation, LLVector3 &intersection, LLVector3 &intersection_normal); @@ -146,24 +146,24 @@ bool ray_pyramid(const LLVector3 &ray_point, const LLVector3 &ray_direction, /* TODO -BOOL ray_hemiellipsoid(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_hemiellipsoid(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &e_center, const LLVector3 &e_scale, const LLQuaternion &e_rotation, const LLVector3 &e_cut_normal, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL ray_hemisphere(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_hemisphere(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &sphere_center, F32 sphere_radius, const LLVector3 &sphere_cut_normal, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL ray_hemicylinder(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_hemicylinder(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &cyl_top, const LLVector3 &cyl_bottom, F32 cyl_radius, const LLVector3 &cyl_cut_normal, LLVector3 &intersection, LLVector3 &intersection_normal); -BOOL ray_hemicone(const LLVector3 &ray_point, const LLVector3 &ray_direction, +bool ray_hemicone(const LLVector3 &ray_point, const LLVector3 &ray_direction, const LLVector3 &cone_tip, const LLVector3 &cone_bottom, const LLVector3 &cone_scale, const LLVector3 &cyl_cut_normal, LLVector3 &intersection, LLVector3 &intersection_normal); diff --git a/indra/llmath/xform.cpp b/indra/llmath/xform.cpp index 8999abda60..838dee0a54 100644 --- a/indra/llmath/xform.cpp +++ b/indra/llmath/xform.cpp @@ -86,7 +86,7 @@ void LLXformMatrix::update() } } -void LLXformMatrix::updateMatrix(BOOL update_bounds) +void LLXformMatrix::updateMatrix(bool update_bounds) { update(); diff --git a/indra/llmath/xform.h b/indra/llmath/xform.h index 96c4ab4d51..a301e4ca47 100644 --- a/indra/llmath/xform.h +++ b/indra/llmath/xform.h @@ -30,12 +30,12 @@ #include "m4math.h" #include "llquaternion.h" -const F32 MAX_OBJECT_Z = 4096.f; // should match REGION_HEIGHT_METERS, Pre-havok4: 768.f -const F32 MIN_OBJECT_Z = -256.f; -const F32 DEFAULT_MAX_PRIM_SCALE = 64.f; -const F32 DEFAULT_MAX_PRIM_SCALE_NO_MESH = 10.f; -const F32 MIN_PRIM_SCALE = 0.01f; -const F32 MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX +constexpr F32 MAX_OBJECT_Z = 4096.f; // should match REGION_HEIGHT_METERS, Pre-havok4: 768.f +constexpr F32 MIN_OBJECT_Z = -256.f; +constexpr F32 DEFAULT_MAX_PRIM_SCALE = 64.f; +constexpr F32 DEFAULT_MAX_PRIM_SCALE_NO_MESH = 10.f; +constexpr F32 MIN_PRIM_SCALE = 0.01f; +constexpr F32 MAX_PRIM_SCALE = 65536.f; // something very high but not near FLT_MAX class LLXform { @@ -52,7 +52,7 @@ protected: LLXform* mParent; U32 mChanged; - BOOL mScaleChildOffset; + bool mScaleChildOffset; public: typedef enum e_changed_flags @@ -78,7 +78,7 @@ public: mScale. setVec(1,1,1); mWorldPosition.clearVec(); mWorldRotation.loadIdentity(); - mScaleChildOffset = FALSE; + mScaleChildOffset = false; } LLXform(); @@ -109,13 +109,13 @@ public: void warn(const char* const msg); void setChanged(const U32 bits) { mChanged |= bits; } - BOOL isChanged() const { return mChanged; } - BOOL isChanged(const U32 bits) const { return mChanged & bits; } + bool isChanged() const { return mChanged; } + bool isChanged(const U32 bits) const { return mChanged & bits; } void clearChanged() { mChanged = 0; } void clearChanged(U32 bits) { mChanged &= ~bits; } - void setScaleChildOffset(BOOL scale) { mScaleChildOffset = scale; } - BOOL getScaleChildOffset() { return mScaleChildOffset; } + void setScaleChildOffset(bool scale) { mScaleChildOffset = scale; } + bool getScaleChildOffset() { return mScaleChildOffset; } LLXform* getParent() const { return mParent; } LLXform* getRoot() const; @@ -149,7 +149,7 @@ public: } void update(); - void updateMatrix(BOOL update_bounds = TRUE); + void updateMatrix(bool update_bounds = true); void getMinMax(LLVector3& min,LLVector3& max) const; protected: diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 2e4b013b77..cf7b40dc73 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -243,7 +243,7 @@ LLModel::EModelStatus load_face_from_dom_triangles( n[idx[i+norm_offset]*3+2])); } - BOOL found = FALSE; + bool found = false; LLVolumeFace::VertexMapData::PointMap::iterator point_iter; point_iter = point_map.find(LLVector3(cv.getPosition().getF32ptr())); @@ -498,7 +498,7 @@ LLModel::EModelStatus load_face_from_dom_polylist( cur_idx += idx_stride; - BOOL found = FALSE; + bool found = false; LLVolumeFace::VertexMapData::PointMap::iterator point_iter; LLVector3 pos3(cv.getPosition().getF32ptr()); @@ -510,7 +510,7 @@ LLModel::EModelStatus load_face_from_dom_polylist( { if ((point_iter->second)[k] == cv) { - found = TRUE; + found = true; U32 index = (point_iter->second)[k].mIndex; if (j == 0) { @@ -2266,7 +2266,7 @@ std::map<std::string, LLImportMaterial> LLDAELoader::getMaterials(LLModel* model LLImportMaterial LLDAELoader::profileToMaterial(domProfile_COMMON* material, DAE* dae) { LLImportMaterial mat; - mat.mFullbright = FALSE; + mat.mFullbright = false; daeElement* diffuse = material->getDescendant("diffuse"); if (diffuse) @@ -2351,7 +2351,7 @@ LLImportMaterial LLDAELoader::profileToMaterial(domProfile_COMMON* material, DAE LLColor4 emission_color = getDaeColor(emission); if (((emission_color[0] + emission_color[1] + emission_color[2]) / 3.0) > 0.25) { - mat.mFullbright = TRUE; + mat.mFullbright = true; } } diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 0d146de949..e316df1d04 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -427,7 +427,7 @@ bool LLMaterial::operator != (const LLMaterial& rhs) const } -U32 LLMaterial::getShaderMask(U32 alpha_mode, BOOL is_alpha) +U32 LLMaterial::getShaderMask(U32 alpha_mode, bool is_alpha) { //NEVER incorporate this value into the message system -- this function will vary depending on viewer implementation //two least significant bits are "diffuse alpha mode" diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 81f41ddc51..2bed37cbde 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -122,7 +122,7 @@ public: bool operator == (const LLMaterial& rhs) const; bool operator != (const LLMaterial& rhs) const; - U32 getShaderMask(U32 alpha_mode, BOOL is_alpha); + U32 getShaderMask(U32 alpha_mode, bool is_alpha); LLUUID getHash() const; protected: diff --git a/indra/llprimitive/llmaterialtable.cpp b/indra/llprimitive/llmaterialtable.cpp index 58b2d00d44..32fc19efb3 100644 --- a/indra/llprimitive/llmaterialtable.cpp +++ b/indra/llprimitive/llmaterialtable.cpp @@ -341,21 +341,21 @@ void LLMaterialTable::initBasicTable() } } -BOOL LLMaterialTable::add(U8 mcode, const std::string& name, const LLUUID &uuid) +bool LLMaterialTable::add(U8 mcode, const std::string& name, const LLUUID &uuid) { LLMaterialInfo *infop; infop = new LLMaterialInfo(mcode,name,uuid); - if (!infop) return FALSE; + if (!infop) return false; // Add at the end so the order in menus matches the order in this // file. JNC 11.30.01 mMaterialInfoList.push_back(infop); - return TRUE; + return true; } -BOOL LLMaterialTable::addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid) +bool LLMaterialTable::addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid) { if (mCollisionSoundMatrix && (mcode < LL_MCODE_END) && (mcode2 < LL_MCODE_END)) { @@ -365,10 +365,10 @@ BOOL LLMaterialTable::addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid) mCollisionSoundMatrix[mcode2 * LL_MCODE_END + mcode] = uuid; } } - return TRUE; + return true; } -BOOL LLMaterialTable::addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid) +bool LLMaterialTable::addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid) { if (mSlidingSoundMatrix && (mcode < LL_MCODE_END) && (mcode2 < LL_MCODE_END)) { @@ -378,10 +378,10 @@ BOOL LLMaterialTable::addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid) mSlidingSoundMatrix[mcode2 * LL_MCODE_END + mcode] = uuid; } } - return TRUE; + return true; } -BOOL LLMaterialTable::addRollingSound(U8 mcode, U8 mcode2, const LLUUID &uuid) +bool LLMaterialTable::addRollingSound(U8 mcode, U8 mcode2, const LLUUID &uuid) { if (mRollingSoundMatrix && (mcode < LL_MCODE_END) && (mcode2 < LL_MCODE_END)) { @@ -391,10 +391,10 @@ BOOL LLMaterialTable::addRollingSound(U8 mcode, U8 mcode2, const LLUUID &uuid) mRollingSoundMatrix[mcode2 * LL_MCODE_END + mcode] = uuid; } } - return TRUE; + return true; } -BOOL LLMaterialTable::addShatterSound(U8 mcode, const LLUUID &uuid) +bool LLMaterialTable::addShatterSound(U8 mcode, const LLUUID &uuid) { for (info_list_t::iterator iter = mMaterialInfoList.begin(); iter != mMaterialInfoList.end(); ++iter) @@ -403,14 +403,14 @@ BOOL LLMaterialTable::addShatterSound(U8 mcode, const LLUUID &uuid) if (mcode == infop->mMCode) { infop->mShatterSoundID = uuid; - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL LLMaterialTable::addDensity(U8 mcode, const F32 &density) +bool LLMaterialTable::addDensity(U8 mcode, const F32 &density) { for (info_list_t::iterator iter = mMaterialInfoList.begin(); iter != mMaterialInfoList.end(); ++iter) @@ -419,14 +419,14 @@ BOOL LLMaterialTable::addDensity(U8 mcode, const F32 &density) if (mcode == infop->mMCode) { infop->mDensity = density; - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL LLMaterialTable::addRestitution(U8 mcode, const F32 &restitution) +bool LLMaterialTable::addRestitution(U8 mcode, const F32 &restitution) { for (info_list_t::iterator iter = mMaterialInfoList.begin(); iter != mMaterialInfoList.end(); ++iter) @@ -435,14 +435,14 @@ BOOL LLMaterialTable::addRestitution(U8 mcode, const F32 &restitution) if (mcode == infop->mMCode) { infop->mRestitution = restitution; - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL LLMaterialTable::addFriction(U8 mcode, const F32 &friction) +bool LLMaterialTable::addFriction(U8 mcode, const F32 &friction) { for (info_list_t::iterator iter = mMaterialInfoList.begin(); iter != mMaterialInfoList.end(); ++iter) @@ -451,14 +451,14 @@ BOOL LLMaterialTable::addFriction(U8 mcode, const F32 &friction) if (mcode == infop->mMCode) { infop->mFriction = friction; - return TRUE; + return true; } } - return FALSE; + return false; } -BOOL LLMaterialTable::addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod) +bool LLMaterialTable::addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod) { for (info_list_t::iterator iter = mMaterialInfoList.begin(); iter != mMaterialInfoList.end(); ++iter) @@ -469,11 +469,11 @@ BOOL LLMaterialTable::addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 infop->mHPModifier = hp_mod; infop->mDamageModifier = damage_mod; infop->mEPModifier = ep_mod; - return TRUE; + return true; } } - return FALSE; + return false; } LLUUID LLMaterialTable::getDefaultTextureID(const std::string& name) diff --git a/indra/llprimitive/llmaterialtable.h b/indra/llprimitive/llmaterialtable.h index 0cf5e626ef..61a4cf2470 100644 --- a/indra/llprimitive/llmaterialtable.h +++ b/indra/llprimitive/llmaterialtable.h @@ -106,15 +106,15 @@ public: void initTableTransNames(std::map<std::string, std::string> namemap); - BOOL add(U8 mcode, const std::string& name, const LLUUID &uuid); - BOOL addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid); - BOOL addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); - BOOL addRollingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); - BOOL addShatterSound(U8 mcode, const LLUUID &uuid); - BOOL addDensity(U8 mcode, const F32 &density); - BOOL addFriction(U8 mcode, const F32 &friction); - BOOL addRestitution(U8 mcode, const F32 &restitution); - BOOL addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod); + bool add(U8 mcode, const std::string& name, const LLUUID &uuid); + bool addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid); + bool addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); + bool addRollingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); + bool addShatterSound(U8 mcode, const LLUUID &uuid); + bool addDensity(U8 mcode, const F32 &density); + bool addFriction(U8 mcode, const F32 &friction); + bool addRestitution(U8 mcode, const F32 &restitution); + bool addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod); LLUUID getDefaultTextureID(const std::string& name); // LLUUID::null if not found LLUUID getDefaultTextureID(U8 mcode); // LLUUID::null if not found diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 99a5697a84..ee6387608e 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -662,11 +662,11 @@ LLSD LLModel::writeModel( LLModel* low, LLModel* impostor, const LLModel::Decomposition& decomp, - BOOL upload_skin, - BOOL upload_joints, - BOOL lock_scale_if_joint_position, - BOOL nowrite, - BOOL as_slm, + bool upload_skin, + bool upload_joints, + bool lock_scale_if_joint_position, + bool nowrite, + bool as_slm, int submodel_id) { LLSD mdl; @@ -947,7 +947,7 @@ LLSD LLModel::writeModel( return writeModelToStream(ostr, mdl, nowrite, as_slm); } -LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite, BOOL as_slm) +LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, bool nowrite, bool as_slm) { std::string::size_type cur_offset = 0; diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 4505d6b3b9..f6c0061b3e 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -162,17 +162,17 @@ public: LLModel* low, LLModel* imposotr, const LLModel::Decomposition& decomp, - BOOL upload_skin, - BOOL upload_joints, - BOOL lock_scale_if_joint_position, - BOOL nowrite = FALSE, - BOOL as_slm = FALSE, + bool upload_skin, + bool upload_joints, + bool lock_scale_if_joint_position, + bool nowrite = false, + bool as_slm = false, int submodel_id = 0); static LLSD writeModelToStream( std::ostream& ostr, LLSD& mdl, - BOOL nowrite = FALSE, BOOL as_slm = FALSE); + bool nowrite = false, bool as_slm = false); void ClearFacesAndMaterials() { mVolumeFaces.clear(); mMaterialList.clear(); } diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index fc826727e1..f1bd53cdc8 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -37,7 +37,7 @@ std::list<LLModelLoader*> LLModelLoader::sActiveLoaderList; -void stretch_extents(LLModel* model, LLMatrix4a& mat, LLVector4a& min, LLVector4a& max, BOOL& first_transform) +void stretch_extents(LLModel* model, LLMatrix4a& mat, LLVector4a& min, LLVector4a& max, bool& first_transform) { LLVector4a box[] = { @@ -74,7 +74,7 @@ void stretch_extents(LLModel* model, LLMatrix4a& mat, LLVector4a& min, LLVector4 if (first_transform) { - first_transform = FALSE; + first_transform = false; min = max = v; } else @@ -85,7 +85,7 @@ void stretch_extents(LLModel* model, LLMatrix4a& mat, LLVector4a& min, LLVector4 } } -void stretch_extents(LLModel* model, LLMatrix4& mat, LLVector3& min, LLVector3& max, BOOL& first_transform) +void stretch_extents(LLModel* model, LLMatrix4& mat, LLVector3& min, LLVector3& max, bool& first_transform) { LLVector4a mina, maxa; LLMatrix4a mata; @@ -121,7 +121,7 @@ LLModelLoader::LLModelLoader( , mFilename(filename) , mLod(lod) , mTrySLM(false) -, mFirstTransform(TRUE) +, mFirstTransform(true) , mNumOfFetchingTextures(0) , mLoadCallback(load_cb) , mJointLookupFunc(joint_lookup_func) @@ -337,7 +337,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename) //convert instance_list to mScene - mFirstTransform = TRUE; + mFirstTransform = true; for (U32 i = 0; i < instance_list.size(); ++i) { LLModelInstance& cur_instance = instance_list[i]; @@ -478,7 +478,7 @@ bool LLModelLoader::isRigSuitableForJointPositionUpload( const std::vector<std:: //called in the main thread void LLModelLoader::loadTextures() { - BOOL is_paused = isPaused() ; + bool is_paused = isPaused() ; pause() ; //pause the loader for(scene::iterator iter = mScene.begin(); iter != mScene.end(); ++iter) diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index fbc74554a0..e00dd9668f 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -104,7 +104,7 @@ public: S32 mLod; LLMatrix4 mTransform; - BOOL mFirstTransform; + bool mFirstTransform; LLVector3 mExtents[2]; bool mTrySLM; @@ -215,7 +215,7 @@ protected: static bool isAlive(LLModelLoader* loader) ; }; class LLMatrix4a; -void stretch_extents(LLModel* model, LLMatrix4a& mat, LLVector4a& min, LLVector4a& max, BOOL& first_transform); -void stretch_extents(LLModel* model, LLMatrix4& mat, LLVector3& min, LLVector3& max, BOOL& first_transform); +void stretch_extents(LLModel* model, LLMatrix4a& mat, LLVector4a& min, LLVector4a& max, bool& first_transform); +void stretch_extents(LLModel* model, LLMatrix4& mat, LLVector3& min, LLVector3& max, bool& first_transform); #endif // LL_LLMODELLOADER_H diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 904747af2d..8c9076bd8b 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -115,8 +115,8 @@ const F32 FLEXIBLE_OBJECT_MAX_WIND_SENSITIVITY = 10.0f; const F32 FLEXIBLE_OBJECT_MAX_INTERNAL_TENSION_FORCE = 0.99f; const F32 FLEXIBLE_OBJECT_DEFAULT_LENGTH = 1.0f; -const BOOL FLEXIBLE_OBJECT_DEFAULT_USING_COLLISION_SPHERE = FALSE; -const BOOL FLEXIBLE_OBJECT_DEFAULT_RENDERING_COLLISION_SPHERE = FALSE; +const bool FLEXIBLE_OBJECT_DEFAULT_USING_COLLISION_SPHERE = false; +const bool FLEXIBLE_OBJECT_DEFAULT_RENDERING_COLLISION_SPHERE = false; const char *SCULPT_DEFAULT_TEXTURE = "be293869-d0d9-0a69-5989-ad27f1946fd4"; // old inverted texture: "7595d345-a24c-e7ef-f0bd-78793792133e"; @@ -172,7 +172,7 @@ void LLPrimitive::setVolumeManager( LLVolumeMgr* volume_manager ) // static bool LLPrimitive::cleanupVolumeManager() { - BOOL res = FALSE; + bool res = false; if (sVolumeManager) { res = sVolumeManager->cleanup(); @@ -770,16 +770,16 @@ S32 face_index_from_id(LLFaceID face_ID, const std::vector<LLProfile::Face>& fac return -1; } -BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume) +bool LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume) { if (NO_LOD == detail) { // build the new object setChanged(GEOMETRY); sVolumeManager->unrefVolume(mVolumep); - mVolumep = new LLVolume(volume_params, 1, TRUE, TRUE); + mVolumep = new LLVolume(volume_params, 1, true, true); setNumTEs(mVolumep->getNumFaces()); - return FALSE; + return false; } LLVolume *volumep; @@ -788,9 +788,9 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai F32 volume_detail = LLVolumeLODGroup::getVolumeScaleFromDetail(detail); if (mVolumep.notNull() && volume_params == mVolumep->getParams() && (volume_detail == mVolumep->getDetail())) { - return FALSE; + return false; } - volumep = new LLVolume(volume_params, volume_detail, FALSE, TRUE); + volumep = new LLVolume(volume_params, volume_detail, false, true); } else { @@ -799,7 +799,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai F32 volume_detail = LLVolumeLODGroup::getVolumeScaleFromDetail(detail); if (volume_params == mVolumep->getParams() && (volume_detail == mVolumep->getDetail())) { - return FALSE; + return false; } } @@ -807,7 +807,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai if (volumep == mVolumep) { sVolumeManager->unrefVolume( volumep ); // LLVolumeMgr::refVolume() creates a reference, but we don't need a second one. - return TRUE; + return true; } } @@ -819,7 +819,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai mVolumep = volumep; //mFaceMask = mVolumep->generateFaceMask(); setNumTEs(mVolumep->getNumFaces()); - return TRUE; + return true; } #if 0 @@ -871,14 +871,14 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai if (old_face_mask == new_face_mask) { // nothing to do - return TRUE; + return true; } if (mVolumep->getNumFaces() == 0 && new_face_mask != 0) { LL_WARNS() << "Object with 0 faces found...INCORRECT!" << LL_ENDL; setNumTEs(mVolumep->getNumFaces()); - return TRUE; + return true; } // initialize face_mapping @@ -1030,19 +1030,19 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai setNumTEs(mVolumep->getNumFaces()); #endif - return TRUE; + return true; } -BOOL LLPrimitive::setMaterial(U8 material) +bool LLPrimitive::setMaterial(U8 material) { if (material != mMaterial) { mMaterial = material; - return TRUE; + return true; } else { - return FALSE; + return false; } } @@ -1058,12 +1058,12 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa for (face_index = last_face_index-1; face_index >= 0; face_index--) { - BOOL already_sent = FALSE; + bool already_sent = false; for (i = face_index+1; i <= last_face_index; i++) { if (!memcmp(data_ptr+(data_size *face_index), data_ptr+(data_size *i), data_size)) { - already_sent = TRUE; + already_sent = true; break; } } @@ -1201,7 +1201,7 @@ namespace // Pack information about all texture entries into container: // { TextureEntry Variable 2 } // Includes information about image ID, color, scale S,T, offset S,T and rotation -BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const +bool LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const { const U32 MAX_TES = 45; @@ -1282,11 +1282,11 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const } mesgsys->addBinaryDataFast(_PREHASH_TextureEntry, packed_buffer, (S32)(cur_ptr - packed_buffer)); - return FALSE; + return true; } -BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const +bool LLPrimitive::packTEMessage(LLDataPacker &dp) const { const U32 MAX_TES = 45; @@ -1367,7 +1367,7 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const } dp.packBinaryData(packed_buffer, (S32)(cur_ptr - packed_buffer), "TextureEntry"); - return FALSE; + return true; } S32 LLPrimitive::parseTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num, LLTEContents& tec) @@ -1484,12 +1484,12 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) { // use a negative block_num to indicate a single-block read (a non-variable block) S32 retval = 0; - const U32 MAX_TES = 45; + constexpr U32 MAX_TES = 45; // Avoid construction of 32 UUIDs per call static LLMaterialID material_ids[MAX_TES]; - const U32 MAX_TE_BUFFER = 4096; + constexpr U32 MAX_TE_BUFFER = 4096; U8 packed_buffer[MAX_TE_BUFFER]; memset((void*)packed_buffer, 0, MAX_TE_BUFFER); @@ -1685,7 +1685,7 @@ bool LLPrimitive::getTESTAxes(const U8 face, U32* s_axis, U32* t_axis) //============================================================================ //static -BOOL LLNetworkData::isValid(U16 param_type, U32 size) +bool LLNetworkData::isValid(U16 param_type, U32 size) { // ew - better mechanism needed @@ -1707,7 +1707,7 @@ BOOL LLNetworkData::isValid(U16 param_type, U32 size) return (size == 9); } - return FALSE; + return false; } //============================================================================ @@ -1722,17 +1722,17 @@ LLLightParams::LLLightParams() mType = PARAMS_LIGHT; } -BOOL LLLightParams::pack(LLDataPacker &dp) const +bool LLLightParams::pack(LLDataPacker &dp) const { LLColor4U color4u(mColor); dp.packColor4U(color4u, "color"); dp.packF32(mRadius, "radius"); dp.packF32(mCutoff, "cutoff"); dp.packF32(mFalloff, "falloff"); - return TRUE; + return true; } -BOOL LLLightParams::unpack(LLDataPacker &dp) +bool LLLightParams::unpack(LLDataPacker &dp) { LLColor4U color; dp.unpackColor4U(color, "color"); @@ -1750,7 +1750,7 @@ BOOL LLLightParams::unpack(LLDataPacker &dp) dp.unpackF32(falloff, "falloff"); setFalloff(falloff); - return TRUE; + return true; } bool LLLightParams::operator==(const LLNetworkData& data) const @@ -1830,15 +1830,15 @@ LLReflectionProbeParams::LLReflectionProbeParams() mType = PARAMS_REFLECTION_PROBE; } -BOOL LLReflectionProbeParams::pack(LLDataPacker &dp) const +bool LLReflectionProbeParams::pack(LLDataPacker &dp) const { dp.packF32(mAmbiance, "ambiance"); dp.packF32(mClipDistance, "clip_distance"); dp.packU8(mFlags, "flags"); - return TRUE; + return true; } -BOOL LLReflectionProbeParams::unpack(LLDataPacker &dp) +bool LLReflectionProbeParams::unpack(LLDataPacker &dp) { F32 ambiance; F32 clip_distance; @@ -1851,7 +1851,7 @@ BOOL LLReflectionProbeParams::unpack(LLDataPacker &dp) dp.unpackU8(mFlags, "flags"); - return TRUE; + return true; } bool LLReflectionProbeParams::operator==(const LLNetworkData& data) const @@ -1949,7 +1949,7 @@ LLFlexibleObjectData::LLFlexibleObjectData() mType = PARAMS_FLEXIBLE; } -BOOL LLFlexibleObjectData::pack(LLDataPacker &dp) const +bool LLFlexibleObjectData::pack(LLDataPacker &dp) const { // Custom, uber-svelte pack "softness" in upper bits of tension & drag U8 bit1 = (mSimulateLOD & 2) << 6; @@ -1959,10 +1959,10 @@ BOOL LLFlexibleObjectData::pack(LLDataPacker &dp) const dp.packU8((U8)((mGravity+10.f)*10.01f), "gravity"); dp.packU8((U8)(mWindSensitivity*10.01f), "wind"); dp.packVector3(mUserForce, "userforce"); - return TRUE; + return true; } -BOOL LLFlexibleObjectData::unpack(LLDataPacker &dp) +bool LLFlexibleObjectData::unpack(LLDataPacker &dp) { U8 tension, friction, gravity, wind; U8 bit1, bit2; @@ -1981,7 +1981,7 @@ BOOL LLFlexibleObjectData::unpack(LLDataPacker &dp) { mUserForce.setVec(0.f, 0.f, 0.f); } - return TRUE; + return true; } bool LLFlexibleObjectData::operator==(const LLNetworkData& data) const @@ -2077,15 +2077,15 @@ LLSculptParams::LLSculptParams() mSculptType = LL_SCULPT_TYPE_SPHERE; } -BOOL LLSculptParams::pack(LLDataPacker &dp) const +bool LLSculptParams::pack(LLDataPacker &dp) const { dp.packUUID(mSculptTexture, "texture"); dp.packU8(mSculptType, "type"); - return TRUE; + return true; } -BOOL LLSculptParams::unpack(LLDataPacker &dp) +bool LLSculptParams::unpack(LLDataPacker &dp) { U8 type; LLUUID id; @@ -2093,7 +2093,7 @@ BOOL LLSculptParams::unpack(LLDataPacker &dp) dp.unpackU8(type, "type"); setSculptTexture(id, type); - return TRUE; + return true; } bool LLSculptParams::operator==(const LLNetworkData& data) const @@ -2177,20 +2177,20 @@ LLLightImageParams::LLLightImageParams() mParams.setVec(F_PI*0.5f, 0.f, 0.f); } -BOOL LLLightImageParams::pack(LLDataPacker &dp) const +bool LLLightImageParams::pack(LLDataPacker &dp) const { dp.packUUID(mLightTexture, "texture"); dp.packVector3(mParams, "params"); - return TRUE; + return true; } -BOOL LLLightImageParams::unpack(LLDataPacker &dp) +bool LLLightImageParams::unpack(LLDataPacker &dp) { dp.unpackUUID(mLightTexture, "texture"); dp.unpackVector3(mParams, "params"); - return TRUE; + return true; } bool LLLightImageParams::operator==(const LLNetworkData& data) const @@ -2253,18 +2253,18 @@ LLExtendedMeshParams::LLExtendedMeshParams() mFlags = 0; } -BOOL LLExtendedMeshParams::pack(LLDataPacker &dp) const +bool LLExtendedMeshParams::pack(LLDataPacker &dp) const { dp.packU32(mFlags, "flags"); - return TRUE; + return true; } -BOOL LLExtendedMeshParams::unpack(LLDataPacker &dp) +bool LLExtendedMeshParams::unpack(LLDataPacker &dp) { dp.unpackU32(mFlags, "flags"); - return TRUE; + return true; } bool LLExtendedMeshParams::operator==(const LLNetworkData& data) const @@ -2316,7 +2316,7 @@ LLRenderMaterialParams::LLRenderMaterialParams() mType = PARAMS_RENDER_MATERIAL; } -BOOL LLRenderMaterialParams::pack(LLDataPacker& dp) const +bool LLRenderMaterialParams::pack(LLDataPacker& dp) const { U8 count = (U8)llmin((S32)mEntries.size(), 14); //limited to 255 bytes, no more than 14 material ids @@ -2327,10 +2327,10 @@ BOOL LLRenderMaterialParams::pack(LLDataPacker& dp) const dp.packUUID(entry.id, "id"); } - return TRUE; + return true; } -BOOL LLRenderMaterialParams::unpack(LLDataPacker& dp) +bool LLRenderMaterialParams::unpack(LLDataPacker& dp) { U8 count; dp.unpackU8(count, "count"); @@ -2341,7 +2341,7 @@ BOOL LLRenderMaterialParams::unpack(LLDataPacker& dp) dp.unpackUUID(entry.id, "te_id"); } - return TRUE; + return true; } bool LLRenderMaterialParams::operator==(const LLNetworkData& data) const diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 0b7dbd703a..45307d567c 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -114,11 +114,11 @@ public: public: U16 mType; virtual ~LLNetworkData() {}; - virtual BOOL pack(LLDataPacker &dp) const = 0; - virtual BOOL unpack(LLDataPacker &dp) = 0; + virtual bool pack(LLDataPacker &dp) const = 0; + virtual bool unpack(LLDataPacker &dp) = 0; virtual bool operator==(const LLNetworkData& data) const = 0; virtual void copy(const LLNetworkData& data) = 0; - static BOOL isValid(U16 param_type, U32 size); + static bool isValid(U16 param_type, U32 size); }; extern const F32 LIGHT_MIN_RADIUS; @@ -141,8 +141,8 @@ private: public: LLLightParams(); - /*virtual*/ BOOL pack(LLDataPacker &dp) const; - /*virtual*/ BOOL unpack(LLDataPacker &dp); + /*virtual*/ bool pack(LLDataPacker &dp) const; + /*virtual*/ bool unpack(LLDataPacker &dp); /*virtual*/ bool operator==(const LLNetworkData& data) const; /*virtual*/ void copy(const LLNetworkData& data); // LLSD implementations here are provided by Eddy Stryker. @@ -195,8 +195,8 @@ protected: public: LLReflectionProbeParams(); - /*virtual*/ BOOL pack(LLDataPacker& dp) const; - /*virtual*/ BOOL unpack(LLDataPacker& dp); + /*virtual*/ bool pack(LLDataPacker& dp) const; + /*virtual*/ bool unpack(LLDataPacker& dp); /*virtual*/ bool operator==(const LLNetworkData& data) const; /*virtual*/ void copy(const LLNetworkData& data); // LLSD implementations here are provided by Eddy Stryker. @@ -255,8 +255,8 @@ extern const F32 FLEXIBLE_OBJECT_MAX_WIND_SENSITIVITY; extern const F32 FLEXIBLE_OBJECT_MAX_INTERNAL_TENSION_FORCE; extern const F32 FLEXIBLE_OBJECT_DEFAULT_LENGTH; -extern const BOOL FLEXIBLE_OBJECT_DEFAULT_USING_COLLISION_SPHERE; -extern const BOOL FLEXIBLE_OBJECT_DEFAULT_RENDERING_COLLISION_SPHERE; +extern const bool FLEXIBLE_OBJECT_DEFAULT_USING_COLLISION_SPHERE; +extern const bool FLEXIBLE_OBJECT_DEFAULT_RENDERING_COLLISION_SPHERE; class LLFlexibleObjectData : public LLNetworkData @@ -268,8 +268,8 @@ protected: F32 mWindSensitivity; // interacts with tension, air friction, and gravity F32 mTension; //interacts in complex ways with other parameters LLVector3 mUserForce; // custom user-defined force vector - //BOOL mUsingCollisionSphere; - //BOOL mRenderingCollisionSphere; + //bool mUsingCollisionSphere; + //bool mRenderingCollisionSphere; public: void setSimulateLOD(S32 lod) { mSimulateLOD = llclamp(lod, (S32)FLEXIBLE_OBJECT_MIN_SECTIONS, (S32)FLEXIBLE_OBJECT_MAX_SECTIONS); } @@ -288,8 +288,8 @@ public: //------ the constructor for the structure ------------ LLFlexibleObjectData(); - BOOL pack(LLDataPacker &dp) const; - BOOL unpack(LLDataPacker &dp); + bool pack(LLDataPacker &dp) const; + bool unpack(LLDataPacker &dp); bool operator==(const LLNetworkData& data) const; void copy(const LLNetworkData& data); LLSD asLLSD() const; @@ -307,8 +307,8 @@ protected: public: LLSculptParams(); - /*virtual*/ BOOL pack(LLDataPacker &dp) const; - /*virtual*/ BOOL unpack(LLDataPacker &dp); + /*virtual*/ bool pack(LLDataPacker &dp) const; + /*virtual*/ bool unpack(LLDataPacker &dp); /*virtual*/ bool operator==(const LLNetworkData& data) const; /*virtual*/ void copy(const LLNetworkData& data); LLSD asLLSD() const; @@ -328,8 +328,8 @@ protected: public: LLLightImageParams(); - /*virtual*/ BOOL pack(LLDataPacker &dp) const; - /*virtual*/ BOOL unpack(LLDataPacker &dp); + /*virtual*/ bool pack(LLDataPacker &dp) const; + /*virtual*/ bool unpack(LLDataPacker &dp); /*virtual*/ bool operator==(const LLNetworkData& data) const; /*virtual*/ void copy(const LLNetworkData& data); LLSD asLLSD() const; @@ -353,8 +353,8 @@ public: static const U32 ANIMATED_MESH_ENABLED_FLAG = 0x1 << 0; LLExtendedMeshParams(); - /*virtual*/ BOOL pack(LLDataPacker &dp) const; - /*virtual*/ BOOL unpack(LLDataPacker &dp); + /*virtual*/ bool pack(LLDataPacker &dp) const; + /*virtual*/ bool unpack(LLDataPacker &dp); /*virtual*/ bool operator==(const LLNetworkData& data) const; /*virtual*/ void copy(const LLNetworkData& data); LLSD asLLSD() const; @@ -378,8 +378,8 @@ private: public: LLRenderMaterialParams(); - BOOL pack(LLDataPacker& dp) const override; - BOOL unpack(LLDataPacker& dp) override; + bool pack(LLDataPacker& dp) const override; + bool unpack(LLDataPacker& dp) override; bool operator==(const LLNetworkData& data) const override; void copy(const LLNetworkData& data) override; @@ -392,7 +392,7 @@ public: // This code is not naming-standards compliant. Leaving it like this for // now to make the connection to code in -// BOOL packTEMessage(LLDataPacker &dp) const; +// bool packTEMessage(LLDataPacker &dp) const; // more obvious. This should be refactored to remove the duplication, at which // point we can fix the names as well. // - Vir @@ -454,10 +454,10 @@ public: void setPCode(const LLPCode pcode); const LLVolume *getVolumeConst() const { return mVolumep; } // HACK for Windoze confusion about ostream operator in LLVolume LLVolume *getVolume() const { return mVolumep; } - virtual BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); + virtual bool setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); // Modify texture entry properties - inline BOOL validTE(const U8 te_num) const; + inline bool validTE(const U8 te_num) const; LLTextureEntry* getTE(const U8 te_num) const; virtual void setNumTEs(const U8 num_tes); @@ -486,17 +486,17 @@ public: virtual S32 setTEGlow(const U8 te, const F32 glow); virtual S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID); virtual S32 setTEMaterialParams(const U8 index, const LLMaterialPtr pMaterialParams); - virtual BOOL setMaterial(const U8 material); // returns TRUE if material changed + virtual bool setMaterial(const U8 material); // returns true if material changed virtual void setTESelected(const U8 te, bool sel); LLMaterialPtr getTEMaterialParams(const U8 index); void copyTEs(const LLPrimitive *primitive); S32 packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_face_index, EMsgVariableType type) const; - BOOL packTEMessage(LLMessageSystem *mesgsys) const; - BOOL packTEMessage(LLDataPacker &dp) const; + bool packTEMessage(LLMessageSystem *mesgsys) const; + bool packTEMessage(LLDataPacker &dp) const; S32 unpackTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num); // Variable num of blocks - BOOL unpackTEMessage(LLDataPacker &dp); + S32 unpackTEMessage(LLDataPacker &dp); S32 parseTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num, LLTEContents& tec); S32 applyParsedTEMessage(LLTEContents& tec); @@ -554,9 +554,9 @@ public: // takes the contents of other_list and clears other_list void takeTextureList(LLPrimTextureList& other_list); - inline BOOL isAvatar() const; - inline BOOL isSittingAvatar() const; - inline BOOL isSittingAvatarOnGround() const; + inline bool isAvatar() const; + inline bool isSittingAvatar() const; + inline bool isSittingAvatarOnGround() const; inline bool hasBumpmap() const { return mNumBumpmapTEs > 0;} void setFlags(U32 flags) { mMiscFlags = flags; } @@ -569,10 +569,10 @@ public: static U8 pCodeToLegacy(const LLPCode pcode); static bool getTESTAxes(const U8 face, U32* s_axis, U32* t_axis); - BOOL hasRenderMaterialParams() const; + bool hasRenderMaterialParams() const; - inline static BOOL isPrimitive(const LLPCode pcode); - inline static BOOL isApp(const LLPCode pcode); + inline static bool isPrimitive(const LLPCode pcode); + inline static bool isApp(const LLPCode pcode); private: void updateNumBumpmap(const U8 index, const U8 bump); @@ -598,39 +598,39 @@ public: }; }; -inline BOOL LLPrimitive::isAvatar() const +inline bool LLPrimitive::isAvatar() const { - return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode ) ? TRUE : FALSE; + return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode ) ? true : false; } -inline BOOL LLPrimitive::isSittingAvatar() const +inline bool LLPrimitive::isSittingAvatar() const { // this is only used server-side return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode - && ((getFlags() & (PRIM_FLAG_SITTING | PRIM_FLAG_SITTING_ON_GROUND)) != 0) ) ? TRUE : FALSE; + && ((getFlags() & (PRIM_FLAG_SITTING | PRIM_FLAG_SITTING_ON_GROUND)) != 0) ) ? true : false; } -inline BOOL LLPrimitive::isSittingAvatarOnGround() const +inline bool LLPrimitive::isSittingAvatarOnGround() const { // this is only used server-side return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode - && ((getFlags() & PRIM_FLAG_SITTING_ON_GROUND) != 0) ) ? TRUE : FALSE; + && ((getFlags() & PRIM_FLAG_SITTING_ON_GROUND) != 0) ) ? true : false; } // static -inline BOOL LLPrimitive::isPrimitive(const LLPCode pcode) +inline bool LLPrimitive::isPrimitive(const LLPCode pcode) { LLPCode base_type = pcode & LL_PCODE_BASE_MASK; if (base_type && (base_type < LL_PCODE_APP)) { - return TRUE; + return true; } - return FALSE; + return false; } // static -inline BOOL LLPrimitive::isApp(const LLPCode pcode) +inline bool LLPrimitive::isApp(const LLPCode pcode) { LLPCode base_type = pcode & LL_PCODE_BASE_MASK; @@ -786,7 +786,7 @@ void LLPrimitive::setAcceleration(const F32 x, const F32 y, const F32 z) } #endif // CHECK_FOR_FINITE -inline BOOL LLPrimitive::validTE(const U8 te_num) const +inline bool LLPrimitive::validTE(const U8 te_num) const { return (mNumTEs && te_num < mNumTEs); } diff --git a/indra/llprimitive/lltextureanim.cpp b/indra/llprimitive/lltextureanim.cpp index 7c48e57a1a..8933b3287c 100644 --- a/indra/llprimitive/lltextureanim.cpp +++ b/indra/llprimitive/lltextureanim.cpp @@ -54,38 +54,38 @@ void LLTextureAnim::reset() mRate = 1.f; } -BOOL LLTextureAnim::equals(const LLTextureAnim &other) const +bool LLTextureAnim::equals(const LLTextureAnim &other) const { if (mMode != other.mMode) { - return FALSE; + return false; } if (mFace != other.mFace) { - return FALSE; + return false; } if (mSizeX != other.mSizeX) { - return FALSE; + return false; } if (mSizeY != other.mSizeY) { - return FALSE; + return false; } if (mStart != other.mStart) { - return FALSE; + return false; } if (mLength != other.mLength) { - return FALSE; + return false; } if (mRate != other.mRate) { - return FALSE; + return false; } - return TRUE; + return true; } void LLTextureAnim::packTAMessage(LLMessageSystem *mesgsys) const { diff --git a/indra/llprimitive/lltextureanim.h b/indra/llprimitive/lltextureanim.h index f0d9f9df5c..5c388175f1 100644 --- a/indra/llprimitive/lltextureanim.h +++ b/indra/llprimitive/lltextureanim.h @@ -44,7 +44,7 @@ public: void packTAMessage(LLDataPacker &dp) const; void unpackTAMessage(LLMessageSystem *mesgsys, const S32 block_num); void unpackTAMessage(LLDataPacker &dp); - BOOL equals(const LLTextureAnim &other) const; + bool equals(const LLTextureAnim &other) const; LLSD asLLSD() const; operator LLSD() const { return asLLSD(); } bool fromLLSD(LLSD& sd); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1b7c668b7d..c56da0722b 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4663,9 +4663,9 @@ void LLViewerObject::setMediaPassedWhitelist(BOOL passed) } } -BOOL LLViewerObject::setMaterial(const U8 material) +bool LLViewerObject::setMaterial(const U8 material) { - BOOL res = LLPrimitive::setMaterial(material); + bool res = LLPrimitive::setMaterial(material); if (res) { setChanged(TEXTURE); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 81413f3976..65328a6e6d 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -370,7 +370,7 @@ public: // void refreshMaterials(); - /*virtual*/ BOOL setMaterial(const U8 material); + /*virtual*/ bool setMaterial(const U8 material); virtual void setTEImage(const U8 te, LLViewerTexture *imagep); // Not derived from LLPrimitive virtual void changeTEImage(S32 index, LLViewerTexture* new_image) ; virtual void changeTENormalMap(S32 index, LLViewerTexture* new_image) ; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a91da62f80..2e0a2c4d54 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -917,9 +917,9 @@ BOOL LLVOVolume::isActive() const return !mStatic; } -BOOL LLVOVolume::setMaterial(const U8 material) +bool LLVOVolume::setMaterial(const U8 material) { - BOOL res = LLViewerObject::setMaterial(material); + bool res = LLViewerObject::setMaterial(material); return res; } @@ -1004,7 +1004,7 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline) return mDrawable; } -BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bool unique_volume) +bool LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bool unique_volume) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME; LLVolumeParams volume_params = params_in; @@ -1012,7 +1012,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo S32 last_lod = mVolumep.notNull() ? LLVolumeLODGroup::getVolumeDetailFromScale(mVolumep->getDetail()) : -1; S32 lod = mLOD; - BOOL is404 = FALSE; + bool is404 = false; if (isSculpted()) { @@ -1024,7 +1024,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo lod = gMeshRepo.getActualMeshLOD(volume_params, lod); if (lod == -1) { - is404 = TRUE; + is404 = true; lod = 0; } } @@ -1128,14 +1128,14 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo } } - return TRUE; + return true; } else if (NO_LOD == lod) { LLSculptIDSize::instance().resetSizeSum(volume_params.getSculptID()); } - return FALSE; + return false; } void LLVOVolume::updateSculptTexture() diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index b8ccc26cad..6c5814932b 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -223,11 +223,11 @@ public: /*virtual*/ S32 setTEScaleT(const U8 te, const F32 t) override; /*virtual*/ S32 setTETexGen(const U8 te, const U8 texgen) override; /*virtual*/ S32 setTEMediaTexGen(const U8 te, const U8 media) override; - /*virtual*/ BOOL setMaterial(const U8 material) override; + /*virtual*/ bool setMaterial(const U8 material) override; void setTexture(const S32 face); S32 getIndexInTex(U32 ch) const {return mIndexInTex[ch];} - /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false) override; + /*virtual*/ bool setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false) override; void updateSculptTexture(); void setIndexInTex(U32 ch, S32 index) { mIndexInTex[ch] = index ;} void sculpt(); diff --git a/indra/test/llpermissions_tut.cpp b/indra/test/llpermissions_tut.cpp index 3006987432..eb237fcae2 100644 --- a/indra/test/llpermissions_tut.cpp +++ b/indra/test/llpermissions_tut.cpp @@ -278,7 +278,7 @@ namespace tut LLPermissions perm; LLUUID agent; LLUUID group("9c8eca51-53d5-42a7-bb58-cef070395db8"); - BOOL set = 1; + bool set = true; U32 bits = 10; ensure("setGroupBits():failed ", perm.setGroupBits(agent,group, set, bits)); ensure("setEveryoneBits():failed ", perm.setEveryoneBits(agent,group, set, bits)); diff --git a/indra/test/llsdmessagebuilder_tut.cpp b/indra/test/llsdmessagebuilder_tut.cpp index fe9ff1cecc..a4806b0a5f 100644 --- a/indra/test/llsdmessagebuilder_tut.cpp +++ b/indra/test/llsdmessagebuilder_tut.cpp @@ -688,13 +688,13 @@ namespace tut template<> template<> void LLSDMessageBuilderTestObject::test<39>() { - BOOL valueTrue = true; - BOOL valueFalse = false; + bool valueTrue = true; + bool valueFalse = false; LLMsgData* md = new LLMsgData("testMessage"); LLMsgBlkData* mbd = new LLMsgBlkData("testBlock", 0); - addValue(mbd, (char *)"testBoolFalse", &valueFalse, MVT_BOOL, sizeof(BOOL)); - addValue(mbd, (char *)"testBoolTrue", &valueTrue, MVT_BOOL, sizeof(BOOL)); + addValue(mbd, (char *)"testBoolFalse", &valueFalse, MVT_BOOL, sizeof(bool)); + addValue(mbd, (char *)"testBoolTrue", &valueTrue, MVT_BOOL, sizeof(bool)); md->addBlock(mbd); LLSDMessageBuilder builder = defaultBuilder(); diff --git a/indra/test/llsdmessagereader_tut.cpp b/indra/test/llsdmessagereader_tut.cpp index b9949fe426..0ada5b8132 100644 --- a/indra/test/llsdmessagereader_tut.cpp +++ b/indra/test/llsdmessagereader_tut.cpp @@ -73,7 +73,7 @@ namespace tut const std::string& block, const std::string& var, S32 blocknum, - BOOL expected) + bool expected) { LLSDMessageReader msg; msg.setMessage("fakename", msg_data); @@ -118,8 +118,8 @@ namespace tut { LLSD message = LLSD::emptyMap(); message["block1"] = LLSD::emptyArray(); - BOOL bool_true = TRUE; - BOOL bool_false = FALSE; + bool bool_true = true; + bool bool_false = false; message["block1"][0] = LLSD::emptyMap(); message["block1"][0]["BoolField1"] = bool_true; message["block1"][1] = LLSD::emptyMap(); @@ -127,9 +127,9 @@ namespace tut message["block1"][1]["BoolField2"] = bool_true; ensureMessageName("name3", message, "name3"); - ensureBool(message, "block1", "BoolField1", 0, TRUE); - ensureBool(message, "block1", "BoolField1", 1, FALSE); - ensureBool(message, "block1", "BoolField2", 1, TRUE); + ensureBool(message, "block1", "BoolField1", 0, true); + ensureBool(message, "block1", "BoolField1", 1, false); + ensureBool(message, "block1", "BoolField2", 1, true); ensureNumberOfBlocks(message, "block1", 2); ensureMessageSize(message, 0); } |