diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 886 |
1 files changed, 457 insertions, 429 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index b50c0f60bd..18dcec5e92 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; } @@ -456,7 +456,7 @@ void LLSelectMgr::overrideAvatarUpdates() //----------------------------------------------------------------------------- // Select just the object, not any other group members. //----------------------------------------------------------------------------- -LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S32 face) +LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S32 face, S32 gltf_node, S32 gltf_primitive) { llassert( object ); @@ -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); + 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) +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 @@ -1080,6 +1080,13 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab return; } + // Handle glTF node selection + if (gltf_node >= 0) + { + nodep->selectGLTFNode(gltf_node, gltf_primitive, TRUE); + + } + saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); updateSelectionCenter(); dialog_refresh_all(); @@ -1131,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); } @@ -1295,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); @@ -1324,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++) { @@ -1348,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(); @@ -1356,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); } } @@ -1410,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) { @@ -1421,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) @@ -1443,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(); @@ -1491,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; } @@ -1504,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); @@ -1519,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 @@ -1536,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); @@ -1547,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 } } @@ -1571,7 +1578,7 @@ void LLSelectMgr::removeAll() iter != mSelectedObjects->end(); iter++ ) { LLViewerObject *objectp = (*iter)->getObject(); - objectp->setSelected( FALSE ); + objectp->setSelected( false ); } mSelectedObjects->deleteAllNodes(); @@ -1587,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(); ) @@ -1598,7 +1605,7 @@ void LLSelectMgr::promoteSelectionToRoot() if (nodep->mIndividualSelection) { - selection_changed = TRUE; + selection_changed = true; } LLViewerObject* parentp = object; @@ -1782,7 +1789,7 @@ bool LLObjectSelection::applyRestrictedPbrMaterialToTEs(LLViewerInventoryItem* i LLUUID asset_id = item->getAssetUUID(); if (asset_id.isNull()) { - asset_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID; + asset_id = BLANK_MATERIAL_ASSET_ID; } bool material_copied_all_faces = true; @@ -1864,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) ? true : false; if (!unrestricted) { // Attachments are in world and in inventory simultaneously, @@ -1887,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; @@ -1915,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); @@ -1987,7 +1994,7 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id) asset_id = mItem->getAssetUUID(); if (asset_id.isNull()) { - asset_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID; + asset_id = BLANK_MATERIAL_ASSET_ID; } } @@ -2029,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); @@ -2187,7 +2194,7 @@ void LLSelectMgr::selectionRevertShinyColors() getSelection()->applyToObjects(&sendfunc); } -BOOL LLSelectMgr::selectionRevertTextures() +bool LLSelectMgr::selectionRevertTextures() { struct f : public LLSelectedTEFunctor { @@ -2205,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)); } } @@ -2217,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); @@ -2300,8 +2307,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) ? true : false; + bool attached = object->isAttachment(); if (attached && !unrestricted) { // Attachments are in world and in inventory simultaneously, @@ -2372,8 +2379,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) ? true : false; + bool attached = object->isAttachment(); if (attached && !unrestricted) { // Attachments are in world and in inventory simultaneously, @@ -2638,9 +2645,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> { @@ -2667,7 +2674,7 @@ void LLSelectMgr::selectionSetPhysicsType(U8 type) if (object->permModify()) { object->setPhysicsShapeType(mType); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2686,7 +2693,7 @@ void LLSelectMgr::selectionSetFriction(F32 friction) if (object->permModify()) { object->setPhysicsFriction(mFriction); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2705,7 +2712,7 @@ void LLSelectMgr::selectionSetGravity(F32 gravity ) if (object->permModify()) { object->setPhysicsGravity(mGravity); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2724,7 +2731,7 @@ void LLSelectMgr::selectionSetDensity(F32 density ) if (object->permModify()) { object->setPhysicsDensity(mDensity); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2743,7 +2750,7 @@ void LLSelectMgr::selectionSetRestitution(F32 restitution) if (object->permModify()) { object->setPhysicsRestitution(mRestitution); - object->updateFlags(TRUE); + object->updateFlags(true); } return true; } @@ -2776,8 +2783,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 { @@ -2787,19 +2794,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(); @@ -2839,12 +2846,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(); @@ -2863,7 +2870,7 @@ BOOL LLSelectMgr::selectionGetClickAction(U8 *out_action) return true; } } func(action); - BOOL res = getSelection()->applyToObjects(&func); + bool res = getSelection()->applyToObjects(&func); return res; } @@ -2991,7 +2998,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; @@ -3016,7 +3023,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++) @@ -3039,13 +3046,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 @@ -3129,9 +3136,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 ) @@ -3139,18 +3146,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 ) @@ -3158,19 +3165,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++ ) @@ -3179,17 +3186,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++ ) @@ -3198,21 +3205,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++ ) @@ -3221,30 +3228,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(); @@ -3255,18 +3262,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++ ) @@ -3275,21 +3282,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++ ) @@ -3298,21 +3305,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++ ) @@ -3321,21 +3328,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++ ) @@ -3344,21 +3351,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++ ) @@ -3367,21 +3374,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++ ) @@ -3390,21 +3397,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++ ) @@ -3413,21 +3420,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++ ) @@ -3436,21 +3443,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++ ) @@ -3459,21 +3466,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++ ) @@ -3482,21 +3489,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++ ) @@ -3505,21 +3512,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++ ) @@ -3528,23 +3535,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++ ) @@ -3553,7 +3560,7 @@ BOOL LLSelectMgr::selectGetEditableLinksets() LLViewerObject* object = node->getObject(); if( !object || !node->mValid ) { - return FALSE; + return false; } if (object->flagUsePhysics() || object->flagTemporaryOnRez() || @@ -3566,17 +3573,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++ ) @@ -3585,22 +3592,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++ ) @@ -3609,21 +3616,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++ ) @@ -3632,14 +3639,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 @@ -3722,7 +3729,7 @@ protected: } }; -BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name) +bool LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name) { LLSelectGetFirstCreator test; getFirst(&test); @@ -3730,7 +3737,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; @@ -3762,14 +3769,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; @@ -3807,14 +3814,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; @@ -3844,7 +3851,7 @@ protected: } }; -BOOL LLSelectMgr::selectGetGroup(LLUUID& result_id) +bool LLSelectMgr::selectGetGroup(LLUUID& result_id) { LLSelectGetFirstGroup test; getFirst(&test); @@ -3856,7 +3863,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 { @@ -3871,29 +3878,29 @@ protected: } }; -BOOL LLSelectMgr::selectIsGroupOwned() +bool LLSelectMgr::selectIsGroupOwned() { LLSelectGetFirstGroupOwner test; getFirst(&test); - return test.mFirstValue.notNull() ? TRUE : FALSE; + return test.mFirstValue.notNull() ? true : false; } //----------------------------------------------------------------------------- // 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++) @@ -3902,11 +3909,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 ) { @@ -3935,26 +3942,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++ ) @@ -3962,13 +3969,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 { @@ -3978,7 +3985,7 @@ BOOL LLSelectMgr::selectGetPermissions(LLPermissions& result_perm) result_perm = perm; - return TRUE; + return true; } @@ -3986,9 +3993,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++) @@ -4005,15 +4012,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; } } @@ -4108,7 +4115,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; @@ -4137,11 +4144,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; @@ -4156,7 +4163,7 @@ BOOL LLSelectMgr::selectGetEditMoveLinksetPermissions(bool &move, bool &modify) { move = false; modify = false; - return FALSE; + return false; } LLViewerObject *root_object = object->getRootEdit(); @@ -4171,18 +4178,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; @@ -4192,21 +4199,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) { @@ -4218,16 +4225,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++ ) @@ -4235,13 +4242,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 { @@ -4251,12 +4258,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++ ) @@ -4264,13 +4271,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 { @@ -4280,12 +4287,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++ ) @@ -4293,14 +4300,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 { @@ -4310,19 +4317,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; } //-------------------------------------------------------------------- @@ -4338,7 +4345,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()) { @@ -4375,7 +4382,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(); } @@ -4460,22 +4467,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()) { @@ -4597,12 +4604,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; @@ -4684,16 +4691,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; @@ -4802,7 +4809,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); } } @@ -4944,7 +4951,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)) @@ -5178,7 +5185,7 @@ void LLSelectMgr::saveSelectedObjectTextures() { virtual bool apply(LLSelectNode* node) { - node->mValid = FALSE; + node->mValid = false; return true; } } func; @@ -5211,46 +5218,57 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type) { return true; // skip } - selectNode->mSavedPositionLocal = object->getPosition(); - if (object->isAttachment()) - { - if (object->isRootEdit()) - { - LLXform* parent_xform = object->mDrawable->getXform()->getParent(); - if (parent_xform) - { - selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition()); - } - else - { - selectNode->mSavedPositionGlobal = object->getPositionGlobal(); - } - } - else - { - LLViewerObject* attachment_root = (LLViewerObject*)object->getParent(); - LLXform* parent_xform = attachment_root ? attachment_root->mDrawable->getXform()->getParent() : NULL; - if (parent_xform) - { - LLVector3 root_pos = (attachment_root->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); - LLQuaternion root_rot = (attachment_root->getRotation() * parent_xform->getWorldRotation()); - selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * root_rot) + root_pos); - } - else - { - selectNode->mSavedPositionGlobal = object->getPositionGlobal(); - } - } - selectNode->mSavedRotation = object->getRenderRotation(); - } - else - { - selectNode->mSavedPositionGlobal = object->getPositionGlobal(); - selectNode->mSavedRotation = object->getRotationRegion(); - } - - selectNode->mSavedScale = object->getScale(); - selectNode->saveTextureScaleRatios(mManager->mTextureChannel); + + if (selectNode->mSelectedGLTFNode != -1) + { + // save GLTF node state + object->getGLTFNodeTransformAgent(selectNode->mSelectedGLTFNode, &selectNode->mSavedPositionLocal, &selectNode->mSavedRotation, &selectNode->mSavedScale); + selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent(selectNode->mSavedPositionLocal); + selectNode->mLastMoveLocal.setZero(); + } + else + { + selectNode->mSavedPositionLocal = object->getPosition(); + if (object->isAttachment()) + { + if (object->isRootEdit()) + { + LLXform* parent_xform = object->mDrawable->getXform()->getParent(); + if (parent_xform) + { + selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition()); + } + else + { + selectNode->mSavedPositionGlobal = object->getPositionGlobal(); + } + } + else + { + LLViewerObject* attachment_root = (LLViewerObject*)object->getParent(); + LLXform* parent_xform = attachment_root ? attachment_root->mDrawable->getXform()->getParent() : NULL; + if (parent_xform) + { + LLVector3 root_pos = (attachment_root->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); + LLQuaternion root_rot = (attachment_root->getRotation() * parent_xform->getWorldRotation()); + selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * root_rot) + root_pos); + } + else + { + selectNode->mSavedPositionGlobal = object->getPositionGlobal(); + } + } + selectNode->mSavedRotation = object->getRenderRotation(); + } + else + { + selectNode->mSavedPositionGlobal = object->getPositionGlobal(); + selectNode->mSavedRotation = object->getRotationRegion(); + } + + selectNode->mSavedScale = object->getScale(); + selectNode->saveTextureScaleRatios(mManager->mTextureChannel); + } return true; } } func(action_type, this); @@ -5261,9 +5279,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()) @@ -5282,19 +5300,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); @@ -5365,7 +5383,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() ); @@ -5579,7 +5597,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); @@ -5589,8 +5607,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) { @@ -5847,8 +5865,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()) @@ -5856,12 +5874,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 @@ -5869,12 +5887,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; } } @@ -5914,7 +5932,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); @@ -6008,7 +6026,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); @@ -6025,7 +6043,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) @@ -6070,7 +6088,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(); @@ -6106,7 +6124,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(); @@ -6183,12 +6201,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 { @@ -6203,8 +6221,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); } } @@ -6216,7 +6234,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(); @@ -6228,8 +6246,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; @@ -6303,8 +6321,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; @@ -6334,7 +6352,7 @@ void LLSelectMgr::updateSelectionSilhouette(LLObjectSelectionHandle object_handl } } } -void LLSelectMgr::renderSilhouettes(BOOL for_hud) +void LLSelectMgr::renderSilhouettes(bool for_hud) { if (!mRenderSilhouettes || !mRenderHighlightSelections) { @@ -6387,7 +6405,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) { @@ -6507,8 +6525,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; } @@ -6528,7 +6546,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(); @@ -6589,15 +6607,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), @@ -6682,18 +6700,17 @@ LLSelectNode::~LLSelectNode() } } - - delete mPermissions; + delete mPermissions; 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) { @@ -6711,11 +6728,22 @@ void LLSelectNode::selectTE(S32 te_index, BOOL selected) mLastTESelected = te_index; } -BOOL LLSelectNode::isTESelected(S32 te_index) const +void LLSelectNode::selectGLTFNode(S32 node_index, S32 primitive_index, bool selected) +{ + if (node_index < 0) + { + return; + } + + mSelectedGLTFNode = node_index; + mSelectedGLTFPrimitive = primitive_index; +} + +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; } @@ -6858,17 +6886,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. @@ -6878,7 +6906,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 { @@ -6894,7 +6922,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; } } @@ -6907,7 +6935,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. @@ -6942,7 +6970,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 ? true : false); } // check permissions to see if the agent can operate @@ -6979,7 +7007,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()) { @@ -7216,7 +7244,7 @@ void LLSelectMgr::updateSelectionCenter() // nothing selected, probably grabbing // Ignore by setting to avatar origin. mSelectionCenterGlobal.clearVec(); - mShowSelection = FALSE; + mShowSelection = false; mSelectionBBox = LLBBox(); resetAgentHUDZoom(); } @@ -7230,7 +7258,7 @@ void LLSelectMgr::updateSelectionCenter() resetAgentHUDZoom(); } - mShowSelection = FALSE; + mShowSelection = false; LLBBox bbox; // have stuff selected @@ -7239,7 +7267,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++) @@ -7254,7 +7282,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() ); @@ -7397,7 +7425,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; @@ -7408,7 +7436,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); } @@ -7416,7 +7444,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 } @@ -7426,7 +7454,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); } @@ -7434,7 +7462,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 @@ -7465,7 +7493,7 @@ void LLSelectMgr::doDelete() //----------------------------------------------------------------------------- // canDeselect() //----------------------------------------------------------------------------- -BOOL LLSelectMgr::canDeselect() const +bool LLSelectMgr::canDeselect() const { return !mSelectedObjects->isEmpty(); } @@ -7480,7 +7508,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 } @@ -7490,7 +7518,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) @@ -7529,17 +7557,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) @@ -7548,26 +7576,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; @@ -7701,7 +7729,7 @@ LLSelectNode* LLObjectSelection::findNode(LLViewerObject* objectp) //----------------------------------------------------------------------------- // isEmpty() //----------------------------------------------------------------------------- -BOOL LLObjectSelection::isEmpty() const +bool LLObjectSelection::isEmpty() const { return (mList.size() == 0); } @@ -8091,9 +8119,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++) @@ -8105,19 +8133,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; } @@ -8126,7 +8154,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) { @@ -8140,10 +8168,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); @@ -8151,7 +8179,7 @@ BOOL LLObjectSelection::contains(LLViewerObject* object, S32 te) return all_selected; } } - return FALSE; + return false; } else { @@ -8161,15 +8189,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); } @@ -8210,7 +8238,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) { @@ -8232,7 +8260,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) @@ -8258,7 +8286,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; @@ -8267,7 +8295,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 { @@ -8277,14 +8305,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 { @@ -8332,7 +8360,7 @@ LLViewerObject* LLObjectSelection::getFirstDeleteableObject() //----------------------------------------------------------------------------- // getFirstEditableObject() //----------------------------------------------------------------------------- -LLViewerObject* LLObjectSelection::getFirstEditableObject(BOOL get_parent) +LLViewerObject* LLObjectSelection::getFirstEditableObject(bool get_parent) { struct f : public LLSelectedNodeFunctor { @@ -8348,7 +8376,7 @@ LLViewerObject* LLObjectSelection::getFirstEditableObject(BOOL get_parent) //----------------------------------------------------------------------------- // getFirstMoveableObject() //----------------------------------------------------------------------------- -LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent) +LLViewerObject* LLObjectSelection::getFirstMoveableObject(bool get_parent) { struct f : public LLSelectedNodeFunctor { @@ -8364,7 +8392,7 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent) //----------------------------------------------------------------------------- // getFirstUndoEnabledObject() //----------------------------------------------------------------------------- -LLViewerObject* LLObjectSelection::getFirstUndoEnabledObject(BOOL get_parent) +LLViewerObject* LLObjectSelection::getFirstUndoEnabledObject(bool get_parent) { struct f : public LLSelectedNodeFunctor { @@ -8498,7 +8526,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); } } |