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 /indra/llprimitive | |
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);
Diffstat (limited to 'indra/llprimitive')
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 10 | ||||
-rw-r--r-- | indra/llprimitive/llmaterial.cpp | 2 | ||||
-rw-r--r-- | indra/llprimitive/llmaterial.h | 2 | ||||
-rw-r--r-- | indra/llprimitive/llmaterialtable.cpp | 48 | ||||
-rw-r--r-- | indra/llprimitive/llmaterialtable.h | 18 | ||||
-rw-r--r-- | indra/llprimitive/llmodel.cpp | 12 | ||||
-rw-r--r-- | indra/llprimitive/llmodel.h | 12 | ||||
-rw-r--r-- | indra/llprimitive/llmodelloader.cpp | 12 | ||||
-rw-r--r-- | indra/llprimitive/llmodelloader.h | 6 | ||||
-rw-r--r-- | indra/llprimitive/llprimitive.cpp | 110 | ||||
-rw-r--r-- | indra/llprimitive/llprimitive.h | 90 | ||||
-rw-r--r-- | indra/llprimitive/lltextureanim.cpp | 18 | ||||
-rw-r--r-- | indra/llprimitive/lltextureanim.h | 2 |
13 files changed, 171 insertions, 171 deletions
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); |