diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-07-27 15:17:57 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-07-28 08:24:59 +0800 |
commit | 96a81b5ecbe3bffb582ded930752c0523df5e80a (patch) | |
tree | a87a0bd09fd980562e88150dbfea3819d28d9f12 /indra/newview/llselectmgr.cpp | |
parent | 06e8f0c443c1ba7858d000c6d695b7e988e02053 (diff) | |
parent | ed73208eb96b862b97fa285036edea1e792ca3c6 (diff) |
Merge remote-tracking branch 'secondlife/release/2024.06-atlasaurus' into 2024.06-atlasaurus
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 786 |
1 files changed, 394 insertions, 392 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 870cd394ee..aed35939a6 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -112,14 +112,14 @@ const S32 MAX_CHILDREN_PER_TASK = 255; // Globals // -//BOOL gDebugSelectMgr = FALSE; +//bool gDebugSelectMgr = false; -//BOOL gHideSelectedObjects = FALSE; -//BOOL gAllowSelectAvatar = FALSE; +//bool gHideSelectedObjects = false; +//bool gAllowSelectAvatar = false; -BOOL LLSelectMgr::sRectSelectInclusive = TRUE; -BOOL LLSelectMgr::sRenderHiddenSelections = TRUE; -BOOL LLSelectMgr::sRenderLightRadius = FALSE; +bool LLSelectMgr::sRectSelectInclusive = true; +bool LLSelectMgr::sRenderHiddenSelections = true; +bool LLSelectMgr::sRenderLightRadius = false; F32 LLSelectMgr::sHighlightThickness = 0.f; F32 LLSelectMgr::sHighlightUScale = 0.f; F32 LLSelectMgr::sHighlightVScale = 0.f; @@ -213,12 +213,12 @@ void LLSelectMgr::cleanupGlobals() // LLSelectMgr() //----------------------------------------------------------------------------- LLSelectMgr::LLSelectMgr() - : mHideSelectedObjects(LLCachedControl<bool>(gSavedSettings, "HideSelectedObjects", FALSE)), - mRenderHighlightSelections(LLCachedControl<bool>(gSavedSettings, "RenderHighlightSelections", TRUE)), - mAllowSelectAvatar( LLCachedControl<bool>(gSavedSettings, "AllowSelectAvatar", FALSE)), - mDebugSelectMgr(LLCachedControl<bool>(gSavedSettings, "DebugSelectMgr", FALSE)) + : mHideSelectedObjects(LLCachedControl<bool>(gSavedSettings, "HideSelectedObjects", false)), + mRenderHighlightSelections(LLCachedControl<bool>(gSavedSettings, "RenderHighlightSelections", true)), + mAllowSelectAvatar( LLCachedControl<bool>(gSavedSettings, "AllowSelectAvatar", false)), + mDebugSelectMgr(LLCachedControl<bool>(gSavedSettings, "DebugSelectMgr", false)) { - mTEMode = FALSE; + mTEMode = false; mTextureChannel = LLRender::DIFFUSE_MAP; mLastCameraPos.clearVec(); @@ -239,7 +239,7 @@ LLSelectMgr::LLSelectMgr() sRenderLightRadius = gSavedSettings.getBOOL("RenderLightRadius"); - mRenderSilhouettes = TRUE; + mRenderSilhouettes = true; mGridMode = GRID_MODE_WORLD; gSavedSettings.setS32("GridMode", (S32)GRID_MODE_WORLD); @@ -248,8 +248,8 @@ LLSelectMgr::LLSelectMgr() mHoverObjects = new LLObjectSelection(); mHighlightedObjects = new LLObjectSelection(); - mForceSelection = FALSE; - mShowSelection = FALSE; + mForceSelection = false; + mShowSelection = false; } @@ -481,7 +481,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S3 // Place it in the list and tag it. // This will refresh dialogs. - addAsIndividual(object, face, TRUE, gltf_node, gltf_primitive); + addAsIndividual(object, face, true, gltf_node, gltf_primitive); // Stop the object from moving (this anticipates changes on the // simulator in LLTask::userSelect) @@ -519,7 +519,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S3 //----------------------------------------------------------------------------- // Select the object, parents and children. //----------------------------------------------------------------------------- -LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end, BOOL ignore_select_owned) +LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, bool add_to_end, bool ignore_select_owned) { llassert( obj ); @@ -582,7 +582,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, // leave component mode if (gSavedSettings.getBOOL("EditLinkedParts")) { - gSavedSettings.setBOOL("EditLinkedParts", FALSE); + gSavedSettings.setBOOL("EditLinkedParts", false); promoteSelectionToRoot(); } @@ -600,7 +600,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, // Select the object, parents and children. //----------------------------------------------------------------------------- LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const std::vector<LLViewerObject*>& object_list, - BOOL send_to_sim) + bool send_to_sim) { // Collect all of the objects, children included std::vector<LLViewerObject*> objects; @@ -652,7 +652,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const std::vector<LLV // leave component mode if (gSavedSettings.getBOOL("EditLinkedParts")) { - gSavedSettings.setBOOL("EditLinkedParts", FALSE); + gSavedSettings.setBOOL("EditLinkedParts", false); promoteSelectionToRoot(); } @@ -670,9 +670,9 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const std::vector<LLV // handles informing the current tool of the object's deletion. // // Caller needs to call dialog_refresh_all if necessary. -BOOL LLSelectMgr::removeObjectFromSelections(const LLUUID &id) +bool LLSelectMgr::removeObjectFromSelections(const LLUUID &id) { - BOOL object_found = FALSE; + bool object_found = false; LLTool *tool = NULL; tool = LLToolMgr::getInstance()->getCurrentTool(); @@ -682,7 +682,7 @@ BOOL LLSelectMgr::removeObjectFromSelections(const LLUUID &id) if( tool_editing_object && tool_editing_object->mID == id) { tool->stopEditing(); - object_found = TRUE; + object_found = true; } // Iterate through selected objects list and kill the object @@ -701,15 +701,15 @@ BOOL LLSelectMgr::removeObjectFromSelections(const LLUUID &id) } // lose the selection, don't tell simulator, it knows - deselectObjectAndFamily(object, FALSE); - object_found = TRUE; + deselectObjectAndFamily(object, false); + object_found = true; break; // must break here, may have removed multiple objects from list } else if (object->isAvatar() && object->getParent() && ((LLViewerObject*)object->getParent())->mID == id) { // It's possible the item being removed has an avatar sitting on it // So remove the avatar that is sitting on the object. - deselectObjectAndFamily(object, FALSE); + deselectObjectAndFamily(object, false); break; // must break here, may have removed multiple objects from list } } @@ -862,7 +862,7 @@ bool LLSelectMgr::enableUnlinkObjects() return new_value; } -void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_sim, BOOL include_entire_object) +void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, bool send_to_sim, bool include_entire_object) { // bail if nothing selected or if object wasn't selected in the first place if(!object) return; @@ -904,7 +904,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s //----------------------------------------------------------- LLViewerRegion* regionp = object->getRegion(); - BOOL start_new_message = TRUE; + bool start_new_message = true; S32 select_count = 0; LLMessageSystem* msg = gMessageSystem; @@ -917,7 +917,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); select_count++; - start_new_message = FALSE; + start_new_message = false; } msg->nextBlockFast(_PREHASH_ObjectData); @@ -932,7 +932,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s { msg->sendReliable(regionp->getHost() ); select_count = 0; - start_new_message = TRUE; + start_new_message = true; } } @@ -945,7 +945,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s updateSelectionCenter(); } -void LLSelectMgr::deselectObjectOnly(LLViewerObject* object, BOOL send_to_sim) +void LLSelectMgr::deselectObjectOnly(LLViewerObject* object, bool send_to_sim) { // bail if nothing selected or if object wasn't selected in the first place if (!object) return; @@ -979,7 +979,7 @@ void LLSelectMgr::deselectObjectOnly(LLViewerObject* object, BOOL send_to_sim) // addAsFamily //----------------------------------------------------------------------------- -void LLSelectMgr::addAsFamily(std::vector<LLViewerObject*>& objects, BOOL add_to_end) +void LLSelectMgr::addAsFamily(std::vector<LLViewerObject*>& objects, bool add_to_end) { for (std::vector<LLViewerObject*>::iterator iter = objects.begin(); iter != objects.end(); ++iter) @@ -995,7 +995,7 @@ void LLSelectMgr::addAsFamily(std::vector<LLViewerObject*>& objects, BOOL add_to if (!objectp->isSelected()) { - LLSelectNode *nodep = new LLSelectNode(objectp, TRUE); + LLSelectNode *nodep = new LLSelectNode(objectp, true); if (add_to_end) { mSelectedObjects->addNodeAtEnd(nodep); @@ -1004,11 +1004,11 @@ void LLSelectMgr::addAsFamily(std::vector<LLViewerObject*>& objects, BOOL add_to { mSelectedObjects->addNode(nodep); } - objectp->setSelected(TRUE); + objectp->setSelected(true); if (objectp->getNumTEs() > 0) { - nodep->selectAllTEs(TRUE); + nodep->selectAllTEs(true); objectp->setAllTESelected(true); } else @@ -1023,7 +1023,7 @@ void LLSelectMgr::addAsFamily(std::vector<LLViewerObject*>& objects, BOOL add_to LLSelectNode* select_node = mSelectedObjects->findNode(objectp); if (select_node) { - select_node->setTransient(FALSE); + select_node->setTransient(false); } } } @@ -1033,7 +1033,7 @@ void LLSelectMgr::addAsFamily(std::vector<LLViewerObject*>& objects, BOOL add_to //----------------------------------------------------------------------------- // addAsIndividual() - a single object, face, etc //----------------------------------------------------------------------------- -void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoable, S32 gltf_node, S32 gltf_primitive) +void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, bool undoable, S32 gltf_node, S32 gltf_primitive) { // check to see if object is already in list LLSelectNode *nodep = mSelectedObjects->findNode(objectp); @@ -1041,23 +1041,23 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab // if not in list, add it if (!nodep) { - nodep = new LLSelectNode(objectp, TRUE); + nodep = new LLSelectNode(objectp, true); mSelectedObjects->addNode(nodep); llassert_always(nodep->getObject()); } else { // make this a full-fledged selection - nodep->setTransient(FALSE); + nodep->setTransient(false); // Move it to the front of the list mSelectedObjects->moveNodeToFront(nodep); } // Make sure the object is tagged as selected - objectp->setSelected( TRUE ); + objectp->setSelected( true ); // And make sure we don't consider it as part of a family - nodep->mIndividualSelection = TRUE; + nodep->mIndividualSelection = true; // Handle face selection if (objectp->getNumTEs() <= 0) @@ -1066,12 +1066,12 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab } else if (face == SELECT_ALL_TES) { - nodep->selectAllTEs(TRUE); + nodep->selectAllTEs(true); objectp->setAllTESelected(true); } else if (0 <= face && face < SELECT_MAX_TES) { - nodep->selectTE(face, TRUE); + nodep->selectTE(face, true); objectp->setTESelected(face, true); } else @@ -1083,7 +1083,7 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab // Handle glTF node selection if (gltf_node >= 0) { - nodep->selectGLTFNode(gltf_node, gltf_primitive, TRUE); + nodep->selectGLTFNode(gltf_node, gltf_primitive, true); } @@ -1138,8 +1138,8 @@ LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp, S32 { continue; } - LLSelectNode* nodep = new LLSelectNode(cur_objectp, FALSE); - nodep->selectTE(face, TRUE); + LLSelectNode* nodep = new LLSelectNode(cur_objectp, false); + nodep->selectTE(face, true); mHoverObjects->addNodeAtEnd(nodep); } @@ -1302,7 +1302,7 @@ LLObjectSelectionHandle LLSelectMgr::selectHighlightedObjects() mSelectedObjects->addNode(new_nodep); // flag this object as selected - objectp->setSelected(TRUE); + objectp->setSelected(true); objectp->setAllTESelected(true); mSelectedObjects->mSelectType = getSelectTypeForObject(objectp); @@ -1331,7 +1331,7 @@ LLObjectSelectionHandle LLSelectMgr::selectHighlightedObjects() void LLSelectMgr::deselectHighlightedObjects() { - BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); + bool select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); for (std::set<LLPointer<LLViewerObject> >::iterator iter = mRectSelectedObjects.begin(); iter != mRectSelectedObjects.end(); iter++) { @@ -1355,7 +1355,7 @@ void LLSelectMgr::deselectHighlightedObjects() void LLSelectMgr::addGridObject(LLViewerObject* objectp) { - LLSelectNode* nodep = new LLSelectNode(objectp, FALSE); + LLSelectNode* nodep = new LLSelectNode(objectp, false); mGridObjects.addNodeAtEnd(nodep); LLViewerObject::const_child_list_t& child_list = objectp->getChildren(); @@ -1363,7 +1363,7 @@ void LLSelectMgr::addGridObject(LLViewerObject* objectp) iter != child_list.end(); iter++) { LLViewerObject* child = *iter; - nodep = new LLSelectNode(child, FALSE); + nodep = new LLSelectNode(child, false); mGridObjects.addNodeAtEnd(nodep); } } @@ -1417,7 +1417,7 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & LLVector4a min_extents(F32_MAX); LLVector4a max_extents(-F32_MAX); - BOOL grid_changed = FALSE; + bool grid_changed = false; for (LLObjectSelection::iterator iter = mGridObjects.begin(); iter != mGridObjects.end(); ++iter) { @@ -1428,7 +1428,7 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & const LLVector4a* ext = drawable->getSpatialExtents(); update_min_max(min_extents, max_extents, ext[0]); update_min_max(min_extents, max_extents, ext[1]); - grid_changed = TRUE; + grid_changed = true; } } if (grid_changed) @@ -1450,7 +1450,7 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & } else // GRID_MODE_WORLD or just plain default { - const BOOL non_root_ok = TRUE; + const bool non_root_ok = true; LLViewerObject* first_object = mSelectedObjects->getFirstRootObject(non_root_ok); mGridOrigin.clearVec(); @@ -1498,7 +1498,7 @@ void LLSelectMgr::remove(std::vector<LLViewerObject*>& objects) LLSelectNode* nodep = mSelectedObjects->findNode(objectp); if (nodep) { - objectp->setSelected(FALSE); + objectp->setSelected(false); mSelectedObjects->removeNode(nodep); nodep = NULL; } @@ -1511,7 +1511,7 @@ void LLSelectMgr::remove(std::vector<LLViewerObject*>& objects) //----------------------------------------------------------------------------- // remove() - a single object //----------------------------------------------------------------------------- -void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable) +void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, bool undoable) { // get object node (and verify it is in the selected list) LLSelectNode *nodep = mSelectedObjects->findNode(objectp); @@ -1526,14 +1526,14 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable) // Remove all faces (or the object doesn't have faces) so remove the node mSelectedObjects->removeNode(nodep); nodep = NULL; - objectp->setSelected( FALSE ); + objectp->setSelected( false ); } else if (0 <= te && te < SELECT_MAX_TES) { // ...valid face, check to see if it was on if (nodep->isTESelected(te)) { - nodep->selectTE(te, FALSE); + nodep->selectTE(te, false); objectp->setTESelected(te, false); } else @@ -1543,7 +1543,7 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable) } // ...check to see if this operation turned off all faces - BOOL found = FALSE; + bool found = false; for (S32 i = 0; i < nodep->getObject()->getNumTEs(); i++) { found = found || nodep->isTESelected(i); @@ -1554,7 +1554,7 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable) { mSelectedObjects->removeNode(nodep); nodep = NULL; - objectp->setSelected( FALSE ); + objectp->setSelected( false ); // *FIXME: Doesn't update simulator that object is no longer selected } } @@ -1578,7 +1578,7 @@ void LLSelectMgr::removeAll() iter != mSelectedObjects->end(); iter++ ) { LLViewerObject *objectp = (*iter)->getObject(); - objectp->setSelected( FALSE ); + objectp->setSelected( false ); } mSelectedObjects->deleteAllNodes(); @@ -1594,7 +1594,7 @@ void LLSelectMgr::promoteSelectionToRoot() { std::set<LLViewerObject*> selection_set; - BOOL selection_changed = FALSE; + bool selection_changed = false; for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); ) @@ -1605,7 +1605,7 @@ void LLSelectMgr::promoteSelectionToRoot() if (nodep->mIndividualSelection) { - selection_changed = TRUE; + selection_changed = true; } LLViewerObject* parentp = object; @@ -1871,7 +1871,7 @@ bool LLSelectMgr::selectionSetImage(const LLUUID& imageid) if (mItem && objectp->isAttachment()) { const LLPermissions& perm = mItem->getPermissions(); - BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; + bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED; if (!unrestricted) { // Attachments are in world and in inventory simultaneously, @@ -1894,7 +1894,7 @@ bool LLSelectMgr::selectionSetImage(const LLUUID& imageid) // Texture picker defaults aren't inventory items // * Don't need to worry about permissions for them // * Can just apply the texture and be done with it. - objectp->setTEImage(te, LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + objectp->setTEImage(te, LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } return true; @@ -1922,7 +1922,7 @@ bool LLSelectMgr::selectionSetImage(const LLUUID& imageid) { object->sendTEUpdate(); // 1 particle effect per object - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, true); effectp->setSourceObject(gAgentAvatarp); effectp->setTargetObject(object); effectp->setDuration(LL_HUD_DUR_SHORT); @@ -2036,7 +2036,7 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id) if (!mItem) { // 1 particle effect per object - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, true); effectp->setSourceObject(gAgentAvatarp); effectp->setTargetObject(object); effectp->setDuration(LL_HUD_DUR_SHORT); @@ -2194,7 +2194,7 @@ void LLSelectMgr::selectionRevertShinyColors() getSelection()->applyToObjects(&sendfunc); } -BOOL LLSelectMgr::selectionRevertTextures() +bool LLSelectMgr::selectionRevertTextures() { struct f : public LLSelectedTEFunctor { @@ -2212,11 +2212,11 @@ BOOL LLSelectMgr::selectionRevertTextures() if (id.isNull()) { // this was probably a no-copy texture, leave image as-is - return FALSE; + return false; } else { - object->setTEImage(te, LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + object->setTEImage(te, LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } } @@ -2224,7 +2224,7 @@ BOOL LLSelectMgr::selectionRevertTextures() return true; } } setfunc(mSelectedObjects); - BOOL revert_successful = getSelection()->applyToTEs(&setfunc); + bool revert_successful = getSelection()->applyToTEs(&setfunc); LLSelectMgrSendFunctor sendfunc; getSelection()->applyToObjects(&sendfunc); @@ -2299,6 +2299,7 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap, const LLUUID &image_id) LL_WARNS() << "Attempted to apply no-copy texture to multiple objects" << LL_ENDL; return; } + if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())) { LLViewerObject *object = mSelectedObjects->getFirstRootObject(); @@ -2307,8 +2308,8 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap, const LLUUID &image_id) return; } const LLPermissions& perm = item->getPermissions(); - BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; - BOOL attached = object->isAttachment(); + bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED; + bool attached = object->isAttachment(); if (attached && !unrestricted) { // Attachments are in world and in inventory simultaneously, @@ -2371,6 +2372,7 @@ void LLSelectMgr::selectionSetShiny(U8 shiny, const LLUUID &image_id) LL_WARNS() << "Attempted to apply no-copy texture to multiple objects" << LL_ENDL; return; } + if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())) { LLViewerObject *object = mSelectedObjects->getFirstRootObject(); @@ -2379,8 +2381,8 @@ void LLSelectMgr::selectionSetShiny(U8 shiny, const LLUUID &image_id) return; } const LLPermissions& perm = item->getPermissions(); - BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; - BOOL attached = object->isAttachment(); + bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED; + bool attached = object->isAttachment(); if (attached && !unrestricted) { // Attachments are in world and in inventory simultaneously, @@ -2645,9 +2647,9 @@ LLPermissions* LLSelectMgr::findObjectPermissions(const LLViewerObject* object) //----------------------------------------------------------------------------- // selectionGetGlow() //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectionGetGlow(F32 *glow) +bool LLSelectMgr::selectionGetGlow(F32 *glow) { - BOOL identical; + bool identical; F32 lglow = 0.f; struct f1 : public LLSelectedTEGetFunctor<F32> { @@ -2674,7 +2676,7 @@ void LLSelectMgr::selectionSetPhysicsType(U8 type) if (object->permModify()) { object->setPhysicsShapeType(mType); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2693,7 +2695,7 @@ void LLSelectMgr::selectionSetFriction(F32 friction) if (object->permModify()) { object->setPhysicsFriction(mFriction); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2712,7 +2714,7 @@ void LLSelectMgr::selectionSetGravity(F32 gravity ) if (object->permModify()) { object->setPhysicsGravity(mGravity); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2731,7 +2733,7 @@ void LLSelectMgr::selectionSetDensity(F32 density ) if (object->permModify()) { object->setPhysicsDensity(mDensity); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2750,7 +2752,7 @@ void LLSelectMgr::selectionSetRestitution(F32 restitution) if (object->permModify()) { object->setPhysicsRestitution(mRestitution); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2783,8 +2785,8 @@ void LLSelectMgr::selectionSetMaterial(U8 material) getSelection()->applyToObjects(&sendfunc); } -// TRUE if all selected objects have this PCode -BOOL LLSelectMgr::selectionAllPCode(LLPCode code) +// true if all selected objects have this PCode +bool LLSelectMgr::selectionAllPCode(LLPCode code) { struct f : public LLSelectedObjectFunctor { @@ -2794,19 +2796,19 @@ BOOL LLSelectMgr::selectionAllPCode(LLPCode code) { if (object->getPCode() != mCode) { - return FALSE; + return false; } return true; } } func(code); - BOOL res = getSelection()->applyToObjects(&func); + bool res = getSelection()->applyToObjects(&func); return res; } bool LLSelectMgr::selectionGetIncludeInSearch(bool* include_in_search_out) { LLViewerObject *object = mSelectedObjects->getFirstRootObject(); - if (!object) return FALSE; + if (!object) return false; bool include_in_search = object->getIncludeInSearch(); @@ -2846,12 +2848,12 @@ void LLSelectMgr::selectionSetIncludeInSearch(bool include_in_search) SEND_ONLY_ROOTS); } -BOOL LLSelectMgr::selectionGetClickAction(U8 *out_action) +bool LLSelectMgr::selectionGetClickAction(U8 *out_action) { LLViewerObject *object = mSelectedObjects->getFirstObject(); if (!object) { - return FALSE; + return false; } U8 action = object->getClickAction(); @@ -2870,7 +2872,7 @@ BOOL LLSelectMgr::selectionGetClickAction(U8 *out_action) return true; } } func(action); - BOOL res = getSelection()->applyToObjects(&func); + bool res = getSelection()->applyToObjects(&func); return res; } @@ -2998,7 +3000,7 @@ void LLSelectMgr::selectionTexScaleAutofit(F32 repeats_per_meter) U32 s_axis, t_axis; if (!LLPrimitive::getTESTAxes(te, &s_axis, &t_axis)) { - return TRUE; + return true; } F32 new_s = object->getScale().mV[s_axis] * mRepeatsPerMeter; @@ -3023,7 +3025,7 @@ void LLSelectMgr::selectionTexScaleAutofit(F32 repeats_per_meter) //----------------------------------------------------------------------------- // adjustTexturesByScale() //----------------------------------------------------------------------------- -void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch) +void LLSelectMgr::adjustTexturesByScale(bool send_to_sim, bool stretch) { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++) @@ -3046,13 +3048,13 @@ void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch) continue; } - BOOL send = FALSE; + bool send = false; for (U8 te_num = 0; te_num < object->getNumTEs(); te_num++) { const LLTextureEntry* tep = object->getTE(te_num); - BOOL planar = tep->getTexGen() == LLTextureEntry::TEX_GEN_PLANAR; + bool planar = tep->getTexGen() == LLTextureEntry::TEX_GEN_PLANAR; if (planar == stretch) { // Figure out how S,T changed with scale operation @@ -3136,9 +3138,9 @@ void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch) //----------------------------------------------------------------------------- // selectGetAllRootsValid() -// Returns TRUE if the viewer has information on all selected objects +// Returns true if the viewer has information on all selected objects //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetAllRootsValid() +bool LLSelectMgr::selectGetAllRootsValid() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); ++iter ) @@ -3146,18 +3148,18 @@ BOOL LLSelectMgr::selectGetAllRootsValid() LLSelectNode* node = *iter; if( !node->mValid ) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- // selectGetAllValid() -// Returns TRUE if the viewer has information on all selected objects +// Returns true if the viewer has information on all selected objects //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetAllValid() +bool LLSelectMgr::selectGetAllValid() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); ++iter ) @@ -3165,19 +3167,19 @@ BOOL LLSelectMgr::selectGetAllValid() LLSelectNode* node = *iter; if( !node->mValid ) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetAllValidAndObjectsFound() - return TRUE if selections are +// selectGetAllValidAndObjectsFound() - return true if selections are // valid and objects are found. // // For EXT-3114 - same as selectGetModify() without the modify check. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetAllValidAndObjectsFound() +bool LLSelectMgr::selectGetAllValidAndObjectsFound() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3186,17 +3188,17 @@ BOOL LLSelectMgr::selectGetAllValidAndObjectsFound() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetModify() - return TRUE if current agent can modify all +// selectGetModify() - return true if current agent can modify all // selected objects. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetModify() +bool LLSelectMgr::selectGetModify() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3205,21 +3207,21 @@ BOOL LLSelectMgr::selectGetModify() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if( !object->permModify() ) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetRootsModify() - return TRUE if current agent can modify all +// selectGetRootsModify() - return true if current agent can modify all // selected root objects. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsModify() +bool LLSelectMgr::selectGetRootsModify() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3228,30 +3230,30 @@ BOOL LLSelectMgr::selectGetRootsModify() LLViewerObject* object = node->getObject(); if( !node->mValid ) { - return FALSE; + return false; } if( !object->permModify() ) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetSameRegion() - return TRUE if all objects are in same region +// selectGetSameRegion() - return true if all objects are in same region //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetSameRegion() +bool LLSelectMgr::selectGetSameRegion() { if (getSelection()->isEmpty()) { - return TRUE; + return true; } LLViewerObject* object = getSelection()->getFirstObject(); if (!object) { - return FALSE; + return false; } LLViewerRegion* current_region = object->getRegion(); @@ -3262,18 +3264,18 @@ BOOL LLSelectMgr::selectGetSameRegion() object = node->getObject(); if (!node->mValid || !object || current_region != object->getRegion()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetNonPermanentEnforced() - return TRUE if all objects are not +// selectGetNonPermanentEnforced() - return true if all objects are not // permanent enforced //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetNonPermanentEnforced() +bool LLSelectMgr::selectGetNonPermanentEnforced() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3282,21 +3284,21 @@ BOOL LLSelectMgr::selectGetNonPermanentEnforced() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if( object->isPermanentEnforced()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetRootsNonPermanentEnforced() - return TRUE if all root objects are +// selectGetRootsNonPermanentEnforced() - return true if all root objects are // not permanent enforced //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsNonPermanentEnforced() +bool LLSelectMgr::selectGetRootsNonPermanentEnforced() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3305,21 +3307,21 @@ BOOL LLSelectMgr::selectGetRootsNonPermanentEnforced() LLViewerObject* object = node->getObject(); if( !node->mValid ) { - return FALSE; + return false; } if( object->isPermanentEnforced()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetPermanent() - return TRUE if all objects are permanent +// selectGetPermanent() - return true if all objects are permanent //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetPermanent() +bool LLSelectMgr::selectGetPermanent() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3328,21 +3330,21 @@ BOOL LLSelectMgr::selectGetPermanent() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if( !object->flagObjectPermanent()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetRootsPermanent() - return TRUE if all root objects are +// selectGetRootsPermanent() - return true if all root objects are // permanent //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsPermanent() +bool LLSelectMgr::selectGetRootsPermanent() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3351,21 +3353,21 @@ BOOL LLSelectMgr::selectGetRootsPermanent() LLViewerObject* object = node->getObject(); if( !node->mValid ) { - return FALSE; + return false; } if( !object->flagObjectPermanent()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetCharacter() - return TRUE if all objects are character +// selectGetCharacter() - return true if all objects are character //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetCharacter() +bool LLSelectMgr::selectGetCharacter() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3374,21 +3376,21 @@ BOOL LLSelectMgr::selectGetCharacter() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if( !object->flagCharacter()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetRootsCharacter() - return TRUE if all root objects are +// selectGetRootsCharacter() - return true if all root objects are // character //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsCharacter() +bool LLSelectMgr::selectGetRootsCharacter() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3397,21 +3399,21 @@ BOOL LLSelectMgr::selectGetRootsCharacter() LLViewerObject* object = node->getObject(); if( !node->mValid ) { - return FALSE; + return false; } if( !object->flagCharacter()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetNonPathfinding() - return TRUE if all objects are not pathfinding +// selectGetNonPathfinding() - return true if all objects are not pathfinding //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetNonPathfinding() +bool LLSelectMgr::selectGetNonPathfinding() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3420,21 +3422,21 @@ BOOL LLSelectMgr::selectGetNonPathfinding() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if( object->flagObjectPermanent() || object->flagCharacter()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetRootsNonPathfinding() - return TRUE if all root objects are not +// selectGetRootsNonPathfinding() - return true if all root objects are not // pathfinding //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsNonPathfinding() +bool LLSelectMgr::selectGetRootsNonPathfinding() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3443,21 +3445,21 @@ BOOL LLSelectMgr::selectGetRootsNonPathfinding() LLViewerObject* object = node->getObject(); if( !node->mValid ) { - return FALSE; + return false; } if( object->flagObjectPermanent() || object->flagCharacter()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetNonPermanent() - return TRUE if all objects are not permanent +// selectGetNonPermanent() - return true if all objects are not permanent //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetNonPermanent() +bool LLSelectMgr::selectGetNonPermanent() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3466,21 +3468,21 @@ BOOL LLSelectMgr::selectGetNonPermanent() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if( object->flagObjectPermanent()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetRootsNonPermanent() - return TRUE if all root objects are not +// selectGetRootsNonPermanent() - return true if all root objects are not // permanent //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsNonPermanent() +bool LLSelectMgr::selectGetRootsNonPermanent() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3489,21 +3491,21 @@ BOOL LLSelectMgr::selectGetRootsNonPermanent() LLViewerObject* object = node->getObject(); if( !node->mValid ) { - return FALSE; + return false; } if( object->flagObjectPermanent()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetNonCharacter() - return TRUE if all objects are not character +// selectGetNonCharacter() - return true if all objects are not character //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetNonCharacter() +bool LLSelectMgr::selectGetNonCharacter() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3512,21 +3514,21 @@ BOOL LLSelectMgr::selectGetNonCharacter() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if( object->flagCharacter()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetRootsNonCharacter() - return TRUE if all root objects are not +// selectGetRootsNonCharacter() - return true if all root objects are not // character //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsNonCharacter() +bool LLSelectMgr::selectGetRootsNonCharacter() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3535,23 +3537,23 @@ BOOL LLSelectMgr::selectGetRootsNonCharacter() LLViewerObject* object = node->getObject(); if( !node->mValid ) { - return FALSE; + return false; } if( object->flagCharacter()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetEditableLinksets() - return TRUE if all objects are editable +// selectGetEditableLinksets() - return true if all objects are editable // pathfinding linksets //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetEditableLinksets() +bool LLSelectMgr::selectGetEditableLinksets() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3560,7 +3562,7 @@ BOOL LLSelectMgr::selectGetEditableLinksets() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if (object->flagUsePhysics() || object->flagTemporaryOnRez() || @@ -3573,17 +3575,17 @@ BOOL LLSelectMgr::selectGetEditableLinksets() !object->permYouOwner() && !object->permMove())) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetViewableCharacters() - return TRUE if all objects are characters +// selectGetViewableCharacters() - return true if all objects are characters // viewable within the pathfinding characters floater //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetViewableCharacters() +bool LLSelectMgr::selectGetViewableCharacters() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -3592,22 +3594,22 @@ BOOL LLSelectMgr::selectGetViewableCharacters() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if( !object->flagCharacter() || (object->getRegion() != gAgent.getRegion())) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetRootsTransfer() - return TRUE if current agent can transfer all +// selectGetRootsTransfer() - return true if current agent can transfer all // selected root objects. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsTransfer() +bool LLSelectMgr::selectGetRootsTransfer() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3616,21 +3618,21 @@ BOOL LLSelectMgr::selectGetRootsTransfer() LLViewerObject* object = node->getObject(); if( !node->mValid ) { - return FALSE; + return false; } if(!object->permTransfer()) { - return FALSE; + return false; } } - return TRUE; + return true; } //----------------------------------------------------------------------------- -// selectGetRootsCopy() - return TRUE if current agent can copy all +// selectGetRootsCopy() - return true if current agent can copy all // selected root objects. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsCopy() +bool LLSelectMgr::selectGetRootsCopy() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3639,14 +3641,14 @@ BOOL LLSelectMgr::selectGetRootsCopy() LLViewerObject* object = node->getObject(); if( !node->mValid ) { - return FALSE; + return false; } if(!object->permCopy()) { - return FALSE; + return false; } } - return TRUE; + return true; } struct LLSelectGetFirstTest @@ -3729,7 +3731,7 @@ protected: } }; -BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name) +bool LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name) { LLSelectGetFirstCreator test; getFirst(&test); @@ -3737,7 +3739,7 @@ BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name) if (test.mFirstValue.isNull()) { name = LLTrans::getString("AvatarNameNobody"); - return FALSE; + return false; } result_id = test.mFirstValue; @@ -3769,14 +3771,14 @@ protected: } }; -BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name) +bool LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name) { LLSelectGetFirstOwner test; getFirst(&test); if (test.mFirstValue.isNull()) { - return FALSE; + return false; } result_id = test.mFirstValue; @@ -3814,14 +3816,14 @@ protected: } }; -BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, std::string& name) +bool LLSelectMgr::selectGetLastOwner(LLUUID& result_id, std::string& name) { LLSelectGetFirstLastOwner test; getFirst(&test); if (test.mFirstValue.isNull()) { - return FALSE; + return false; } result_id = test.mFirstValue; @@ -3851,7 +3853,7 @@ protected: } }; -BOOL LLSelectMgr::selectGetGroup(LLUUID& result_id) +bool LLSelectMgr::selectGetGroup(LLUUID& result_id) { LLSelectGetFirstGroup test; getFirst(&test); @@ -3863,7 +3865,7 @@ BOOL LLSelectMgr::selectGetGroup(LLUUID& result_id) //----------------------------------------------------------------------------- // selectIsGroupOwned() // Only operates on root nodes unless editing linked parts. -// Returns TRUE if the first selected is group owned. +// Returns true if the first selected is group owned. //----------------------------------------------------------------------------- struct LLSelectGetFirstGroupOwner : public LLSelectGetFirstTest { @@ -3878,29 +3880,29 @@ protected: } }; -BOOL LLSelectMgr::selectIsGroupOwned() +bool LLSelectMgr::selectIsGroupOwned() { LLSelectGetFirstGroupOwner test; getFirst(&test); - return test.mFirstValue.notNull() ? TRUE : FALSE; + return test.mFirstValue.notNull(); } //----------------------------------------------------------------------------- // selectGetPerm() // Only operates on root nodes. -// Returns TRUE if all have valid data. -// mask_on has bits set to TRUE where all permissions are TRUE -// mask_off has bits set to TRUE where all permissions are FALSE +// Returns true if all have valid data. +// mask_on has bits set to true where all permissions are true +// mask_off has bits set to true where all permissions are false // if a bit is off both in mask_on and mask_off, the values differ within // the selection. //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off) +bool LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off) { U32 mask; U32 mask_and = 0xffffffff; U32 mask_or = 0x00000000; - BOOL all_valid = FALSE; + bool all_valid = false; for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++) @@ -3909,11 +3911,11 @@ BOOL LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off) if (!node->mValid) { - all_valid = FALSE; + all_valid = false; break; } - all_valid = TRUE; + all_valid = true; switch( which_perm ) { @@ -3942,26 +3944,26 @@ BOOL LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off) if (all_valid) { - // ...TRUE through all ANDs means all TRUE + // ...true through all ANDs means all true *mask_on = mask_and; - // ...FALSE through all ORs means all FALSE + // ...false through all ORs means all false *mask_off = ~mask_or; - return TRUE; + return true; } else { *mask_on = 0; *mask_off = 0; - return FALSE; + return false; } } -BOOL LLSelectMgr::selectGetPermissions(LLPermissions& result_perm) +bool LLSelectMgr::selectGetPermissions(LLPermissions& result_perm) { - BOOL first = TRUE; + bool first = true; LLPermissions perm; for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -3969,13 +3971,13 @@ BOOL LLSelectMgr::selectGetPermissions(LLPermissions& result_perm) LLSelectNode* node = *iter; if (!node->mValid) { - return FALSE; + return false; } if (first) { perm = *(node->mPermissions); - first = FALSE; + first = false; } else { @@ -3985,7 +3987,7 @@ BOOL LLSelectMgr::selectGetPermissions(LLPermissions& result_perm) result_perm = perm; - return TRUE; + return true; } @@ -3993,9 +3995,9 @@ void LLSelectMgr::selectDelete() { S32 deleteable_count = 0; - BOOL locked_but_deleteable_object = FALSE; - BOOL no_copy_but_deleteable_object = FALSE; - BOOL all_owned_by_you = TRUE; + bool locked_but_deleteable_object = false; + bool no_copy_but_deleteable_object = false; + bool all_owned_by_you = true; for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++) @@ -4012,15 +4014,15 @@ void LLSelectMgr::selectDelete() // Check to see if you can delete objects which are locked. if(!obj->permMove()) { - locked_but_deleteable_object = TRUE; + locked_but_deleteable_object = true; } if(!obj->permCopy()) { - no_copy_but_deleteable_object = TRUE; + no_copy_but_deleteable_object = true; } if(!obj->permYouOwner()) { - all_owned_by_you = FALSE; + all_owned_by_you = false; } } @@ -4115,7 +4117,7 @@ bool LLSelectMgr::confirmDelete(const LLSD& notification, const LLSD& response, // VEFFECT: Delete Object - one effect for all deletes if (LLSelectMgr::getInstance()->mSelectedObjects->mSelectType != SELECT_TYPE_HUD) { - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, true); effectp->setPositionGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal() ); effectp->setColor(LLColor4U(gAgent.getEffectColor())); F32 duration = 0.5f; @@ -4144,11 +4146,11 @@ void LLSelectMgr::selectForceDelete() packDeleteHeader, packObjectLocalID, logNoOp, - (void*)TRUE, + (void*)true, SEND_ONLY_ROOTS); } -BOOL LLSelectMgr::selectGetEditMoveLinksetPermissions(bool &move, bool &modify) +bool LLSelectMgr::selectGetEditMoveLinksetPermissions(bool &move, bool &modify) { move = true; modify = true; @@ -4163,7 +4165,7 @@ BOOL LLSelectMgr::selectGetEditMoveLinksetPermissions(bool &move, bool &modify) { move = false; modify = false; - return FALSE; + return false; } LLViewerObject *root_object = object->getRootEdit(); @@ -4178,18 +4180,18 @@ BOOL LLSelectMgr::selectGetEditMoveLinksetPermissions(bool &move, bool &modify) modify = modify && object->permModify(); } - return TRUE; + return true; } void LLSelectMgr::selectGetAggregateSaleInfo(U32 &num_for_sale, - BOOL &is_for_sale_mixed, - BOOL &is_sale_price_mixed, + bool &is_for_sale_mixed, + bool &is_sale_price_mixed, S32 &total_sale_price, S32 &individual_sale_price) { num_for_sale = 0; - is_for_sale_mixed = FALSE; - is_sale_price_mixed = FALSE; + is_for_sale_mixed = false; + is_sale_price_mixed = false; total_sale_price = 0; individual_sale_price = 0; @@ -4199,21 +4201,21 @@ void LLSelectMgr::selectGetAggregateSaleInfo(U32 &num_for_sale, return; LLSelectNode *node = *(getSelection()->root_begin()); - const BOOL first_node_for_sale = node->mSaleInfo.isForSale(); + const bool first_node_for_sale = node->mSaleInfo.isForSale(); const S32 first_node_sale_price = node->mSaleInfo.getSalePrice(); for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++) { LLSelectNode* node = *iter; - const BOOL node_for_sale = node->mSaleInfo.isForSale(); + const bool node_for_sale = node->mSaleInfo.isForSale(); const S32 node_sale_price = node->mSaleInfo.getSalePrice(); // Set mixed if the fields don't match the first node's fields. if (node_for_sale != first_node_for_sale) - is_for_sale_mixed = TRUE; + is_for_sale_mixed = true; if (node_sale_price != first_node_sale_price) - is_sale_price_mixed = TRUE; + is_sale_price_mixed = true; if (node_for_sale) { @@ -4225,16 +4227,16 @@ void LLSelectMgr::selectGetAggregateSaleInfo(U32 &num_for_sale, individual_sale_price = first_node_sale_price; if (is_for_sale_mixed) { - is_sale_price_mixed = TRUE; + is_sale_price_mixed = true; individual_sale_price = 0; } } -// returns TRUE if all nodes are valid. method also stores an +// returns true if all nodes are valid. method also stores an // accumulated sale info. -BOOL LLSelectMgr::selectGetSaleInfo(LLSaleInfo& result_sale_info) +bool LLSelectMgr::selectGetSaleInfo(LLSaleInfo& result_sale_info) { - BOOL first = TRUE; + bool first = true; LLSaleInfo sale_info; for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -4242,13 +4244,13 @@ BOOL LLSelectMgr::selectGetSaleInfo(LLSaleInfo& result_sale_info) LLSelectNode* node = *iter; if (!node->mValid) { - return FALSE; + return false; } if (first) { sale_info = node->mSaleInfo; - first = FALSE; + first = false; } else { @@ -4258,12 +4260,12 @@ BOOL LLSelectMgr::selectGetSaleInfo(LLSaleInfo& result_sale_info) result_sale_info = sale_info; - return TRUE; + return true; } -BOOL LLSelectMgr::selectGetAggregatePermissions(LLAggregatePermissions& result_perm) +bool LLSelectMgr::selectGetAggregatePermissions(LLAggregatePermissions& result_perm) { - BOOL first = TRUE; + bool first = true; LLAggregatePermissions perm; for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -4271,13 +4273,13 @@ BOOL LLSelectMgr::selectGetAggregatePermissions(LLAggregatePermissions& result_p LLSelectNode* node = *iter; if (!node->mValid) { - return FALSE; + return false; } if (first) { perm = node->mAggregatePerm; - first = FALSE; + first = false; } else { @@ -4287,12 +4289,12 @@ BOOL LLSelectMgr::selectGetAggregatePermissions(LLAggregatePermissions& result_p result_perm = perm; - return TRUE; + return true; } -BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& result_perm) +bool LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& result_perm) { - BOOL first = TRUE; + bool first = true; LLAggregatePermissions perm; for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) @@ -4300,14 +4302,14 @@ BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& r LLSelectNode* node = *iter; if (!node->mValid) { - return FALSE; + return false; } LLAggregatePermissions t_perm = node->getObject()->permYouOwner() ? node->mAggregateTexturePermOwner : node->mAggregateTexturePerm; if (first) { perm = t_perm; - first = FALSE; + first = false; } else { @@ -4317,19 +4319,19 @@ BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& r result_perm = perm; - return TRUE; + return true; } -BOOL LLSelectMgr::isMovableAvatarSelected() +bool LLSelectMgr::isMovableAvatarSelected() { if (mAllowSelectAvatar && getSelection()->getObjectCount() == 1) { // nothing but avatar should be selected, so check that // there is only one selected object and it is a root LLViewerObject* obj = getSelection()->getFirstRootObject(); - return obj && obj->isAvatar() && getSelection()->getFirstMoveableNode(TRUE); + return obj && obj->isAvatar() && getSelection()->getFirstMoveableNode(true); } - return FALSE; + return false; } //-------------------------------------------------------------------- @@ -4345,7 +4347,7 @@ struct LLDuplicateData U32 flags; }; -void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy) +void LLSelectMgr::selectDuplicate(const LLVector3& offset, bool select_copy) { if (mSelectedObjects->isAttachment()) { @@ -4382,7 +4384,7 @@ void LLSelectMgr::selectDuplicate(const LLVector3& offset, BOOL select_copy) iter != getSelection()->root_end(); iter++ ) { LLSelectNode* node = *iter; - node->mDuplicated = TRUE; + node->mDuplicated = true; node->mDuplicatePos = node->getObject()->getPositionGlobal(); node->mDuplicateRot = node->getObject()->getRotation(); } @@ -4467,22 +4469,22 @@ struct LLDuplicateOnRayData { LLVector3 mRayStartRegion; LLVector3 mRayEndRegion; - BOOL mBypassRaycast; - BOOL mRayEndIsIntersection; + bool mBypassRaycast; + bool mRayEndIsIntersection; LLUUID mRayTargetID; - BOOL mCopyCenters; - BOOL mCopyRotates; + bool mCopyCenters; + bool mCopyRotates; U32 mFlags; }; void LLSelectMgr::selectDuplicateOnRay(const LLVector3 &ray_start_region, const LLVector3 &ray_end_region, - BOOL bypass_raycast, - BOOL ray_end_is_intersection, + bool bypass_raycast, + bool ray_end_is_intersection, const LLUUID &ray_target_id, - BOOL copy_centers, - BOOL copy_rotates, - BOOL select_copy) + bool copy_centers, + bool copy_rotates, + bool select_copy) { if (mSelectedObjects->isAttachment()) { @@ -4604,12 +4606,12 @@ struct LLOwnerData { LLUUID owner_id; LLUUID group_id; - BOOL override; + bool override; }; void LLSelectMgr::sendOwner(const LLUUID& owner_id, const LLUUID& group_id, - BOOL override) + bool override) { LLOwnerData data; @@ -4691,16 +4693,16 @@ void LLSelectMgr::packBuyObjectIDs(LLSelectNode* node, void* data) struct LLPermData { U8 mField; - BOOL mSet; + bool mSet; U32 mMask; - BOOL mOverride; + bool mOverride; }; // TODO: Make this able to fail elegantly. void LLSelectMgr::selectionSetObjectPermissions(U8 field, - BOOL set, + bool set, U32 mask, - BOOL override) + bool override) { LLPermData data; @@ -4809,7 +4811,7 @@ void LLSelectMgr::convertTransient() for (node_it = mSelectedObjects->begin(); node_it != mSelectedObjects->end(); ++node_it) { LLSelectNode *nodep = *node_it; - nodep->setTransient(FALSE); + nodep->setTransient(false); } } @@ -4951,7 +4953,7 @@ void LLSelectMgr::sendAttach(LLObjectSelectionHandle selection_handle, U8 attach return; } - BOOL build_mode = LLToolMgr::getInstance()->inEdit(); + bool build_mode = LLToolMgr::getInstance()->inEdit(); // Special case: Attach to default location for this object. if (0 == attachment_point || get_if_there(gAgentAvatarp->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)NULL)) @@ -5185,7 +5187,7 @@ void LLSelectMgr::saveSelectedObjectTextures() { virtual bool apply(LLSelectNode* node) { - node->mValid = FALSE; + node->mValid = false; return true; } } func; @@ -5279,9 +5281,9 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type) struct LLSelectMgrApplyFlags : public LLSelectedObjectFunctor { - LLSelectMgrApplyFlags(U32 flags, BOOL state) : mFlags(flags), mState(state) {} + LLSelectMgrApplyFlags(U32 flags, bool state) : mFlags(flags), mState(state) {} U32 mFlags; - BOOL mState; + bool mState; virtual bool apply(LLViewerObject* object) { if ( object->permModify()) @@ -5300,19 +5302,19 @@ struct LLSelectMgrApplyFlags : public LLSelectedObjectFunctor } }; -void LLSelectMgr::selectionUpdatePhysics(BOOL physics) +void LLSelectMgr::selectionUpdatePhysics(bool physics) { LLSelectMgrApplyFlags func( FLAGS_USE_PHYSICS, physics); getSelection()->applyToObjects(&func); } -void LLSelectMgr::selectionUpdateTemporary(BOOL is_temporary) +void LLSelectMgr::selectionUpdateTemporary(bool is_temporary) { LLSelectMgrApplyFlags func( FLAGS_TEMPORARY_ON_REZ, is_temporary); getSelection()->applyToObjects(&func); } -void LLSelectMgr::selectionUpdatePhantom(BOOL is_phantom) +void LLSelectMgr::selectionUpdatePhantom(bool is_phantom) { LLSelectMgrApplyFlags func( FLAGS_PHANTOM, is_phantom); getSelection()->applyToObjects(&func); @@ -5383,7 +5385,7 @@ void LLSelectMgr::packDuplicateHeader(void* data) // static void LLSelectMgr::packDeleteHeader(void* userdata) { - BOOL force = (BOOL)(intptr_t)userdata; + bool force = (bool)(intptr_t)userdata; gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); @@ -5597,7 +5599,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle, { if (node->getObject()) { - BOOL is_root = node->getObject()->isRootEdit(); + bool is_root = node->getObject()->isRootEdit(); if ((mRoots && is_root) || (!mRoots && !is_root)) { nodes_to_send.push(node); @@ -5607,8 +5609,8 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle, } }; struct push_all pushall(nodes_to_send); - struct push_some pushroots(nodes_to_send, TRUE); - struct push_some pushnonroots(nodes_to_send, FALSE); + struct push_some pushroots(nodes_to_send, true); + struct push_some pushnonroots(nodes_to_send, false); switch(send_type) { @@ -5865,8 +5867,8 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data if (save_textures) { - BOOL can_copy = FALSE; - BOOL can_transfer = FALSE; + bool can_copy = false; + bool can_transfer = false; LLAggregatePermissions::EValue value = LLAggregatePermissions::AP_NONE; if(node->getObject()->permYouOwner()) @@ -5874,12 +5876,12 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data value = ag_texture_perms_owner.getValue(PERM_COPY); if (value == LLAggregatePermissions::AP_EMPTY || value == LLAggregatePermissions::AP_ALL) { - can_copy = TRUE; + can_copy = true; } value = ag_texture_perms_owner.getValue(PERM_TRANSFER); if (value == LLAggregatePermissions::AP_EMPTY || value == LLAggregatePermissions::AP_ALL) { - can_transfer = TRUE; + can_transfer = true; } } else @@ -5887,12 +5889,12 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data value = ag_texture_perms.getValue(PERM_COPY); if (value == LLAggregatePermissions::AP_EMPTY || value == LLAggregatePermissions::AP_ALL) { - can_copy = TRUE; + can_copy = true; } value = ag_texture_perms.getValue(PERM_TRANSFER); if (value == LLAggregatePermissions::AP_EMPTY || value == LLAggregatePermissions::AP_ALL) { - can_transfer = TRUE; + can_transfer = true; } } @@ -5932,7 +5934,7 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data } } - node->mValid = TRUE; + node->mValid = true; node->mPermissions->init(creator_id, owner_id, last_owner_id, group_id); node->mPermissions->initMasks(base_mask, owner_mask, everyone_mask, group_mask, next_owner_mask); @@ -6026,7 +6028,7 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use if (node) { - node->mValid = TRUE; + node->mValid = true; node->mPermissions->init(LLUUID::null, owner_id, last_owner_id, group_id); node->mPermissions->initMasks(base_mask, owner_mask, everyone_mask, group_mask, next_owner_mask); @@ -6043,7 +6045,7 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use // static void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**) { - BOOL reset_list; + bool reset_list; msg->getBOOL("Header", "ResetList", reset_list); if (reset_list) @@ -6088,7 +6090,7 @@ void LLSelectMgr::updateSilhouettes() if (!mSilhouetteImagep) { - mSilhouetteImagep = LLViewerTextureManager::getFetchedTextureFromFile("silhouette.j2c", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI); + mSilhouetteImagep = LLViewerTextureManager::getFetchedTextureFromFile("silhouette.j2c", FTT_LOCAL_FILE, true, LLGLTexture::BOOST_UI); } mHighlightedObjects->cleanupNodes(); @@ -6124,7 +6126,7 @@ void LLSelectMgr::updateSilhouettes() // persists from frame to frame to avoid regenerating object silhouettes // mHighlightedObjects includes all siblings of rect selected objects - BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); + bool select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); // generate list of roots from current object selection for (std::set<LLPointer<LLViewerObject> >::iterator iter = mRectSelectedObjects.begin(); @@ -6201,12 +6203,12 @@ void LLSelectMgr::updateSilhouettes() continue; } - LLSelectNode* rect_select_root_node = new LLSelectNode(objectp, TRUE); - rect_select_root_node->selectAllTEs(TRUE); + LLSelectNode* rect_select_root_node = new LLSelectNode(objectp, true); + rect_select_root_node->selectAllTEs(true); if (!select_linked_set) { - rect_select_root_node->mIndividualSelection = TRUE; + rect_select_root_node->mIndividualSelection = true; } else { @@ -6221,8 +6223,8 @@ void LLSelectMgr::updateSilhouettes() continue; } - LLSelectNode* rect_select_node = new LLSelectNode(child_objectp, TRUE); - rect_select_node->selectAllTEs(TRUE); + LLSelectNode* rect_select_node = new LLSelectNode(child_objectp, true); + rect_select_node->selectAllTEs(true); mHighlightedObjects->addNodeAtEnd(rect_select_node); } } @@ -6234,7 +6236,7 @@ void LLSelectMgr::updateSilhouettes() num_sils_genned = 0; // render silhouettes for highlighted objects - //BOOL subtracting_from_selection = (gKeyboard->currentMask(TRUE) == MASK_CONTROL); + //bool subtracting_from_selection = (gKeyboard->currentMask(true) == MASK_CONTROL); for (S32 pass = 0; pass < 2; pass++) { for (LLObjectSelection::iterator iter = mHighlightedObjects->begin(); @@ -6246,8 +6248,8 @@ void LLSelectMgr::updateSilhouettes() continue; // do roots first, then children so that root flags are cleared ASAP - BOOL roots_only = (pass == 0); - BOOL is_root = objectp->isRootEdit(); + bool roots_only = (pass == 0); + bool is_root = objectp->isRootEdit(); if (roots_only != is_root) { continue; @@ -6321,8 +6323,8 @@ void LLSelectMgr::updateSelectionSilhouette(LLObjectSelectionHandle object_handl if (!objectp) continue; // do roots first, then children so that root flags are cleared ASAP - BOOL roots_only = (pass == 0); - BOOL is_root = (objectp->isRootEdit()); + bool roots_only = (pass == 0); + bool is_root = (objectp->isRootEdit()); if (roots_only != is_root || objectp->mDrawable.isNull()) { continue; @@ -6352,7 +6354,7 @@ void LLSelectMgr::updateSelectionSilhouette(LLObjectSelectionHandle object_handl } } } -void LLSelectMgr::renderSilhouettes(BOOL for_hud) +void LLSelectMgr::renderSilhouettes(bool for_hud) { if (!mRenderSilhouettes || !mRenderHighlightSelections) { @@ -6405,7 +6407,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - BOOL is_hud_object = objectp->isHUDAttachment(); + bool is_hud_object = objectp->isHUDAttachment(); if (!is_hud_object) { @@ -6529,8 +6531,8 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) } else if (node->isTransient()) { - BOOL oldHidden = LLSelectMgr::sRenderHiddenSelections; - LLSelectMgr::sRenderHiddenSelections = FALSE; + bool oldHidden = LLSelectMgr::sRenderHiddenSelections; + LLSelectMgr::sRenderHiddenSelections = false; node->renderOneSilhouette(sContextSilhouetteColor); LLSelectMgr::sRenderHiddenSelections = oldHidden; } @@ -6550,7 +6552,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) if (mHighlightedObjects->getNumNodes()) { // render silhouettes for highlighted objects - BOOL subtracting_from_selection = (gKeyboard->currentMask(TRUE) == MASK_CONTROL); + bool subtracting_from_selection = (gKeyboard->currentMask(true) == MASK_CONTROL); for (S32 pass = 0; pass < 2; pass++) { for (LLObjectSelection::iterator iter = mHighlightedObjects->begin(); @@ -6611,15 +6613,15 @@ void LLSelectMgr::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_ // // Utility classes // -LLSelectNode::LLSelectNode(LLViewerObject* object, BOOL glow) +LLSelectNode::LLSelectNode(LLViewerObject* object, bool glow) : mObject(object), - mIndividualSelection(FALSE), - mTransient(FALSE), - mValid(FALSE), + mIndividualSelection(false), + mTransient(false), + mValid(false), mPermissions(new LLPermissions()), mInventorySerial(0), - mSilhouetteExists(FALSE), - mDuplicated(FALSE), + mSilhouetteExists(false), + mDuplicated(false), mTESelectMask(0), mLastTESelected(0), mName(LLStringUtil::null), @@ -6708,13 +6710,13 @@ LLSelectNode::~LLSelectNode() mPermissions = NULL; } -void LLSelectNode::selectAllTEs(BOOL b) +void LLSelectNode::selectAllTEs(bool b) { mTESelectMask = b ? TE_SELECT_MASK_ALL : 0x0; mLastTESelected = 0; } -void LLSelectNode::selectTE(S32 te_index, BOOL selected) +void LLSelectNode::selectTE(S32 te_index, bool selected) { if (te_index < 0 || te_index >= SELECT_MAX_TES) { @@ -6743,11 +6745,11 @@ void LLSelectNode::selectGLTFNode(S32 node_index, S32 primitive_index, bool sele mSelectedGLTFPrimitive = primitive_index; } -BOOL LLSelectNode::isTESelected(S32 te_index) const +bool LLSelectNode::isTESelected(S32 te_index) const { if (te_index < 0 || te_index >= mObject->getNumTEs()) { - return FALSE; + return false; } return (mTESelectMask & (0x1 << te_index)) != 0; } @@ -6890,17 +6892,17 @@ void LLSelectNode::saveTextureScaleRatios(LLRender::eTexIndex index_to_query) // This implementation should be similar to LLTask::allowOperationOnTask -BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) const +bool LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) const { // Extract ownership. - BOOL object_is_group_owned = FALSE; + bool object_is_group_owned = false; LLUUID object_owner_id; mPermissions->getOwnership(object_owner_id, object_is_group_owned); // Operations on invalid or public objects is not allowed. if (!mObject || (mObject->isDead()) || !mPermissions->isOwned()) { - return FALSE; + return false; } // The transfer permissions can never be given through proxy. @@ -6910,7 +6912,7 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) if ( !object_is_group_owned && (gAgent.getID() == object_owner_id) ) { - return TRUE; + return true; } else { @@ -6926,7 +6928,7 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) // no proxy allowed. if (mObject->isAttachment() && object_owner_id != gAgent.getID()) { - return FALSE; + return false; } } @@ -6939,7 +6941,7 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) // Gods can always operate. if (gAgent.isGodlike()) { - return TRUE; + return true; } // Check if the agent is in the same group as the object. @@ -6974,7 +6976,7 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) if (PERM_OWNER == op) { // This this was just a check for ownership, we can now return the answer. - return (proxy_agent_id == object_owner_id ? TRUE : FALSE); + return proxy_agent_id == object_owner_id; } // check permissions to see if the agent can operate @@ -7011,7 +7013,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) return; } - BOOL is_hud_object = objectp->isHUDAttachment(); + bool is_hud_object = objectp->isHUDAttachment(); if (mSilhouetteVertices.size() == 0 || mSilhouetteNormals.size() != mSilhouetteVertices.size()) { @@ -7248,7 +7250,7 @@ void LLSelectMgr::updateSelectionCenter() // nothing selected, probably grabbing // Ignore by setting to avatar origin. mSelectionCenterGlobal.clearVec(); - mShowSelection = FALSE; + mShowSelection = false; mSelectionBBox = LLBBox(); resetAgentHUDZoom(); } @@ -7262,7 +7264,7 @@ void LLSelectMgr::updateSelectionCenter() resetAgentHUDZoom(); } - mShowSelection = FALSE; + mShowSelection = false; LLBBox bbox; // have stuff selected @@ -7271,7 +7273,7 @@ void LLSelectMgr::updateSelectionCenter() // Initialize the bounding box to the root prim, so the BBox orientation // matches the root prim's (affecting the orientation of the manipulators). - bbox.addBBoxAgent( (mSelectedObjects->getFirstRootObject(TRUE))->getBoundingBoxAgent() ); + bbox.addBBoxAgent( (mSelectedObjects->getFirstRootObject(true))->getBoundingBoxAgent() ); for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); iter != mSelectedObjects->end(); iter++) @@ -7286,7 +7288,7 @@ void LLSelectMgr::updateSelectionCenter() !root->isChild(gAgentAvatarp) && // not the object you're sitting on !object->isAvatar()) // not another avatar { - mShowSelection = TRUE; + mShowSelection = true; } bbox.addBBoxAgent( object->getBoundingBoxAgent() ); @@ -7429,7 +7431,7 @@ LLBBox LLSelectMgr::getBBoxOfSelection() const //----------------------------------------------------------------------------- // canUndo() //----------------------------------------------------------------------------- -BOOL LLSelectMgr::canUndo() const +bool LLSelectMgr::canUndo() const { // Can edit or can move return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstUndoEnabledObject() != NULL; // HACK: casting away constness - MG; @@ -7440,7 +7442,7 @@ BOOL LLSelectMgr::canUndo() const //----------------------------------------------------------------------------- void LLSelectMgr::undo() { - BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); + bool select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); LLUUID group_id(gAgent.getGroupID()); sendListToRegions("Undo", packAgentAndSessionAndGroupID, packObjectID, logNoOp, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST); } @@ -7448,7 +7450,7 @@ void LLSelectMgr::undo() //----------------------------------------------------------------------------- // canRedo() //----------------------------------------------------------------------------- -BOOL LLSelectMgr::canRedo() const +bool LLSelectMgr::canRedo() const { return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstEditableObject() != NULL; // HACK: casting away constness - MG } @@ -7458,7 +7460,7 @@ BOOL LLSelectMgr::canRedo() const //----------------------------------------------------------------------------- void LLSelectMgr::redo() { - BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); + bool select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); LLUUID group_id(gAgent.getGroupID()); sendListToRegions("Redo", packAgentAndSessionAndGroupID, packObjectID, logNoOp, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST); } @@ -7466,7 +7468,7 @@ void LLSelectMgr::redo() //----------------------------------------------------------------------------- // canDoDelete() //----------------------------------------------------------------------------- -BOOL LLSelectMgr::canDoDelete() const +bool LLSelectMgr::canDoDelete() const { bool can_delete = false; // This function is "logically const" - it does not change state in @@ -7497,7 +7499,7 @@ void LLSelectMgr::doDelete() //----------------------------------------------------------------------------- // canDeselect() //----------------------------------------------------------------------------- -BOOL LLSelectMgr::canDeselect() const +bool LLSelectMgr::canDeselect() const { return !mSelectedObjects->isEmpty(); } @@ -7512,7 +7514,7 @@ void LLSelectMgr::deselect() //----------------------------------------------------------------------------- // canDuplicate() //----------------------------------------------------------------------------- -BOOL LLSelectMgr::canDuplicate() const +bool LLSelectMgr::canDuplicate() const { return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstCopyableObject() != NULL; // HACK: casting away constness - MG } @@ -7522,7 +7524,7 @@ BOOL LLSelectMgr::canDuplicate() const void LLSelectMgr::duplicate() { LLVector3 offset(0.5f, 0.5f, 0.f); - selectDuplicate(offset, TRUE); + selectDuplicate(offset, true); } ESelectType LLSelectMgr::getSelectTypeForObject(LLViewerObject* object) @@ -7561,17 +7563,17 @@ void LLSelectMgr::validateSelection() getSelection()->applyToObjects(&func); } -BOOL LLSelectMgr::canSelectObject(LLViewerObject* object, BOOL ignore_select_owned) +bool LLSelectMgr::canSelectObject(LLViewerObject* object, bool ignore_select_owned) { // Never select dead objects if (!object || object->isDead()) { - return FALSE; + return false; } if (mForceSelection) { - return TRUE; + return true; } if(!ignore_select_owned) @@ -7580,26 +7582,26 @@ BOOL LLSelectMgr::canSelectObject(LLViewerObject* object, BOOL ignore_select_own (gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced()))) { // only select my own objects - return FALSE; + return false; } } // Can't select orphans - if (object->isOrphaned()) return FALSE; + if (object->isOrphaned()) return false; // Can't select avatars - if (object->isAvatar()) return FALSE; + if (object->isAvatar()) return false; // Can't select land - if (object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) return FALSE; + if (object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) return false; ESelectType selection_type = getSelectTypeForObject(object); - if (mSelectedObjects->getObjectCount() > 0 && mSelectedObjects->mSelectType != selection_type) return FALSE; + if (mSelectedObjects->getObjectCount() > 0 && mSelectedObjects->mSelectType != selection_type) return false; - return TRUE; + return true; } -BOOL LLSelectMgr::setForceSelection(BOOL force) +bool LLSelectMgr::setForceSelection(bool force) { std::swap(mForceSelection,force); return force; @@ -7678,7 +7680,7 @@ void LLObjectSelection::updateEffects() S32 LLObjectSelection::getNumNodes() { - return mList.size(); + return static_cast<S32>(mList.size()); } void LLObjectSelection::addNode(LLSelectNode *nodep) @@ -7733,7 +7735,7 @@ LLSelectNode* LLObjectSelection::findNode(LLViewerObject* objectp) //----------------------------------------------------------------------------- // isEmpty() //----------------------------------------------------------------------------- -BOOL LLObjectSelection::isEmpty() const +bool LLObjectSelection::isEmpty() const { return (mList.size() == 0); } @@ -7745,7 +7747,7 @@ BOOL LLObjectSelection::isEmpty() const S32 LLObjectSelection::getObjectCount() { cleanupNodes(); - S32 count = mList.size(); + S32 count = static_cast<S32>(mList.size()); return count; } @@ -8049,7 +8051,7 @@ bool LLObjectSelection::checkAnimatedObjectLinkable() bool LLObjectSelection::applyToRootObjects(LLSelectedObjectFunctor* func, bool firstonly) { - bool result = firstonly ? false : true; + bool result = !firstonly; for (root_iterator iter = root_begin(); iter != root_end(); ) { root_iterator nextiter = iter++; @@ -8067,7 +8069,7 @@ bool LLObjectSelection::applyToRootObjects(LLSelectedObjectFunctor* func, bool f bool LLObjectSelection::applyToTEs(LLSelectedTEFunctor* func, bool firstonly) { - bool result = firstonly ? false : true; + bool result = !firstonly; for (iterator iter = begin(); iter != end(); ) { iterator nextiter = iter++; @@ -8093,7 +8095,7 @@ bool LLObjectSelection::applyToTEs(LLSelectedTEFunctor* func, bool firstonly) bool LLObjectSelection::applyToNodes(LLSelectedNodeFunctor *func, bool firstonly) { - bool result = firstonly ? false : true; + bool result = !firstonly; for (iterator iter = begin(); iter != end(); ) { iterator nextiter = iter++; @@ -8109,7 +8111,7 @@ bool LLObjectSelection::applyToNodes(LLSelectedNodeFunctor *func, bool firstonly bool LLObjectSelection::applyToRootNodes(LLSelectedNodeFunctor *func, bool firstonly) { - bool result = firstonly ? false : true; + bool result = !firstonly; for (root_iterator iter = root_begin(); iter != root_end(); ) { root_iterator nextiter = iter++; @@ -8123,9 +8125,9 @@ bool LLObjectSelection::applyToRootNodes(LLSelectedNodeFunctor *func, bool first return result; } -BOOL LLObjectSelection::isMultipleTESelected() +bool LLObjectSelection::isMultipleTESelected() { - BOOL te_selected = FALSE; + bool te_selected = false; // ...all faces for (LLObjectSelection::iterator iter = begin(); iter != end(); iter++) @@ -8137,19 +8139,19 @@ BOOL LLObjectSelection::isMultipleTESelected() { if(te_selected) { - return TRUE; + return true; } - te_selected = TRUE; + te_selected = true; } } } - return FALSE; + return false; } //----------------------------------------------------------------------------- // contains() //----------------------------------------------------------------------------- -BOOL LLObjectSelection::contains(LLViewerObject* object) +bool LLObjectSelection::contains(LLViewerObject* object) { return findNode(object) != NULL; } @@ -8158,7 +8160,7 @@ BOOL LLObjectSelection::contains(LLViewerObject* object) //----------------------------------------------------------------------------- // contains() //----------------------------------------------------------------------------- -BOOL LLObjectSelection::contains(LLViewerObject* object, S32 te) +bool LLObjectSelection::contains(LLViewerObject* object, S32 te) { if (te == SELECT_ALL_TES) { @@ -8172,10 +8174,10 @@ BOOL LLObjectSelection::contains(LLViewerObject* object, S32 te) // Optimization if (nodep->getTESelectMask() == TE_SELECT_MASK_ALL) { - return TRUE; + return true; } - BOOL all_selected = TRUE; + bool all_selected = true; for (S32 i = 0; i < object->getNumTEs(); i++) { all_selected = all_selected && nodep->isTESelected(i); @@ -8183,7 +8185,7 @@ BOOL LLObjectSelection::contains(LLViewerObject* object, S32 te) return all_selected; } } - return FALSE; + return false; } else { @@ -8193,15 +8195,15 @@ BOOL LLObjectSelection::contains(LLViewerObject* object, S32 te) LLSelectNode* nodep = *iter; if (nodep->getObject() == object && nodep->isTESelected(te)) { - return TRUE; + return true; } } - return FALSE; + return false; } } -// returns TRUE is any node is currenly worn as an attachment -BOOL LLObjectSelection::isAttachment() +// returns true is any node is currenly worn as an attachment +bool LLObjectSelection::isAttachment() { return (mSelectType == SELECT_TYPE_ATTACHMENT || mSelectType == SELECT_TYPE_HUD); } @@ -8242,7 +8244,7 @@ LLSelectNode* LLObjectSelection::getFirstNode(LLSelectedNodeFunctor* func) return NULL; } -LLSelectNode* LLObjectSelection::getFirstRootNode(LLSelectedNodeFunctor* func, BOOL non_root_ok) +LLSelectNode* LLObjectSelection::getFirstRootNode(LLSelectedNodeFunctor* func, bool non_root_ok) { for (root_iterator iter = root_begin(); iter != root_end(); ++iter) { @@ -8264,7 +8266,7 @@ LLSelectNode* LLObjectSelection::getFirstRootNode(LLSelectedNodeFunctor* func, B //----------------------------------------------------------------------------- // getFirstSelectedObject //----------------------------------------------------------------------------- -LLViewerObject* LLObjectSelection::getFirstSelectedObject(LLSelectedNodeFunctor* func, BOOL get_parent) +LLViewerObject* LLObjectSelection::getFirstSelectedObject(LLSelectedNodeFunctor* func, bool get_parent) { LLSelectNode* res = getFirstNode(func); if (res && get_parent) @@ -8290,7 +8292,7 @@ LLViewerObject* LLObjectSelection::getFirstObject() //----------------------------------------------------------------------------- // getFirstRootObject() //----------------------------------------------------------------------------- -LLViewerObject* LLObjectSelection::getFirstRootObject(BOOL non_root_ok) +LLViewerObject* LLObjectSelection::getFirstRootObject(bool non_root_ok) { LLSelectNode* res = getFirstRootNode(NULL, non_root_ok); return res ? res->getObject() : NULL; @@ -8299,7 +8301,7 @@ LLViewerObject* LLObjectSelection::getFirstRootObject(BOOL non_root_ok) //----------------------------------------------------------------------------- // getFirstMoveableNode() //----------------------------------------------------------------------------- -LLSelectNode* LLObjectSelection::getFirstMoveableNode(BOOL get_root_first) +LLSelectNode* LLObjectSelection::getFirstMoveableNode(bool get_root_first) { struct f : public LLSelectedNodeFunctor { @@ -8309,14 +8311,14 @@ LLSelectNode* LLObjectSelection::getFirstMoveableNode(BOOL get_root_first) return obj && obj->permMove() && !obj->isPermanentEnforced(); } } func; - LLSelectNode* res = get_root_first ? getFirstRootNode(&func, TRUE) : getFirstNode(&func); + LLSelectNode* res = get_root_first ? getFirstRootNode(&func, true) : getFirstNode(&func); return res; } //----------------------------------------------------------------------------- // getFirstCopyableObject() //----------------------------------------------------------------------------- -LLViewerObject* LLObjectSelection::getFirstCopyableObject(BOOL get_parent) +LLViewerObject* LLObjectSelection::getFirstCopyableObject(bool get_parent) { struct f : public LLSelectedNodeFunctor { @@ -8364,7 +8366,7 @@ LLViewerObject* LLObjectSelection::getFirstDeleteableObject() //----------------------------------------------------------------------------- // getFirstEditableObject() //----------------------------------------------------------------------------- -LLViewerObject* LLObjectSelection::getFirstEditableObject(BOOL get_parent) +LLViewerObject* LLObjectSelection::getFirstEditableObject(bool get_parent) { struct f : public LLSelectedNodeFunctor { @@ -8380,7 +8382,7 @@ LLViewerObject* LLObjectSelection::getFirstEditableObject(BOOL get_parent) //----------------------------------------------------------------------------- // getFirstMoveableObject() //----------------------------------------------------------------------------- -LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent) +LLViewerObject* LLObjectSelection::getFirstMoveableObject(bool get_parent) { struct f : public LLSelectedNodeFunctor { @@ -8396,7 +8398,7 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent) //----------------------------------------------------------------------------- // getFirstUndoEnabledObject() //----------------------------------------------------------------------------- -LLViewerObject* LLObjectSelection::getFirstUndoEnabledObject(BOOL get_parent) +LLViewerObject* LLObjectSelection::getFirstUndoEnabledObject(bool get_parent) { struct f : public LLSelectedNodeFunctor { @@ -8484,7 +8486,7 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ, if (enable_rot) { - int children_count = obj->getChildren().size(); + auto children_count = obj->getChildren().size(); if (obj_count > 1 && children_count > 0) { // for linked sets, rotate around the group center @@ -8530,7 +8532,7 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ, if (enable_pos && enable_rot && obj->mDrawable.notNull()) { - gPipeline.markMoved(obj->mDrawable, TRUE); + gPipeline.markMoved(obj->mDrawable, true); } } |