From 4ca8d3417ca0d98f723cbf708cb37ca4f0eeec93 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 6 Dec 2023 01:01:06 +0200 Subject: SL-18107 Allow dropping inventory onto a profile for sharing --- indra/newview/llpanelavatar.cpp | 5 ---- indra/newview/llpanelavatar.h | 2 -- indra/newview/llpanelgroupnotices.cpp | 7 ------ indra/newview/llpanelprofile.cpp | 46 +++++++++++++++++++++++++++++++++++ indra/newview/llpanelprofile.h | 6 +++++ 5 files changed, 52 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index ff33efe4aa..e3d887d943 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -39,11 +39,6 @@ LLProfileDropTarget::LLProfileDropTarget(const LLProfileDropTarget::Params& p) mAgentID(p.agent_id) {} -void LLProfileDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) -{ - LL_INFOS() << "LLProfileDropTarget::doDrop()" << LL_ENDL; -} - BOOL LLProfileDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index f182660c8e..bfde921df0 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -59,8 +59,6 @@ public: LLProfileDropTarget(const Params&); ~LLProfileDropTarget() {} - void doDrop(EDragAndDropType cargo_type, void* cargo_data); - // // LLView functionality virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 82f880c9ee..54121c2656 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -89,8 +89,6 @@ public: LLGroupDropTarget(const Params&); ~LLGroupDropTarget() {}; - void doDrop(EDragAndDropType cargo_type, void* cargo_data); - // // LLView functionality virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, @@ -114,11 +112,6 @@ LLGroupDropTarget::LLGroupDropTarget(const LLGroupDropTarget::Params& p) mGroupID(p.group_id) {} -void LLGroupDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) -{ - LL_INFOS() << "LLGroupDropTarget::doDrop()" << LL_ENDL; -} - BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index c2c9139c19..24091644e3 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -46,6 +46,7 @@ #include "lltexteditor.h" #include "lltexturectrl.h" #include "lltoggleablemenu.h" +#include "lltooldraganddrop.h" #include "llgrouplist.h" #include "llurlaction.h" @@ -998,6 +999,51 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key) mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCache, this, _1, _2)); } + +BOOL LLPanelProfileSecondLife::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + // Try children first + if (LLPanelProfileTab::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg) + && *accept != ACCEPT_NO) + { + return TRUE; + } + + // No point sharing with own profile + if (getSelfProfile()) + { + return FALSE; + } + + // Exclude fields that look like they are editable. + S32 child_x = 0; + S32 child_y = 0; + if (localPointToOtherView(x, y, &child_x, &child_y, mDescriptionEdit) + && mDescriptionEdit->pointInView(child_x, child_y)) + { + return FALSE; + } + + if (localPointToOtherView(x, y, &child_x, &child_y, mGroupList) + && mGroupList->pointInView(child_x, child_y)) + { + return FALSE; + } + + // Share + LLToolDragAndDrop::handleGiveDragAndDrop(getAvatarId(), + LLUUID::null, + drop, + cargo_type, + cargo_data, + accept); + return TRUE; +} + void LLPanelProfileSecondLife::updateData() { LLUUID avatar_id = getAvatarId(); diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 11632a10ae..45655cd67b 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -78,6 +78,12 @@ public: void onOpen(const LLSD& key) override; + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) override; + /** * LLFriendObserver trigger */ -- cgit v1.2.3 From ce75d0e63b5b0efa1f5e880ee029f95aed56f66d Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 6 Dec 2023 19:30:48 +0000 Subject: SL-20635 - adde::qd new data to ObjectUpdate message containing num attachments or child prims --- indra/newview/llviewerobject.cpp | 331 +++++++++++++-------------------------- indra/newview/llviewerobject.h | 2 - 2 files changed, 107 insertions(+), 226 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 2bcd0858d3..735b3c03b7 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1159,6 +1159,20 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, LL_DEBUGS("ObjectUpdate") << " mesgsys " << mesgsys << " dp " << dp << " id " << getID() << " update_type " << (S32) update_type << LL_ENDL; dumpStack("ObjectUpdateStack"); + // The new OBJECTDATA_FIELD_SIZE_124, OBJECTDATA_FIELD_SIZE_140, OBJECTDATA_FIELD_SIZE_80 + // and OBJECTDATA_FIELD_SIZE_64 lengths should be supported in the existing cases below. + // Each case should start at the beginning of the buffer and extract all known + // values, and ignore any unknown data at the end of the buffer. + // This allows new data in the future without breaking current viewers. + const S32 OBJECTDATA_FIELD_SIZE_140 = 140; // Full precision avatar update for future extended data + const S32 OBJECTDATA_FIELD_SIZE_124 = 124; // Full precision object update for future extended data + const S32 OBJECTDATA_FIELD_SIZE_76 = 76; // Full precision avatar update + const S32 OBJECTDATA_FIELD_SIZE_60 = 60; // Full precision object update + const S32 OBJECTDATA_FIELD_SIZE_80 = 80; // Terse avatar update, 16 bit precision for future extended data + const S32 OBJECTDATA_FIELD_SIZE_64 = 64; // Terse object update, 16 bit precision for future extended data + const S32 OBJECTDATA_FIELD_SIZE_48 = 48; // Terse avatar update, 16 bit precision + const S32 OBJECTDATA_FIELD_SIZE_32 = 32; // Terse object update, 16 bit precision + U32 retval = 0x0; // If region is removed from the list it is also deleted. @@ -1206,7 +1220,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, U32 x, y; from_region_handle(region_handle, &x, &y); - LL_ERRS() << "Object has invalid region " << x << ":" << y << "!" << LL_ENDL; + LL_WARNS("UpdateFail") << "Object has invalid region " << x << ":" << y << "!" << LL_ENDL; return retval; } @@ -1233,8 +1247,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, const F32 size = LLWorld::getInstance()->getRegionWidthInMeters(); const F32 MAX_HEIGHT = LLWorld::getInstance()->getRegionMaxHeight(); const F32 MIN_HEIGHT = LLWorld::getInstance()->getRegionMinHeight(); - S32 length; - S32 count; + S32 length = 0; + S32 count = 0; S32 this_update_precision = 32; // in bits // Temporaries, because we need to compare w/ previous to set dirty flags... @@ -1295,6 +1309,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, mesgsys->getVector3Fast(_PREHASH_ObjectData, _PREHASH_Scale, new_scale, block_num ); length = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_ObjectData); mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_ObjectData, data, length, block_num, MAX_OBJECT_BINARY_DATA_SIZE); + length = llmin(length, MAX_OBJECT_BINARY_DATA_SIZE); // getBinaryDataFast() safely fills the buffer to max_size mTotalCRC = crc; // Might need to update mSourceMuted here to properly pick up new radius @@ -1314,20 +1329,23 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, } setClickAction(click_action); - count = 0; - LLVector4 collision_plane; - + count = 0; + LLVector4 collision_plane; + switch(length) { - case (60 + 16): + case OBJECTDATA_FIELD_SIZE_140: + case OBJECTDATA_FIELD_SIZE_76: // pull out collision normal for avatar htolememcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); ((LLVOAvatar*)this)->setFootPlane(collision_plane); count += sizeof(LLVector4); - // fall through - case 60: + [[fallthrough]]; + + case OBJECTDATA_FIELD_SIZE_124: + case OBJECTDATA_FIELD_SIZE_60: this_update_precision = 32; - // this is a terse update + // this is a full precision update // pos htolememcpy(new_pos_parent.mV, &data[count], MVT_LLVector3, sizeof(LLVector3)); count += sizeof(LLVector3); @@ -1352,117 +1370,21 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, resetRot(); } setAngularVelocity(new_angv); + count += sizeof(LLVector3); #if LL_DARWIN - if (length == 76) + if (length == OBJECTDATA_FIELD_SIZE_76 || + length == OBJECTDATA_FIELD_SIZE_140) { setAngularVelocity(LLVector3::zero); } #endif break; - case(32 + 16): - // pull out collision normal for avatar - htolememcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); - ((LLVOAvatar*)this)->setFootPlane(collision_plane); - count += sizeof(LLVector4); - // fall through - case 32: - this_update_precision = 16; - test_pos_parent.quantize16(-0.5f*size, 1.5f*size, MIN_HEIGHT, MAX_HEIGHT); - - // This is a terse 16 update, so treat data as an array of U16's. -#ifdef LL_BIG_ENDIAN - htolememcpy(valswizzle, &data[count], MVT_U16Vec3, 6); - val = valswizzle; -#else - val = (U16 *) &data[count]; -#endif - count += sizeof(U16)*3; - new_pos_parent.mV[VX] = U16_to_F32(val[VX], -0.5f*size, 1.5f*size); - new_pos_parent.mV[VY] = U16_to_F32(val[VY], -0.5f*size, 1.5f*size); - new_pos_parent.mV[VZ] = U16_to_F32(val[VZ], MIN_HEIGHT, MAX_HEIGHT); - -#ifdef LL_BIG_ENDIAN - htolememcpy(valswizzle, &data[count], MVT_U16Vec3, 6); - val = valswizzle; -#else - val = (U16 *) &data[count]; -#endif - count += sizeof(U16)*3; - setVelocity(LLVector3(U16_to_F32(val[VX], -size, size), - U16_to_F32(val[VY], -size, size), - U16_to_F32(val[VZ], -size, size))); - -#ifdef LL_BIG_ENDIAN - htolememcpy(valswizzle, &data[count], MVT_U16Vec3, 6); - val = valswizzle; -#else - val = (U16 *) &data[count]; -#endif - count += sizeof(U16)*3; - setAcceleration(LLVector3(U16_to_F32(val[VX], -size, size), - U16_to_F32(val[VY], -size, size), - U16_to_F32(val[VZ], -size, size))); - -#ifdef LL_BIG_ENDIAN - htolememcpy(valswizzle, &data[count], MVT_U16Quat, 4); - val = valswizzle; -#else - val = (U16 *) &data[count]; -#endif - count += sizeof(U16)*4; - new_rot.mQ[VX] = U16_to_F32(val[VX], -1.f, 1.f); - new_rot.mQ[VY] = U16_to_F32(val[VY], -1.f, 1.f); - new_rot.mQ[VZ] = U16_to_F32(val[VZ], -1.f, 1.f); - new_rot.mQ[VW] = U16_to_F32(val[VW], -1.f, 1.f); - -#ifdef LL_BIG_ENDIAN - htolememcpy(valswizzle, &data[count], MVT_U16Vec3, 6); - val = valswizzle; -#else - val = (U16 *) &data[count]; -#endif - new_angv.setVec(U16_to_F32(val[VX], -size, size), - U16_to_F32(val[VY], -size, size), - U16_to_F32(val[VZ], -size, size)); - if (new_angv.isExactlyZero()) - { - // reset rotation time - resetRot(); - } - setAngularVelocity(new_angv); - break; - case 16: - this_update_precision = 8; - test_pos_parent.quantize8(-0.5f*size, 1.5f*size, MIN_HEIGHT, MAX_HEIGHT); - // this is a terse 8 update - new_pos_parent.mV[VX] = U8_to_F32(data[0], -0.5f*size, 1.5f*size); - new_pos_parent.mV[VY] = U8_to_F32(data[1], -0.5f*size, 1.5f*size); - new_pos_parent.mV[VZ] = U8_to_F32(data[2], MIN_HEIGHT, MAX_HEIGHT); - - setVelocity(U8_to_F32(data[3], -size, size), - U8_to_F32(data[4], -size, size), - U8_to_F32(data[5], -size, size) ); - - setAcceleration(U8_to_F32(data[6], -size, size), - U8_to_F32(data[7], -size, size), - U8_to_F32(data[8], -size, size) ); - - new_rot.mQ[VX] = U8_to_F32(data[9], -1.f, 1.f); - new_rot.mQ[VY] = U8_to_F32(data[10], -1.f, 1.f); - new_rot.mQ[VZ] = U8_to_F32(data[11], -1.f, 1.f); - new_rot.mQ[VW] = U8_to_F32(data[12], -1.f, 1.f); - - new_angv.setVec(U8_to_F32(data[13], -size, size), - U8_to_F32(data[14], -size, size), - U8_to_F32(data[15], -size, size) ); - if (new_angv.isExactlyZero()) - { - // reset rotation time - resetRot(); - } - setAngularVelocity(new_angv); - break; + // length values 48, 32 and 16 were once in viewer code but + // are never sent by the SL simulator + default: + LL_WARNS("UpdateFail") << "Unexpected ObjectData buffer size " << length + << " for " << getID() << " with OUT_FULL message" << LL_ENDL; } //////////////////////////////////////////////////// @@ -1496,20 +1418,50 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (mData) { delete [] mData; - } + mData = NULL; + } - // Check for appended generic data - S32 data_size = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_Data); - if (data_size <= 0) - { - mData = NULL; - } - else - { - // ...has generic data - mData = new U8[data_size]; - mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, mData, data_size, block_num); - } + // Dec 2023 new generic data: + // Trees work as before, this field contains genome data + // Not a tree: + // avatars send 1 byte with the number of attachments + // root objects send 1 byte with the number of prims in the linkset + // If the generic data size is zero, then number of attachments or prims is zero + // + // Viewers should not match the data size exactly, but if the field has data, + // read the 1st byte as described above, and ignore the rest. + + // Check for appended generic data + const S32 GENERIC_DATA_BUFFER_SIZE = 16; + S32 data_size = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_Data); + if (data_size > 0) + { // has generic data + if (getPCode() == LL_PCODE_LEGACY_TREE || getPCode() == LL_PCODE_TREE_NEW) + { + mData = new U8[data_size]; + mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, mData, data_size, block_num); + LL_DEBUGS("NewObjectData") << "Read " << data_size << " bytes tree genome data for " << getID() << ", pcode " + << getPCodeString() << ", value " << (S32) mData[0] << LL_ENDL; + } + else + { // Extract number of prims or attachments + U8 generic_data[GENERIC_DATA_BUFFER_SIZE]; + mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, + &generic_data[0], llmin(data_size, GENERIC_DATA_BUFFER_SIZE), block_num); + // This is sample code to extract the number of attachments or prims + // Future viewers should use it for their own purposes + if (isAvatar()) + { + LL_DEBUGS("NewObjectData") << "Avatar " << getID() << " has " + << (S32) generic_data[0] << " attachments" << LL_ENDL; + } + else + { + LL_DEBUGS("NewObjectData") << "Root prim " << getID() << " has " + << (S32) generic_data[0] << " prims in linkset" << LL_ENDL; + } + } + } S32 text_size = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_Text); if (text_size > 1) @@ -1605,60 +1557,24 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, #endif length = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_ObjectData); mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_ObjectData, data, length, block_num, MAX_OBJECT_BINARY_DATA_SIZE); - count = 0; + length = llmin(length, MAX_OBJECT_BINARY_DATA_SIZE); // getBinaryDataFast() safely fills the buffer to max_size + count = 0; LLVector4 collision_plane; - + switch(length) { - case(60 + 16): + case OBJECTDATA_FIELD_SIZE_80: + case OBJECTDATA_FIELD_SIZE_48: // pull out collision normal for avatar htolememcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); ((LLVOAvatar*)this)->setFootPlane(collision_plane); count += sizeof(LLVector4); - // fall through - case 60: - // this is a terse 32 update - // pos - this_update_precision = 32; - htolememcpy(new_pos_parent.mV, &data[count], MVT_LLVector3, sizeof(LLVector3)); - count += sizeof(LLVector3); - // vel - htolememcpy((void*)getVelocity().mV, &data[count], MVT_LLVector3, sizeof(LLVector3)); - count += sizeof(LLVector3); - // acc - htolememcpy((void*)getAcceleration().mV, &data[count], MVT_LLVector3, sizeof(LLVector3)); - count += sizeof(LLVector3); - // theta - { - LLVector3 vec; - htolememcpy(vec.mV, &data[count], MVT_LLVector3, sizeof(LLVector3)); - new_rot.unpackFromVector3(vec); - } - count += sizeof(LLVector3); - // omega - htolememcpy((void*)new_angv.mV, &data[count], MVT_LLVector3, sizeof(LLVector3)); - if (new_angv.isExactlyZero()) - { - // reset rotation time - resetRot(); - } - setAngularVelocity(new_angv); -#if LL_DARWIN - if (length == 76) - { - setAngularVelocity(LLVector3::zero); - } -#endif - break; - case(32 + 16): - // pull out collision normal for avatar - htolememcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); - ((LLVOAvatar*)this)->setFootPlane(collision_plane); - count += sizeof(LLVector4); - // fall through - case 32: - // this is a terse 16 update - this_update_precision = 16; + [[fallthrough]]; + + case OBJECTDATA_FIELD_SIZE_64: + case OBJECTDATA_FIELD_SIZE_32: + // this is a terse 16 bit quantized update + this_update_precision = 16; test_pos_parent.quantize16(-0.5f*size, 1.5f*size, MIN_HEIGHT, MAX_HEIGHT); #ifdef LL_BIG_ENDIAN @@ -1718,33 +1634,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, setAngularVelocity(new_angv); break; - case 16: - // this is a terse 8 update - this_update_precision = 8; - test_pos_parent.quantize8(-0.5f*size, 1.5f*size, MIN_HEIGHT, MAX_HEIGHT); - new_pos_parent.mV[VX] = U8_to_F32(data[0], -0.5f*size, 1.5f*size); - new_pos_parent.mV[VY] = U8_to_F32(data[1], -0.5f*size, 1.5f*size); - new_pos_parent.mV[VZ] = U8_to_F32(data[2], MIN_HEIGHT, MAX_HEIGHT); - - setVelocity(U8_to_F32(data[3], -size, size), - U8_to_F32(data[4], -size, size), - U8_to_F32(data[5], -size, size) ); - - setAcceleration(U8_to_F32(data[6], -size, size), - U8_to_F32(data[7], -size, size), - U8_to_F32(data[8], -size, size) ); - - new_rot.mQ[VX] = U8_to_F32(data[9], -1.f, 1.f); - new_rot.mQ[VY] = U8_to_F32(data[10], -1.f, 1.f); - new_rot.mQ[VZ] = U8_to_F32(data[11], -1.f, 1.f); - new_rot.mQ[VW] = U8_to_F32(data[12], -1.f, 1.f); - - new_angv.set(U8_to_F32(data[13], -size, size), - U8_to_F32(data[14], -size, size), - U8_to_F32(data[15], -size, size) ); - setAngularVelocity(new_angv); - break; - } + // Previous viewers had code for length 76, 60 or 16 byte length + // with full precision or 8 bit quanitzation, but the + // SL servers will never send those data formats. If you ever see this + // warning on a SL server, please file a bug report + default: + LL_WARNS("UpdateFail") << "Unexpected ObjectData buffer size " << length << " for " << getID() + << " with OUT_FULL message" << LL_ENDL; + } U8 state; mesgsys->getU8Fast(_PREHASH_ObjectData, _PREHASH_State, state, block_num ); @@ -1753,13 +1650,13 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, } default: + LL_WARNS("UpdateFail") << "Unknown uncompressed update type " << update_type << " for " << getID() << LL_ENDL; break; - } } else { - // handle the compressed case + // handle the compressed case - have dp datapacker LLUUID sound_uuid; LLUUID owner_id; F32 gain = 0; @@ -2013,6 +1910,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, break; default: + LL_WARNS("UpdateFail") << "Unknown compressed update type " << update_type << " for " << getID() << LL_ENDL; break; } } @@ -2060,7 +1958,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (sent_parentp && sent_parentp->getParent() == this) { // Try to recover if we attempt to attach a parent to its child - LL_WARNS() << "Attempt to attach a parent to it's child: " << this->getID() << " to " << sent_parentp->getID() << LL_ENDL; + LL_WARNS("UpdateFail") << "Attempt to attach a parent to it's child: " << this->getID() << " to " + << sent_parentp->getID() << LL_ENDL; this->removeChild(sent_parentp); sent_parentp->setDrawableParent(NULL); } @@ -2084,7 +1983,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, { if (mDrawable->isDead() || !mDrawable->getVObj()) { - LL_WARNS() << "Drawable is dead or no VObj!" << LL_ENDL; + LL_WARNS("UpdateFail") << "Drawable is dead or no VObj!" << LL_ENDL; sent_parentp->addChild(this); } else @@ -2094,9 +1993,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Bad, we got a cycle somehow. // Kill both the parent and the child, and // set cache misses for both of them. - LL_WARNS() << "Attempting to recover from parenting cycle!" << LL_ENDL; - LL_WARNS() << "Killing " << sent_parentp->getID() << " and " << getID() << LL_ENDL; - LL_WARNS() << "Adding to cache miss list" << LL_ENDL; + LL_WARNS("UpdateFail") << "Attempting to recover from parenting cycle! " + << "Killing " << sent_parentp->getID() << " and " << getID() + << ", Adding to cache miss list" << LL_ENDL; setParent(NULL); sent_parentp->setParent(NULL); getRegion()->addCacheMissFull(getLocalID()); @@ -2751,22 +2650,6 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& frame_tim -BOOL LLViewerObject::setData(const U8 *datap, const U32 data_size) -{ - delete [] mData; - - if (datap) - { - mData = new U8[data_size]; - if (!mData) - { - return FALSE; - } - memcpy(mData, datap, data_size); /* Flawfinder: ignore */ - } - return TRUE; -} - // delete an item in the inventory, but don't tell the server. This is // used internally by remove, update, and savescript. // This will only delete the first item with an item_id in the list diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 80da7b2f73..b85dcc5da2 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -779,8 +779,6 @@ protected: static LLViewerObject *createObject(const LLUUID &id, LLPCode pcode, LLViewerRegion *regionp, S32 flags = 0); - BOOL setData(const U8 *datap, const U32 data_size); - // Hide or show HUD, icon and particles void hideExtraDisplayItems( BOOL hidden ); -- cgit v1.2.3 From 01a083ea647c2defcf7eace823f74f85321c97c5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 8 Dec 2023 01:58:24 +0200 Subject: SL-20672 Support marketplace in gallery view --- indra/newview/llinventorygallerymenu.cpp | 127 +++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index 5f4b816b99..647f3c9ec4 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -295,6 +295,54 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata) preview_texture->saveAs(); } } + else if (("copy_to_marketplace_listings" == action) + || ("move_to_marketplace_listings" == action)) + { + LLViewerInventoryItem* itemp = gInventory.getItem(mUUIDs.front()); + bool copy_operation = "copy_to_marketplace_listings" == action; + bool can_copy = itemp ? itemp->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()) : false; + + + if (can_copy) + { + const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); + if (itemp) + { + move_item_to_marketplacelistings(itemp, marketplacelistings_id, copy_operation); + } + } + else + { + uuid_vec_t lamdba_list = mUUIDs; + LLNotificationsUtil::add( + "ConfirmCopyToMarketplace", + LLSD(), + LLSD(), + [lamdba_list](const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + // option == 0 Move no copy item(s) + // option == 1 Don't move no copy item(s) (leave them behind) + bool copy_and_move = option == 0; + const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); + + // main inventory only allows one item? + LLViewerInventoryItem* itemp = gInventory.getItem(lamdba_list.front()); + if (itemp) + { + if (itemp->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + move_item_to_marketplacelistings(itemp, marketplacelistings_id, true); + } + else if (copy_and_move) + { + move_item_to_marketplacelistings(itemp, marketplacelistings_id, false); + } + } + } + ); + } + } } void LLInventoryGalleryContextMenu::rename(const LLUUID& item_id) @@ -388,6 +436,44 @@ bool is_inbox_folder(LLUUID item_id) return gInventory.isObjectDescendentOf(item_id, inbox_id); } +bool can_list_on_marketplace(const LLUUID &id) +{ + const LLInventoryObject* obj = gInventory.getObject(id); + bool can_list = (obj != NULL); + + if (can_list) + { + const LLUUID& object_id = obj->getLinkedUUID(); + can_list = object_id.notNull(); + + if (can_list) + { + std::string error_msg; + const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); + if (marketplacelistings_id.notNull()) + { + LLViewerInventoryCategory* master_folder = gInventory.getCategory(marketplacelistings_id); + LLInventoryCategory* cat = gInventory.getCategory(id); + if (cat) + { + can_list = can_move_folder_to_marketplace(master_folder, master_folder, cat, error_msg); + } + else + { + LLInventoryItem* item = gInventory.getItem(id); + can_list = (item ? can_move_item_to_marketplace(master_folder, master_folder, item, error_msg) : false); + } + } + else + { + can_list = false; + } + } + } + + return can_list; +} + void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* menu) { LLUUID selected_id = mUUIDs.front(); @@ -707,6 +793,47 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men disabled_items.push_back(std::string("New Folder")); disabled_items.push_back(std::string("upload_def")); } + + // Marketplace + bool can_list = false; + const LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); + if (marketplacelistings_id.notNull() && !is_inbox && !obj->getIsLinkType()) + { + if (is_folder) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(selected_id); + if (cat + && !LLFolderType::lookupIsProtectedType(cat->getPreferredType()) + && gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID())) + { + can_list = true; + } + } + else + { + LLViewerInventoryItem* item = gInventory.getItem(selected_id); + if (item + && item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()) + && item->getPermissions().getOwner() != ALEXANDRIA_LINDEN_ID + && LLAssetType::AT_CALLINGCARD != item->getType()) + { + can_list = true; + } + } + } + + if (can_list) + { + items.push_back(std::string("Marketplace Separator")); + items.push_back(std::string("Marketplace Copy")); + items.push_back(std::string("Marketplace Move")); + + if (!can_list_on_marketplace(selected_id)) + { + disabled_items.push_back(std::string("Marketplace Copy")); + disabled_items.push_back(std::string("Marketplace Move")); + } + } } hide_context_entries(*menu, items, disabled_items); -- cgit v1.2.3 From 3777dbb3d6ed9b3411eef71c10182afed19c974b Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 8 Dec 2023 23:57:40 +0000 Subject: More sl-20635 - moved new attachment data to AvatarAppearance message --- indra/newview/llvoavatar.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 35e45c6cd9..2ddd174ba7 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -9266,7 +9266,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe //mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0); } - // Parse the AppearanceData field, if any. + // Parse the AppearanceHover field, if any. contents.mHoverOffsetWasSet = false; if (mesgsys->has(_PREHASH_AppearanceHover)) { @@ -9276,7 +9276,24 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe contents.mHoverOffset = hover; contents.mHoverOffsetWasSet = true; } - + + // Get attachment info, if sent + LLUUID attachment_id; + U8 attach_point; + S32 attach_count = mesgsys->getNumberOfBlocksFast(_PREHASH_AttachmentBlock); + LL_DEBUGS("AVAppearanceAttachments") << "Agent " << getID() << " has " + << attach_count << " attachments" << LL_ENDL; + + for (S32 attach_i = 0; attach_i < attach_count; attach_i++) + { + mesgsys->getUUIDFast(_PREHASH_AttachmentBlock, _PREHASH_ID, attachment_id, attach_i); + mesgsys->getU8Fast(_PREHASH_AttachmentBlock, _PREHASH_AttachmentPoint, attach_point, attach_i); + LL_DEBUGS("AVAppearanceAttachments") << "AV " << getID() << " has attachment " << attach_i << " " + << (attachment_id.isNull() ? "pending" : attachment_id.asString()) + << " on point " << (S32)attach_point << LL_ENDL; + // To do - store and use this information as needed + } + // Parse visual params, if any. S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam); static LLCachedControl block_some_avatars(gSavedSettings, "BlockSomeAvatarAppearanceVisualParams"); -- cgit v1.2.3 From d4c3300f9b81296f765c83c1e822251e86d91925 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 11 Dec 2023 17:30:49 +0000 Subject: sl-20635 - cleaned up code after reading it yet again --- indra/newview/llviewerobject.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 735b3c03b7..c5d4c6dc09 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1423,13 +1423,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Dec 2023 new generic data: // Trees work as before, this field contains genome data - // Not a tree: - // avatars send 1 byte with the number of attachments - // root objects send 1 byte with the number of prims in the linkset - // If the generic data size is zero, then number of attachments or prims is zero + // Not a tree: root objects send 1 byte with the number of + // total prims in the linkset + // If the generic data size is zero, then number of prims is 1 // - // Viewers should not match the data size exactly, but if the field has data, - // read the 1st byte as described above, and ignore the rest. + // Viewers should not check for specific data sizes exactly, but if + // the field has data, process it from the start and ignore the remainder. // Check for appended generic data const S32 GENERIC_DATA_BUFFER_SIZE = 16; @@ -1444,21 +1443,17 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, << getPCodeString() << ", value " << (S32) mData[0] << LL_ENDL; } else - { // Extract number of prims or attachments + { // Extract number of prims U8 generic_data[GENERIC_DATA_BUFFER_SIZE]; mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, &generic_data[0], llmin(data_size, GENERIC_DATA_BUFFER_SIZE), block_num); - // This is sample code to extract the number of attachments or prims + // This is sample code to extract the number of prims // Future viewers should use it for their own purposes - if (isAvatar()) - { - LL_DEBUGS("NewObjectData") << "Avatar " << getID() << " has " - << (S32) generic_data[0] << " attachments" << LL_ENDL; - } - else + if (!isAvatar()) { + S32 num_prims = (S32) generic_data[0]; LL_DEBUGS("NewObjectData") << "Root prim " << getID() << " has " - << (S32) generic_data[0] << " prims in linkset" << LL_ENDL; + << num_prims << " prims in linkset" << LL_ENDL; } } } @@ -1637,7 +1632,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Previous viewers had code for length 76, 60 or 16 byte length // with full precision or 8 bit quanitzation, but the // SL servers will never send those data formats. If you ever see this - // warning on a SL server, please file a bug report + // warning in Second Life, please file a bug report default: LL_WARNS("UpdateFail") << "Unexpected ObjectData buffer size " << length << " for " << getID() << " with OUT_FULL message" << LL_ENDL; -- cgit v1.2.3 From 3b99af03ca5774bd817c803842eecfc205f77afd Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 8 Dec 2023 23:19:37 +0200 Subject: SL-20672 Item and folder creation support Moving everything manually doesn't seem like a right way, probably need to make LLFolderView draw grids and then relace with LLInventoryPanel --- indra/newview/llinventorybridge.cpp | 6 - indra/newview/llinventorygallery.cpp | 33 +++ indra/newview/llinventorygallery.h | 1 + indra/newview/llinventorygallerymenu.cpp | 73 ++++++- indra/newview/llpanelmaininventory.cpp | 1 + .../default/xui/en/menu_gallery_inventory.xml | 228 +++++++++++++++++++++ 6 files changed, 325 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index cb5316ddf4..40e0c66c23 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4359,12 +4359,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items if (!isInboxFolder() // don't allow creation in inbox && outfits_id != mUUID) { - bool menu_items_added = false; // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) { items.push_back(std::string("New Folder")); - menu_items_added = true; } if (!isMarketplaceListingsFolder()) { @@ -4381,10 +4379,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { disabled_items.push_back("New Settings"); } - } - if (menu_items_added) - { - items.push_back(std::string("Create Separator")); } } getClipboardEntries(false, items, disabled_items, flags); diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 62180bb066..97b82a581c 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -2010,6 +2010,39 @@ void LLInventoryGallery::pasteAsLink(const LLUUID& dest, } } +void LLInventoryGallery::doCreate(const LLUUID& dest, const LLSD& userdata) +{ + + LLViewerInventoryCategory* cat = gInventory.getCategory(dest); + if (cat && mFolderID != dest) + { + menu_create_inventory_item(NULL, dest, userdata, LLUUID::null); + } + else + { + // todo: needs to reset current floater's filter, + // like reset_inventory_filter() + + LLHandle handle = getHandle(); + std::function callback_cat_created = + [handle](const LLUUID& new_id) + { + gInventory.notifyObservers(); + LLInventoryGallery* panel = static_cast(handle.get()); + if (panel && new_id.notNull()) + { + panel->clearSelection(); + if (panel->mItemMap.count(new_id) != 0) + { + panel->addItemSelection(new_id, true); + } + } + }; + + menu_create_inventory_item(NULL, mFolderID, userdata, LLUUID::null, callback_cat_created); + } +} + void LLInventoryGallery::claimEditHandler() { gEditMenuHandler = this; diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index 9b3f12701f..95df9eeb69 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -165,6 +165,7 @@ public: void deleteSelection(); bool canDeleteSelection(); void pasteAsLink(); + void doCreate(const LLUUID& dest, const LLSD& userdata); void setSortOrder(U32 order, bool update = false); U32 getSortOrder() { return mSortOrder; }; diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index 647f3c9ec4..def66c8968 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -32,9 +32,11 @@ #include "llappearancemgr.h" #include "llavataractions.h" #include "llclipboard.h" +#include "llenvironment.h" #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" +#include "llfriendcard.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" @@ -57,11 +59,33 @@ LLContextMenu* LLInventoryGalleryContextMenu::createMenu() registrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryGalleryContextMenu::fileUploadLocation, this, _2)); registrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH)); registrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND)); + registrar.add("Inventory.DoCreate", [this](LLUICtrl*, const LLSD& data) + { + if (mRootFolder) + { + mGallery->doCreate(mGallery->getRootFolder(), data); + } + else + { + mGallery->doCreate(mUUIDs.front(), data); + } + }); std::set uuids(mUUIDs.begin(), mUUIDs.end()); registrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, uuids, gFloaterView->getParentFloater(mGallery))); enable_registrar.add("Inventory.CanSetUploadLocation", boost::bind(&LLInventoryGalleryContextMenu::canSetUploadLocation, this, _2)); + enable_registrar.add("Inventory.EnvironmentEnabled", [](LLUICtrl*, const LLSD&) + { + return LLEnvironment::instance().isInventoryEnabled(); + }); + enable_registrar.add("Inventory.MaterialsEnabled", [](LLUICtrl*, const LLSD&) + { + std::string agent_url = gAgent.getRegionCapability("UpdateMaterialAgentInventory"); + std::string task_url = gAgent.getRegionCapability("UpdateMaterialTaskInventory"); + + return (!agent_url.empty() && !task_url.empty()); + }); LLContextMenu* menu = createFromFile("menu_gallery_inventory.xml"); @@ -495,6 +519,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men bool is_in_trash = gInventory.isObjectDescendentOf(selected_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH)); bool is_lost_and_found = (selected_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); bool is_outfits= (selected_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS)); + bool is_in_favorites = gInventory.isObjectDescendentOf(selected_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE)); //bool is_favorites= (selected_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE)); bool is_system_folder = false; @@ -589,11 +614,30 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men } else { + if (is_agent_inventory && !is_inbox && !is_cof && !is_in_favorites && !is_outfits) + { + LLViewerInventoryCategory* category = gInventory.getCategory(selected_id); + if (!category || !LLFriendCardsManager::instance().isCategoryInFriendFolder(category)) + { + items.push_back(std::string("New Folder")); + } + + items.push_back(std::string("create_new")); + items.push_back(std::string("New Script")); + items.push_back(std::string("New Note")); + items.push_back(std::string("New Gesture")); + items.push_back(std::string("New Material")); + items.push_back(std::string("New Clothes")); + items.push_back(std::string("New Body Parts")); + items.push_back(std::string("New Settings")); + } + if(can_share_item(selected_id)) { items.push_back(std::string("Share")); } - if (LLClipboard::instance().hasContents() && is_agent_inventory && !is_cof && !is_inbox_folder(selected_id)) + + if (LLClipboard::instance().hasContents() && is_agent_inventory && !is_cof && !is_inbox) { items.push_back(std::string("Paste")); @@ -605,7 +649,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men } if (is_folder && is_agent_inventory) { - if (!is_cof && (folder_type != LLFolderType::FT_OUTFIT) && !is_outfits && !is_inbox_folder(selected_id)) + if (!is_cof && (folder_type != LLFolderType::FT_OUTFIT) && !is_outfits && !is_inbox) { if (!gInventory.isObjectDescendentOf(selected_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD)) && !isRootFolder()) { @@ -792,6 +836,17 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men disabled_items.push_back(std::string("New Folder")); disabled_items.push_back(std::string("upload_def")); + disabled_items.push_back(std::string("create_new")); + } + + if (is_agent_inventory && !mRootFolder) + { + items.push_back(std::string("New folder from selected")); + items.push_back(std::string("Subfolder Separator")); + if (!is_only_items_selected(mUUIDs) && !is_only_cats_selected(mUUIDs)) + { + disabled_items.push_back(std::string("New folder from selected")); + } } // Marketplace @@ -809,16 +864,12 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men can_list = true; } } - else + else if (selected_item + && selected_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()) + && selected_item->getPermissions().getOwner() != ALEXANDRIA_LINDEN_ID + && LLAssetType::AT_CALLINGCARD != selected_item->getType()) { - LLViewerInventoryItem* item = gInventory.getItem(selected_id); - if (item - && item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()) - && item->getPermissions().getOwner() != ALEXANDRIA_LINDEN_ID - && LLAssetType::AT_CALLINGCARD != item->getType()) - { - can_list = true; - } + can_list = true; } } diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 20241aac24..a5a768776a 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -56,6 +56,7 @@ #include "lltrans.h" #include "llviewermenu.h" #include "llviewertexturelist.h" +#include "llviewerinventory.h" #include "llsidepanelinventory.h" #include "llfolderview.h" #include "llradiogroup.h" diff --git a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml index d82c453e5f..feaba45cf8 100644 --- a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml @@ -426,6 +426,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Date: Thu, 14 Dec 2023 01:19:24 +0200 Subject: SL-20672 Added outfit related menu options to gallery --- indra/newview/llinventorygallerymenu.cpp | 106 +++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index def66c8968..f653641bb2 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -50,6 +50,41 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" + +void modify_outfit(BOOL append, const LLUUID& cat_id, LLInventoryModel* model) +{ + LLViewerInventoryCategory* cat = model->getCategory(cat_id); + if (!cat) return; + + // checking amount of items to wear + static LLCachedControl max_items(gSavedSettings, "WearFolderLimit", 125); + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false); + model->collectDescendentsIf(cat_id, + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + not_worn); + + if (items.size() > max_items()) + { + LLSD args; + args["AMOUNT"] = llformat("%d", max_items); + LLNotificationsUtil::add("TooManyWearables", args); + return; + } + if (model->isObjectDescendentOf(cat_id, gInventory.getRootFolderID())) + { + LLAppearanceMgr::instance().wearInventoryCategory(cat, FALSE, append); + } + else + { + // Library, we need to copy content first + LLAppearanceMgr::instance().wearInventoryCategory(cat, TRUE, append); + } +} + LLContextMenu* LLInventoryGalleryContextMenu::createMenu() { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; @@ -210,6 +245,22 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata) { ungroup_folder_items(mUUIDs.front()); } + else if ("replaceoutfit" == action) + { + modify_outfit(FALSE, mUUIDs.front(), &gInventory); + } + else if ("addtooutfit" == action) + { + modify_outfit(TRUE, mUUIDs.front(), &gInventory); + } + else if ("removefromoutfit" == action) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(mUUIDs.front()); + if (cat) + { + LLAppearanceMgr::instance().takeOffOutfit(cat->getLinkedUUID()); + } + } else if ("take_off" == action || "detach" == action) { for (LLUUID& selected_id : mUUIDs) @@ -498,6 +549,18 @@ bool can_list_on_marketplace(const LLUUID &id) return can_list; } +bool check_folder_for_contents_of_type(const LLUUID &id, LLInventoryModel* model, LLInventoryCollectFunctor& is_type) +{ + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + model->collectDescendentsIf(id, + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_type); + return item_array.size() > 0; +} + void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* menu) { LLUUID selected_id = mUUIDs.front(); @@ -567,6 +630,49 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men items.push_back(std::string("open_in_new_window")); items.push_back(std::string("Open Folder Separator")); } + + // wearables related functionality for folders. + LLFindWearables is_wearable; + LLIsType is_object(LLAssetType::AT_OBJECT); + LLIsType is_gesture(LLAssetType::AT_GESTURE); + + if (check_folder_for_contents_of_type(selected_id, &gInventory, is_wearable) + || check_folder_for_contents_of_type(selected_id, &gInventory, is_object) + || check_folder_for_contents_of_type(selected_id, &gInventory, is_gesture)) + { + // Only enable add/replace outfit for non-system folders. + if (!is_system_folder) + { + // Adding an outfit onto another (versus replacing) doesn't make sense. + if (folder_type != LLFolderType::FT_OUTFIT) + { + items.push_back(std::string("Add To Outfit")); + if (!LLAppearanceMgr::instance().getCanAddToCOF(selected_id)) + { + disabled_items.push_back(std::string("Add To Outfit")); + } + } + + items.push_back(std::string("Replace Outfit")); + if (!LLAppearanceMgr::instance().getCanReplaceCOF(selected_id)) + { + disabled_items.push_back(std::string("Replace Outfit")); + } + } + if (is_agent_inventory) + { + items.push_back(std::string("Folder Wearables Separator")); + // Note: If user tries to unwear "My Inventory", it's going to deactivate everything including gestures + // Might be safer to disable this for "My Inventory" + items.push_back(std::string("Remove From Outfit")); + if (folder_type != LLFolderType::FT_ROOT_INVENTORY // Unless COF is empty, whih shouldn't be, warrantied to have worn items + && !LLAppearanceMgr::getCanRemoveFromCOF(selected_id)) // expensive from root! + { + disabled_items.push_back(std::string("Remove From Outfit")); + } + } + items.push_back(std::string("Outfit Separator")); + } } else { -- cgit v1.2.3 From 3954e5d802d29009abdc8a58438cea333df632a3 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 15 Dec 2023 09:03:52 +0200 Subject: DRTVWR-600 macos buildfix --- indra/newview/llinventorygallerymenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index f653641bb2..c8ac73b838 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -70,7 +70,7 @@ void modify_outfit(BOOL append, const LLUUID& cat_id, LLInventoryModel* model) if (items.size() > max_items()) { LLSD args; - args["AMOUNT"] = llformat("%d", max_items); + args["AMOUNT"] = llformat("%d", static_cast(max_items)); LLNotificationsUtil::add("TooManyWearables", args); return; } -- cgit v1.2.3 From e104f7ce0291ed1f7ab170714e319408bf076221 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 20 Dec 2023 17:41:03 +0100 Subject: DRTVWR-600 windows build fix --- indra/newview/llmaterialeditor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index a5437f7a88..5e78e15c72 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -2131,7 +2131,7 @@ bool LLMaterialEditor::canModifyObjectsMaterial() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; - return can_use_objects_material(func, std::vector({PERM_MODIFY}), permissions, item_out); + return can_use_objects_material(func, std::vector({PERM_MODIFY}), permissions, item_out); } bool LLMaterialEditor::canSaveObjectsMaterial() @@ -2139,7 +2139,7 @@ bool LLMaterialEditor::canSaveObjectsMaterial() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; - return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item_out); + return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item_out); } bool LLMaterialEditor::canClipboardObjectsMaterial() @@ -2165,7 +2165,7 @@ bool LLMaterialEditor::canClipboardObjectsMaterial() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; - return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY, PERM_TRANSFER}), permissions, item_out); + return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY, PERM_TRANSFER}), permissions, item_out); } void LLMaterialEditor::saveObjectsMaterialAs() @@ -2173,7 +2173,7 @@ void LLMaterialEditor::saveObjectsMaterialAs() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item = nullptr; - bool allowed = can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item); + bool allowed = can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item); if (!allowed) { LL_WARNS("MaterialEditor") << "Failed to save GLTF material from object" << LL_ENDL; -- cgit v1.2.3 From 74c8b028d42a8c5b080bb861e427f38cedd4ad7c Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 15 Dec 2023 18:26:14 +0100 Subject: SL-20743 Use LLMutex in LLImageBase for internal data thread-safety --- indra/newview/lldrawpoolbump.cpp | 8 ++++++-- indra/newview/llfasttimerview.cpp | 2 ++ indra/newview/llfloater360capture.cpp | 4 ++++ indra/newview/llfloaterauction.cpp | 2 ++ indra/newview/llfloatercolorpicker.cpp | 2 ++ indra/newview/llfloaterimagepreview.cpp | 1 + indra/newview/llinventorygallerymenu.cpp | 2 +- indra/newview/llmaterialeditor.cpp | 2 ++ indra/newview/llmeshrepository.cpp | 20 ++++++++++++-------- indra/newview/llnetmap.cpp | 2 ++ indra/newview/llsnapshotlivepreview.cpp | 10 ++++++++-- indra/newview/lltexturecache.cpp | 11 +++++++---- indra/newview/lltexturecache.h | 2 +- indra/newview/lltexturefetch.cpp | 7 ++++++- indra/newview/lltinygltfhelper.cpp | 9 ++++++--- indra/newview/llviewerassetupload.cpp | 2 ++ indra/newview/llviewerparceloverlay.cpp | 2 ++ indra/newview/llviewertexture.cpp | 3 +++ indra/newview/llviewertexturelist.cpp | 4 ++++ indra/newview/llviewerwindow.cpp | 6 ++++++ indra/newview/llvoavatar.cpp | 4 +++- indra/newview/llvoavatar.h | 2 +- indra/newview/llvosky.cpp | 4 +++- indra/newview/llvosky.h | 2 ++ indra/newview/llvovolume.cpp | 6 ++++-- indra/newview/llwebprofile.cpp | 4 +++- 26 files changed, 95 insertions(+), 28 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index a0ce0ef6cf..77a196380b 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -849,11 +849,14 @@ void LLBumpImageList::onSourceStandardLoaded( BOOL success, LLViewerFetchedTextu void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nrm_image) { + LLImageDataSharedLock lockIn(src); + LLImageDataLock lockOut(nrm_image); + U8* nrm_data = nrm_image->getData(); S32 resX = src->getWidth(); S32 resY = src->getHeight(); - U8* src_data = src->getData(); + const U8* src_data = src->getData(); S32 src_cmp = src->getComponents(); @@ -911,6 +914,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; + LLImageDataSharedLock lock(src); bump_image_map_t& entries_list(bump_code == BE_BRIGHTNESS ? gBumpImageList.mBrightnessEntries : gBumpImageList.mDarknessEntries ); bump_image_map_t::iterator iter = entries_list.find(source_asset_id); @@ -933,7 +937,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI U8* dst_data = dst_image->getData(); S32 dst_data_size = dst_image->getDataSize(); - U8* src_data = src->getData(); + const U8* src_data = src->getData(); S32 src_data_size = src->getDataSize(); S32 src_components = src->getComponents(); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 5b8ca6c49c..9cf9f45bfb 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -448,6 +448,8 @@ void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch // disable use of glReadPixels which messes up nVidia nSight graphics debugging if (!LLRender::sNsightDebugSupport) { + LLImageDataSharedLock lock(scratch); + //read result back into raw image glReadPixels(0, 0, 1024, 512, GL_RGB, GL_UNSIGNED_BYTE, scratch->getData()); diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 2c638fa959..a0890b7f9d 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -360,6 +360,8 @@ void LLFloater360Capture::encodeAndSave(LLPointer raw_image, const s int jpeg_encode_quality = gSavedSettings.getU32("360CaptureJPEGEncodeQuality"); LLPointer jpeg_image = new LLImageJPEG(jpeg_encode_quality); + LLImageDataSharedLock lock(raw_image); + // Actually encode the JPEG image. This is where a lot of time // is spent now that the snapshot capture process has been // optimized. The encode_time parameter doesn't appear to be @@ -410,6 +412,8 @@ void LLFloater360Capture::suspendForAFrame() // Probably not needed anymore but saving here just in case. void LLFloater360Capture::mockSnapShot(LLImageRaw* raw) { + LLImageDataLock lock(raw); + unsigned int width = raw->getWidth(); unsigned int height = raw->getHeight(); unsigned int depth = raw->getComponents(); diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 9813156bf2..6996224dcb 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -190,6 +190,8 @@ void LLFloaterAuction::onClickSnapshot(void* data) if (success) { + LLImageDataLock lock(raw); + self->mTransactionID.generate(); self->mImageID = self->mTransactionID.makeAssetID(gAgent.getSecureSessionID()); diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index ba91277c79..af96fdbcfd 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -135,6 +135,8 @@ void LLFloaterColorPicker::createUI () // create RGB type area (not really RGB but it's got R,G & B in it.,.. LLPointer raw = new LLImageRaw ( mRGBViewerImageWidth, mRGBViewerImageHeight, mComponents ); + LLImageDataLock lock(raw); + U8* bits = raw->getData(); S32 linesize = mRGBViewerImageWidth * mComponents; for ( S32 y = 0; y < mRGBViewerImageHeight; ++y ) diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index ba0f97e2e1..5e7978e224 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -789,6 +789,7 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) if (imagep) { + LLImageDataSharedLock lock(imagep); mVolume->sculpt(imagep->getWidth(), imagep->getHeight(), imagep->getComponents(), imagep->getData(), 0, false); } diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index c8ac73b838..e966514955 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -70,7 +70,7 @@ void modify_outfit(BOOL append, const LLUUID& cat_id, LLInventoryModel* model) if (items.size() > max_items()) { LLSD args; - args["AMOUNT"] = llformat("%d", static_cast(max_items)); + args["AMOUNT"] = llformat("%u", max_items()); LLNotificationsUtil::add("TooManyWearables", args); return; } diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 5e78e15c72..415543eb37 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -3424,6 +3424,8 @@ void LLMaterialEditor::inventoryChanged(LLViewerObject* object, void LLMaterialEditor::saveTexture(LLImageJ2C* img, const std::string& name, const LLUUID& asset_id, upload_callback_f cb) { + LLImageDataSharedLock lock(img); + if (asset_id.isNull() || img == nullptr || img->getDataSize() == 0) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 01d6469010..2622c23314 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2360,17 +2360,19 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) std::stringstream texture_str; if (texture != NULL && include_textures && mUploadTextures) { - if(texture->hasSavedRawImage()) - { + if (texture->hasSavedRawImage()) + { + LLImageDataLock lock(texture->getSavedRawImage()); + LLPointer upload_file = LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage()); if (!upload_file.isNull() && upload_file->getDataSize()) { - texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); + texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); + } } } - } if (texture != NULL && mUploadTextures && @@ -2514,17 +2516,19 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) std::stringstream texture_str; if (texture != NULL && include_textures && mUploadTextures) { - if(texture->hasSavedRawImage()) - { + if (texture->hasSavedRawImage()) + { + LLImageDataLock lock(texture->getSavedRawImage()); + LLPointer upload_file = LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage()); if (!upload_file.isNull() && upload_file->getDataSize()) { - texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); + texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); + } } } - } if (texture != NULL && mUploadTextures && diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 0ba3c3d691..e7f9d0e5df 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -345,6 +345,7 @@ void LLNetMap::draw() mObjectImageCenterGlobal = viewPosToGlobal(llfloor(new_center.mV[VX]), llfloor(new_center.mV[VY])); // Create the base texture. + LLImageDataLock lock(mObjectRawImagep); U8 *default_texture = mObjectRawImagep->getData(); memset( default_texture, 0, mObjectImagep->getWidth() * mObjectImagep->getHeight() * mObjectImagep->getComponents() ); @@ -915,6 +916,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, return; } + LLImageDataLock lock(mObjectRawImagep); U8 *datap = mObjectRawImagep->getData(); S32 neg_radius = diameter / 2; diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index b7a1832b17..bb7c73b59f 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -766,6 +766,8 @@ void LLSnapshotLivePreview::prepareFreezeFrame() // Get the decoded version of the formatted image getEncodedImage(); + LLImageDataSharedLock lock(mPreviewImageEncoded); + // We need to scale that a bit for display... LLPointer scaled = new LLImageRaw( mPreviewImageEncoded->getData(), @@ -825,13 +827,15 @@ LLPointer LLSnapshotLivePreview::getEncodedImage() { if (!mPreviewImageEncoded) { + LLImageDataSharedLock lock(mPreviewImage); + mPreviewImageEncoded = new LLImageRaw; - + mPreviewImageEncoded->resize( mPreviewImage->getWidth(), mPreviewImage->getHeight(), mPreviewImage->getComponents()); - + if (getSnapshotType() == LLSnapshotModel::SNAPSHOT_TEXTURE) { // We don't store the intermediate formatted image in mFormattedImage in the J2C case @@ -978,6 +982,8 @@ void LLSnapshotLivePreview::getSize(S32& w, S32& h) const void LLSnapshotLivePreview::saveTexture(BOOL outfit_snapshot, std::string name) { + LLImageDataSharedLock lock(mPreviewImage); + LL_DEBUGS("Snapshot") << "saving texture: " << mPreviewImage->getWidth() << "x" << mPreviewImage->getHeight() << LL_ENDL; // gen a new uuid for this asset LLTransactionID tid; diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index a14d4f7a30..dfaeeaab62 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -96,7 +96,7 @@ private: public: LLTextureCacheWorker(LLTextureCache* cache, const LLUUID& id, - U8* data, S32 datasize, S32 offset, + const U8* data, S32 datasize, S32 offset, S32 imagesize, // for writes LLTextureCache::Responder* responder) : LLWorkerClass(cache, "LLTextureCacheWorker"), @@ -145,7 +145,7 @@ protected: LLUUID mID; U8* mReadData; - U8* mWriteData; + const U8* mWriteData; S32 mDataSize; S32 mOffset; S32 mImageSize; @@ -239,7 +239,7 @@ class LLTextureCacheRemoteWorker : public LLTextureCacheWorker { public: LLTextureCacheRemoteWorker(LLTextureCache* cache, const LLUUID& id, - U8* data, S32 datasize, S32 offset, + const U8* data, S32 datasize, S32 offset, S32 imagesize, // for writes LLPointer raw, S32 discardlevel, LLTextureCache::Responder* responder) @@ -1961,7 +1961,7 @@ bool LLTextureCache::readComplete(handle_t handle, bool abort) } LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, - U8* data, S32 datasize, S32 imagesize, + const U8* data, S32 datasize, S32 imagesize, LLPointer rawimage, S32 discardlevel, WriteResponder* responder) { @@ -2047,6 +2047,9 @@ LLPointer LLTextureCache::readFromFastCache(const LLUUID& id, S32& d bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointer raw, S32 discardlevel) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; + + LLImageDataSharedLock lock(raw); + //rescale image if needed if (raw.isNull() || raw->isBufferInvalid() || !raw->getData()) { diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 43e91b3e4c..cba45393f9 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -125,7 +125,7 @@ public: handle_t readFromCache(const LLUUID& id, S32 offset, S32 size, ReadResponder* responder); bool readComplete(handle_t handle, bool abort); - handle_t writeToCache(const LLUUID& id, U8* data, S32 datasize, S32 imagesize, LLPointer rawimage, S32 discardlevel, + handle_t writeToCache(const LLUUID& id, const U8* data, S32 datasize, S32 imagesize, LLPointer rawimage, S32 discardlevel, WriteResponder* responder); LLPointer readFromFastCache(const LLUUID& id, S32& discardlevel); bool writeComplete(handle_t handle, bool abort = false); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 38c9b3717d..4ecabf666b 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1699,7 +1699,9 @@ bool LLTextureFetchWorker::doWork(S32 param) mFormattedImage = new LLImageJ2C; // default } } - + + LLImageDataLock lock(mFormattedImage); + if (mHaveAllData) //the image file is fully loaded. { mFileSize = total_size; @@ -1857,6 +1859,9 @@ bool LLTextureFetchWorker::doWork(S32 param) //return false; return doWork(param); } + + LLImageDataSharedLock lock(mFormattedImage); + S32 datasize = mFormattedImage->getDataSize(); if(mFileSize < datasize)//This could happen when http fetching and sim fetching mixed. { diff --git a/indra/newview/lltinygltfhelper.cpp b/indra/newview/lltinygltfhelper.cpp index 999be07dba..cee18489f0 100644 --- a/indra/newview/lltinygltfhelper.cpp +++ b/indra/newview/lltinygltfhelper.cpp @@ -31,7 +31,7 @@ #include "llviewertexture.h" #include "llviewertexturelist.h" -void strip_alpha_channel(LLPointer& img) +static void strip_alpha_channel(LLPointer& img) { if (img->getComponents() == 4) { @@ -45,13 +45,13 @@ void strip_alpha_channel(LLPointer& img) // PRECONDITIONS: // dst_img must be 3 component // src_img and dst_image must have the same dimensions -void copy_red_channel(LLPointer& src_img, LLPointer& dst_img) +static void copy_red_channel(const LLPointer& src_img, LLPointer& dst_img) { llassert(src_img->getWidth() == dst_img->getWidth() && src_img->getHeight() == dst_img->getHeight()); llassert(dst_img->getComponents() == 3); U32 pixel_count = dst_img->getWidth() * dst_img->getHeight(); - U8* src = src_img->getData(); + const U8* src = src_img->getData(); U8* dst = dst_img->getData(); S8 src_components = src_img->getComponents(); @@ -95,6 +95,8 @@ void LLTinyGLTFHelper::initFetchedTextures(tinygltf::Material& material, int mr_idx = material.pbrMetallicRoughness.metallicRoughnessTexture.index; if (occlusion_idx != mr_idx) { + LLImageDataLock lockIn(occlusion_img); + LLImageDataLock lockOut(mr_img); //scale occlusion image to match resolution of mr image occlusion_img->scale(mr_img->getWidth(), mr_img->getHeight()); @@ -104,6 +106,7 @@ void LLTinyGLTFHelper::initFetchedTextures(tinygltf::Material& material, } else if (occlusion_img) { + LLImageDataSharedLock lock(occlusion_img); //no mr but occlusion exists, make a white mr_img and copy occlusion red channel over mr_img = new LLImageRaw(occlusion_img->getWidth(), occlusion_img->getHeight(), 3); mr_img->clear(255, 255, 255); diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index a2b0b04092..dcb14eb383 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -654,6 +654,8 @@ LLBufferedAssetUploadInfo::LLBufferedAssetUploadInfo(LLUUID itemId, LLPointer(image->getCodec()); switch (codec) diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 785c84c38d..e1f372d396 100755 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -344,6 +344,8 @@ void LLViewerParcelOverlay::updateOverlayTexture() const LLColor4U for_sale = LLUIColorTable::instance().getColor("PropertyColorForSale").get(); const LLColor4U auction = LLUIColorTable::instance().getColor("PropertyColorAuction").get(); + LLImageDataLock lock(mImageRaw); + // Create the base texture. U8 *raw = mImageRaw->getData(); const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index ec6f2c848f..820a051782 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -285,6 +285,7 @@ LLPointer LLViewerTextureManager::getLocalTexture(const U32 wid LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(const LLImageRaw* raw, FTType type, bool usemipmaps) { + LLImageDataSharedLock lock(raw); LLViewerFetchedTexture* ret = new LLViewerFetchedTexture(raw, type, usemipmaps); gTextureList.addImage(ret, TEX_LIST_STANDARD); return ret; @@ -2905,6 +2906,8 @@ void LLViewerFetchedTexture::saveRawImage() return; } + LLImageDataSharedLock lock(mRawImage); + mSavedRawDiscardLevel = mRawDiscardLevel; if (mBoostLevel == LLGLTexture::BOOST_ICON) { diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index f898fb7142..7931b74b11 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1252,6 +1252,8 @@ bool LLViewerTextureList::createUploadFile(LLPointer raw_image, { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; + LLImageDataSharedLock lock(raw_image); + // make a copy, since convertToUploadFile scales raw image LLPointer scale_image = new LLImageRaw( raw_image->getData(), @@ -1357,6 +1359,8 @@ BOOL LLViewerTextureList::createUploadFile(const std::string& filename, LLPointer LLViewerTextureList::convertToUploadFile(LLPointer raw_image, const S32 max_image_dimentions, bool force_square, bool force_lossless) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; + LLImageDataLock lock(raw_image); + if (force_square) { S32 biggest_side = llmax(raw_image->getWidth(), raw_image->getHeight()); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ba2b6e1c7c..27ec8d9376 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4890,6 +4890,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei { return FALSE; } + //check if there is enough memory for the snapshot image if(image_width * image_height > (1 << 22)) //if snapshot image is larger than 2K by 2K { @@ -5008,6 +5009,9 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei image_buffer_x = llfloor(snapshot_width * scale_factor) ; image_buffer_y = llfloor(snapshot_height * scale_factor) ; } + + LLImageDataLock lock(raw); + if ((image_buffer_x > 0) && (image_buffer_y > 0)) { raw->resize(image_buffer_x, image_buffer_y, 3); @@ -5266,6 +5270,8 @@ BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_ display(do_rebuild, zoom, subfield, for_snapshot); } + LLImageDataSharedLock lock(raw); + glReadPixels( 0, 0, image_width, diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fee00eb6f4..8ab7cda28c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8894,7 +8894,7 @@ void LLVOAvatar::clearChat() } -void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index) +void LLVOAvatar::applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index) { if (index >= BAKED_NUM_INDICES) { @@ -9770,6 +9770,8 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture { if(aux_src && aux_src->getComponents() == 1) { + LLImageDataSharedLock lock(aux_src); + if (!aux_src->getData()) { LL_ERRS() << "No auxiliary source (morph mask) data for image id " << id << LL_ENDL; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 48bfd5293a..759d02959c 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -590,7 +590,7 @@ public: // Morph masks //-------------------------------------------------------------------- public: - /*virtual*/ void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES); + /*virtual*/ void applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES); BOOL morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES); diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 20621665fa..db197335f2 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -166,6 +166,7 @@ S32 LLSkyTex::getWhich(const BOOL curr) void LLSkyTex::initEmpty(const S32 tex) { + LLImageDataLock lock(mImageRaw[tex]); U8* data = mImageRaw[tex]->getData(); for (S32 i = 0; i < SKYTEX_RESOLUTION; ++i) { @@ -187,7 +188,8 @@ void LLSkyTex::initEmpty(const S32 tex) void LLSkyTex::create() { - U8* data = mImageRaw[sCurrent]->getData(); + LLImageDataSharedLock lock(mImageRaw[sCurrent]); + const U8* data = mImageRaw[sCurrent]->getData(); for (S32 i = 0; i < SKYTEX_RESOLUTION; ++i) { for (S32 j = 0; j < SKYTEX_RESOLUTION; ++j) diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 5941ab6e3b..509ad97786 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -101,6 +101,7 @@ protected: void setPixel(const LLColor4U &col, const S32 i, const S32 j) { + LLImageDataSharedLock lock(mImageRaw[sCurrent]); S32 offset = (i * SKYTEX_RESOLUTION + j) * SKYTEX_COMPONENTS; U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]); *pix = col.asRGBA(); @@ -109,6 +110,7 @@ protected: LLColor4U getPixel(const S32 i, const S32 j) { LLColor4U col; + LLImageDataSharedLock lock(mImageRaw[sCurrent]); S32 offset = (i * SKYTEX_RESOLUTION + j) * SKYTEX_COMPONENTS; U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]); col.fromRGBA( *pix ); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ec2f490742..8846e30145 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1311,11 +1311,13 @@ void LLVOVolume::sculpt() } } else - { + { + LLImageDataSharedLock lock(raw_image); + sculpt_height = raw_image->getHeight(); sculpt_width = raw_image->getWidth(); sculpt_components = raw_image->getComponents(); - + sculpt_data = raw_image->getData(); if(LLViewerTextureManager::sTesterp) diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index f2d7e4585a..ade9bbd847 100644 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -239,10 +239,12 @@ LLCore::BufferArray::ptr_t LLWebProfile::buildPostData(const LLSD &data, LLPoint << "Content-Disposition: form-data; name=\"file\"; filename=\"snapshot.png\"\r\n" << "Content-Type: image/png\r\n\r\n"; + LLImageDataSharedLock lock(image); + // Insert the image data. //char *datap = (char *)(image->getData()); //bas.write(datap, image->getDataSize()); - U8* image_data = image->getData(); + const U8* image_data = image->getData(); for (S32 i = 0; i < image->getDataSize(); ++i) { bas << image_data[i]; -- cgit v1.2.3 From d12fbf7ec19ffaf046d2bd37b05e448690f2b320 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 20 Dec 2023 17:41:03 +0100 Subject: Build fix for Visual Studio update (std::vector) (cherry picked from commit a7dcb0df2a11377b1112dfa0720e876507e1ae3d) --- indra/newview/llmaterialeditor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index a5437f7a88..5e78e15c72 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -2131,7 +2131,7 @@ bool LLMaterialEditor::canModifyObjectsMaterial() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; - return can_use_objects_material(func, std::vector({PERM_MODIFY}), permissions, item_out); + return can_use_objects_material(func, std::vector({PERM_MODIFY}), permissions, item_out); } bool LLMaterialEditor::canSaveObjectsMaterial() @@ -2139,7 +2139,7 @@ bool LLMaterialEditor::canSaveObjectsMaterial() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; - return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item_out); + return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item_out); } bool LLMaterialEditor::canClipboardObjectsMaterial() @@ -2165,7 +2165,7 @@ bool LLMaterialEditor::canClipboardObjectsMaterial() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; - return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY, PERM_TRANSFER}), permissions, item_out); + return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY, PERM_TRANSFER}), permissions, item_out); } void LLMaterialEditor::saveObjectsMaterialAs() @@ -2173,7 +2173,7 @@ void LLMaterialEditor::saveObjectsMaterialAs() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item = nullptr; - bool allowed = can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item); + bool allowed = can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), permissions, item); if (!allowed) { LL_WARNS("MaterialEditor") << "Failed to save GLTF material from object" << LL_ENDL; -- cgit v1.2.3 From f62b8591a29481ce882b1e50246f848475d3fb6a Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 5 Jan 2024 19:45:58 +0100 Subject: DRTVWR-489 MacOS Release build fix (vertex_count and index_count aren't used) --- indra/newview/llvotree.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 36e6da802b..575b1dbe7e 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -865,6 +865,10 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) mReferenceBuffer->unmapBuffer(); llassert(vertex_count == max_vertices); llassert(index_count == max_indices); +#ifndef SHOW_ASSERT + (void)vertex_count; + (void)index_count; +#endif } //generate tree mesh -- cgit v1.2.3 From 82d8b2a7209a96cdc38dd8e77f458cac3ffeedbd Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 5 Jan 2024 19:01:40 +0000 Subject: sl-20635 attempts at build fixes, added a few stray log messages about log file changes --- indra/newview/llappviewer.cpp | 1 + indra/newview/llviewercontrol.cpp | 1 + indra/newview/llviewerobject.cpp | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4a43133ff6..557ee1ab16 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2342,6 +2342,7 @@ void LLAppViewer::initLoggingAndGetLastDuration() // Set the log file to SecondLife.log LLError::logToFile(log_file); + LL_INFOS() << "Started logging to " << log_file << LL_ENDL; if (!duration_log_msg.empty()) { LL_WARNS("MarkerFile") << duration_log_msg << LL_ENDL; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 7738cb904e..61cc1dee25 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -450,6 +450,7 @@ static bool handleLogFileChanged(const LLSD& newvalue) std::string log_filename = newvalue.asString(); LLFile::remove(log_filename); LLError::logToFile(log_filename); + LL_INFOS() << "Logging switched to " << log_filename << LL_ENDL; return true; } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 2669c956e1..c4e5fcc7b6 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1340,7 +1340,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, htolememcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); ((LLVOAvatar*)this)->setFootPlane(collision_plane); count += sizeof(LLVector4); - [[fallthrough]]; case OBJECTDATA_FIELD_SIZE_124: case OBJECTDATA_FIELD_SIZE_60: @@ -1564,7 +1563,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, htolememcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); ((LLVOAvatar*)this)->setFootPlane(collision_plane); count += sizeof(LLVector4); - [[fallthrough]]; case OBJECTDATA_FIELD_SIZE_64: case OBJECTDATA_FIELD_SIZE_32: -- cgit v1.2.3 From eca0021b7dfd40d5b573ae5530cf44edbe3a0994 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 5 Jan 2024 21:17:08 +0000 Subject: Fix VIEWER_VERSION.txt so it passes pre-commit ? --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 0e7b60da8a..a8a1887568 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -7.1.2 \ No newline at end of file +7.1.2 -- cgit v1.2.3 From b489142cb1af0fd469c0a5cedf60040a413f4fbd Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 20 Dec 2023 17:41:03 +0100 Subject: Build fix for Visual Studio update (std::vector) --- indra/newview/llmaterialeditor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 9f59a13590..c066a7b5c3 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -2228,7 +2228,7 @@ bool LLMaterialEditor::canModifyObjectsMaterial() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; - return can_use_objects_material(func, std::vector({PERM_MODIFY}), ItemSource::OBJECT, permissions, item_out); + return can_use_objects_material(func, std::vector({PERM_MODIFY}), ItemSource::OBJECT, permissions, item_out); } bool LLMaterialEditor::canSaveObjectsMaterial() @@ -2236,7 +2236,7 @@ bool LLMaterialEditor::canSaveObjectsMaterial() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; - return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), ItemSource::AGENT, permissions, item_out); + return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), ItemSource::AGENT, permissions, item_out); } bool LLMaterialEditor::canClipboardObjectsMaterial() @@ -2262,7 +2262,7 @@ bool LLMaterialEditor::canClipboardObjectsMaterial() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item_out; - return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY, PERM_TRANSFER}), ItemSource::OBJECT, permissions, item_out); + return can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY, PERM_TRANSFER}), ItemSource::OBJECT, permissions, item_out); } void LLMaterialEditor::saveObjectsMaterialAs() @@ -2270,7 +2270,7 @@ void LLMaterialEditor::saveObjectsMaterialAs() LLSelectedTEGetMatData func(true); LLPermissions permissions; LLViewerInventoryItem* item = nullptr; - bool allowed = can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), ItemSource::AGENT, permissions, item); + bool allowed = can_use_objects_material(func, std::vector({PERM_COPY, PERM_MODIFY}), ItemSource::AGENT, permissions, item); if (!allowed) { LL_WARNS("MaterialEditor") << "Failed to save GLTF material from object" << LL_ENDL; -- cgit v1.2.3 From 44f509a3197b95860da60e5a149bd894df79d828 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 10 Jan 2024 06:40:58 +0100 Subject: SL-20752 Mouselook no longer allows pitch upwards to full 90 degrees --- indra/newview/llagent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3853aaa8fd..e7234303a8 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1473,8 +1473,9 @@ void LLAgent::pitch(F32 angle) // after left-clicking the mouse on the avatar and dragging down // // The issue is observed on angle below 10 degrees + bool isMouseLookOn = mControlFlags & AGENT_CONTROL_MOUSELOOK; const F32 look_down_limit = 179.f * DEG_TO_RAD; - const F32 look_up_limit = 10.f * DEG_TO_RAD; + const F32 look_up_limit = (isMouseLookOn ? 1.f : 10.f) * DEG_TO_RAD; F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward); -- cgit v1.2.3 From 91a6aa95e7b6303c4fd7b2394ee2ec422f3979ba Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 10 Jan 2024 17:44:12 +0100 Subject: SL-20244 Maint A - On-screen animesh characters that start pelvis offset animations disappear when root goes off-screen --- indra/newview/llspatialpartition.h | 1 - indra/newview/llvovolume.cpp | 24 ------------------------ 2 files changed, 25 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 758e716c00..19408ec5de 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -729,7 +729,6 @@ class LLControlAVBridge : public LLVolumeBridge using super = LLVolumeBridge; public: LLControlAVBridge(LLDrawable* drawablep, LLViewerRegion* regionp); - virtual void updateSpatialExtents(); }; class LLHUDBridge : public LLVolumeBridge diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8846e30145..ad6c39de48 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5056,30 +5056,6 @@ LLControlAVBridge::LLControlAVBridge(LLDrawable* drawablep, LLViewerRegion* regi mPartitionType = LLViewerRegion::PARTITION_CONTROL_AV; } -void LLControlAVBridge::updateSpatialExtents() -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE - - LLSpatialGroup* root = (LLSpatialGroup*)mOctree->getListener(0); - - bool rootWasDirty = root->isDirty(); - - super::updateSpatialExtents(); // root becomes non-dirty here - - // SL-18251 "On-screen animesh characters using pelvis offset animations - // disappear when root goes off-screen" - // - // Expand extents to include Control Avatar placed outside of the bounds - LLControlAvatar* controlAvatar = getVObj() ? getVObj()->getControlAvatar() : NULL; - if (controlAvatar - && controlAvatar->mDrawable - && controlAvatar->mDrawable->getEntry() - && (rootWasDirty || controlAvatar->mPlaying)) - { - root->expandExtents(controlAvatar->mDrawable->getSpatialExtents(), *mDrawable->getXform()); - } -} - bool can_batch_texture(LLFace* facep) { if (facep->getTextureEntry()->getBumpmap()) -- cgit v1.2.3 From da967da9c7aa0d88f478d476e8bb059ba79ca818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Thu, 11 Jan 2024 11:32:15 +0100 Subject: Rename OS X to macOS, mostly in comments We only support 10.13+ now, and it's been called macOS since 10.12. References in code to older versions are unchanged. --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llappviewermacosx-objc.mm | 2 +- indra/newview/llappviewermacosx.cpp | 2 +- indra/newview/llviewerjoystick.cpp | 2 +- indra/newview/llvoicevivox.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 00b59f9a4d..8f651a0294 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9022,7 +9022,7 @@ RenderHiDPI Comment - Enable support for HiDPI displays, like Retina (MacOS X ONLY, requires restart) + Enable support for HiDPI displays, like Retina (macOS ONLY, requires restart) Persist 1 Type diff --git a/indra/newview/llappviewermacosx-objc.mm b/indra/newview/llappviewermacosx-objc.mm index 17301847e8..81ab4e0feb 100644 --- a/indra/newview/llappviewermacosx-objc.mm +++ b/indra/newview/llappviewermacosx-objc.mm @@ -25,7 +25,7 @@ */ #if !defined LL_DARWIN - #error "Use only with Mac OS X" + #error "Use only with macOS" #endif #import diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 8b313a321b..72e38cc1ea 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -27,7 +27,7 @@ #include "llviewerprecompiledheaders.h" #if !defined LL_DARWIN - #error "Use only with Mac OS X" + #error "Use only with macOS" #endif #define LL_CARBON_CRASH_HANDLER 1 diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index e35cb26ce1..dfa47e82b3 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -1414,7 +1414,7 @@ void LLViewerJoystick::setSNDefaults() #if LL_DARWIN || LL_LINUX const float platformScale = 20.f; const float platformScaleAvXZ = 1.f; - // The SpaceNavigator doesn't act as a 3D cursor on OS X / Linux. + // The SpaceNavigator doesn't act as a 3D cursor on macOS / Linux. const bool is_3d_cursor = false; #else const float platformScale = 1.f; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 3725510b6a..c4cd1779b7 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5314,7 +5314,7 @@ std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid) LLStringUtil::replaceChar(result, '+', '-'); LLStringUtil::replaceChar(result, '/', '_'); - // If you need to transform a GUID to this form on the Mac OS X command line, this will do so: + // If you need to transform a GUID to this form on the macOS command line, this will do so: // echo -n x && (echo e669132a-6c43-4ee1-a78d-6c82fff59f32 |xxd -r -p |openssl base64|tr '/+' '_-') // The reverse transform can be done with: -- cgit v1.2.3 From 469f2621f170484943093a830ec385f1b8d20934 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 17 Jan 2024 00:30:37 +0200 Subject: SL-20708 don't reset "Quality & speed" slider when canceling Advanced Settings --- indra/newview/llfloaterpreference.cpp | 23 ++++++++++++++-------- indra/newview/llfloaterpreference.h | 10 ++++------ .../llfloaterpreferencesgraphicsadvanced.cpp | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index aa723eb3a8..d15c52cc24 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -620,7 +620,7 @@ void LLFloaterPreference::apply() saveAvatarProperties(); } -void LLFloaterPreference::cancel() +void LLFloaterPreference::cancel(const std::vector settings_to_skip) { LLTabContainer* tabcontainer = getChild("pref core"); // Call cancel() on all panels that derive from LLPanelPreference @@ -630,7 +630,7 @@ void LLFloaterPreference::cancel() LLView* view = *iter; LLPanelPreference* panel = dynamic_cast(view); if (panel) - panel->cancel(); + panel->cancel(settings_to_skip); } // hide joystick pref floater LLFloaterReg::hideInstance("pref_joystick"); @@ -1011,15 +1011,16 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata) } refresh(); } - cancel(); - + if (userdata.asString() == "closeadvanced") { + cancel({"RenderQualityPerformance"}); LLFloaterReg::hideInstance("prefs_graphics_advanced"); updateMaxComplexity(); } else { + cancel(); closeFloater(); } } @@ -2206,7 +2207,7 @@ void LLPanelPreference::toggleMuteWhenMinimized() } } -void LLPanelPreference::cancel() +void LLPanelPreference::cancel(const std::vector settings_to_skip) { for (control_values_map_t::iterator iter = mSavedValues.begin(); iter != mSavedValues.end(); ++iter) @@ -2219,6 +2220,12 @@ void LLPanelPreference::cancel() continue; } + auto found = std::find(settings_to_skip.begin(), settings_to_skip.end(), control->getName()); + if (found != settings_to_skip.end()) + { + continue; + } + control->set(ctrl_value); } @@ -2461,9 +2468,9 @@ void LLPanelPreferenceGraphics::resetDirtyChilds() } } -void LLPanelPreferenceGraphics::cancel() +void LLPanelPreferenceGraphics::cancel(const std::vector settings_to_skip) { - LLPanelPreference::cancel(); + LLPanelPreference::cancel(settings_to_skip); } void LLPanelPreferenceGraphics::saveSettings() { @@ -2751,7 +2758,7 @@ void LLPanelPreferenceControls::apply() } } -void LLPanelPreferenceControls::cancel() +void LLPanelPreferenceControls::cancel(const std::vector settings_to_skip) { for (U32 i = 0; i < LLKeyConflictHandler::MODE_COUNT - 1; ++i) { diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 04ac87364d..bdade3c1b9 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -79,7 +79,7 @@ public: ~LLFloaterPreference(); void apply(); - void cancel(); + void cancel(const std::vector settings_to_skip = {}); /*virtual*/ void draw(); /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); @@ -251,7 +251,7 @@ public: virtual ~LLPanelPreference(); virtual void apply(); - virtual void cancel(); + virtual void cancel(const std::vector settings_to_skip = {}); void setControlFalse(const LLSD& user_data); virtual void setHardwareDefaults(); @@ -294,14 +294,12 @@ class LLPanelPreferenceGraphics : public LLPanelPreference public: BOOL postBuild(); void draw(); - void cancel(); + void cancel(const std::vector settings_to_skip = {}); void saveSettings(); void resetDirtyChilds(); void setHardwareDefaults(); void setPresetText(); - static const std::string getPresetsPath(); - protected: bool hasDirtyChilds(); @@ -320,7 +318,7 @@ public: BOOL postBuild(); void apply(); - void cancel(); + void cancel(const std::vector settings_to_skip = {}); void saveSettings(); void resetDirtyChilds(); diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp index a91f0ec060..f83ce868a3 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -93,7 +93,7 @@ void LLFloaterPreferenceGraphicsAdvanced::onClickCloseBtn(bool app_quitting) LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); if (instance) { - instance->cancel(); + instance->cancel({"RenderQualityPerformance"}); } updateMaxComplexity(); } -- cgit v1.2.3 From 1769dc9a62f86a0a1052046cc36e6592895dbc60 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 31 Jan 2024 20:28:45 +0100 Subject: GH-141872 Ability to drag Favorites to the Landmarks panel --- indra/newview/lltooldraganddrop.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index e7f96239fd..055058e4eb 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -47,6 +47,7 @@ #include "llinventorybridge.h" #include "llinventorydefines.h" #include "llinventoryfunctions.h" +#include "llinventorymodelbackgroundfetch.h" #include "llpreviewnotecard.h" #include "llrootview.h" #include "llselectmgr.h" @@ -320,6 +321,16 @@ void LLToolDragAndDrop::beginDrag(EDragAndDropType type, LL_WARNS() << "Attempted to start drag without a cargo type" << LL_ENDL; return; } + + if (type != DAD_CATEGORY) + { + LLViewerInventoryItem* item = gInventory.getItem(cargo_id); + if (item && !item->isFinished()) + { + LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false); + } + } + mCargoTypes.clear(); mCargoTypes.push_back(type); mCargoIDs.clear(); -- cgit v1.2.3 From 7fa86e04d6ce9081e364d67ffd4efd010eb46d81 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 6 Feb 2024 01:21:10 +0200 Subject: SL-19730 Bulk Pick Up Single Items --- indra/newview/llviewermenu.cpp | 67 +++++++++++++++++++++- indra/newview/llviewermenu.h | 2 +- indra/newview/skins/default/xui/en/menu_object.xml | 22 +++++++ 3 files changed, 87 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 9db9d97ddc..be48d1c5e2 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -233,6 +233,7 @@ BOOL enable_take(); void handle_object_show_inspector(); void handle_avatar_show_inspector(); bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle selection_handle); +bool confirm_take_separate(const LLSD ¬ification, const LLSD &response, LLObjectSelectionHandle selection_handle); void handle_buy_object(LLSaleInfo sale_info); void handle_buy_contents(LLSaleInfo sale_info); @@ -4866,6 +4867,24 @@ static void derez_objects(EDeRezDestination dest, const LLUUID& dest_id) derez_objects(dest, dest_id, first_region, error, NULL); } +static void derez_objects_separate(EDeRezDestination dest, const LLUUID &dest_id) +{ + std::vector derez_object_list; + std::string error; + LLViewerRegion* first_region = NULL; + if (!get_derezzable_objects(dest, error, first_region, &derez_object_list, false)) + { + LL_WARNS() << "No objects to derez" << LL_ENDL; + return; + } + for (LLViewerObject *opjectp : derez_object_list) + { + std::vector buf_list; + buf_list.push_back(opjectp); + derez_objects(dest, dest_id, first_region, error, &buf_list); + } +} + void handle_take_copy() { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return; @@ -4874,6 +4893,15 @@ void handle_take_copy() derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); } +void handle_take_separate_copy() +{ + if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) + return; + + const LLUUID category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT); + derez_objects_separate(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); +} + void handle_link_objects() { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) @@ -4967,7 +4995,7 @@ void force_take_copy(void*) derez_objects(DRD_FORCE_TO_GOD_INVENTORY, category_id); } -void handle_take() +void handle_take(bool take_separate) { // we want to use the folder this was derezzed from if it's // available. Otherwise, derez to the normal place. @@ -5056,7 +5084,17 @@ void handle_take() // MAINT-290 // Reason: Showing the confirmation dialog resets object selection, thus there is nothing to derez. // Fix: pass selection to the confirm_take, so that selection doesn't "die" after confirmation dialog is opened - params.functor.function(boost::bind(confirm_take, _1, _2, LLSelectMgr::instance().getSelection())); + params.functor.function([take_separate](const LLSD ¬ification, const LLSD &response) + { + if (take_separate) + { + confirm_take_separate(notification, response, LLSelectMgr::instance().getSelection()); + } + else + { + confirm_take(notification, response, LLSelectMgr::instance().getSelection()); + } + }); if(locked_but_takeable_object || !you_own_everything) @@ -5119,6 +5157,16 @@ bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelect return false; } +bool confirm_take_separate(const LLSD ¬ification, const LLSD &response, LLObjectSelectionHandle selection_handle) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (enable_take() && (option == 0)) + { + derez_objects_separate(DRD_TAKE_INTO_AGENT_INVENTORY, notification["payload"]["folder_id"].asUUID()); + } + return false; +} + // You can take an item when it is public and transferrable, or when // you own it. We err on the side of enabling the item when at least // one item selected can be copied to inventory. @@ -5201,6 +5249,11 @@ bool visible_take_object() return !is_selection_buy_not_take() && enable_take(); } +bool visible_take_objects() +{ + return visible_take_object() && (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 1); +} + bool tools_visible_buy_object() { return is_selection_buy_not_take(); @@ -7968,6 +8021,10 @@ bool enable_object_take_copy() return all_valid; } +bool visible_take_copy_objects() +{ + return enable_object_take_copy() && (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 1); +} class LLHasAsset : public LLInventoryCollectFunctor { @@ -9438,6 +9495,7 @@ void initialize_menus() enable.add("Tools.EnableUnlink", boost::bind(&LLSelectMgr::enableUnlinkObjects, LLSelectMgr::getInstance())); view_listener_t::addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake"); enable.add("Tools.EnableTakeCopy", boost::bind(&enable_object_take_copy)); + enable.add("Tools.VisibleCopySeparate", boost::bind(&visible_take_copy_objects)); enable.add("Tools.VisibleBuyObject", boost::bind(&tools_visible_buy_object)); enable.add("Tools.VisibleTakeObject", boost::bind(&tools_visible_take_object)); view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory"); @@ -9698,6 +9756,7 @@ void initialize_menus() view_listener_t::addMenu(new LLObjectMute(), "Object.Mute"); enable.add("Object.VisibleTake", boost::bind(&visible_take_object)); + enable.add("Object.VisibleTakeMultiple", boost::bind(&visible_take_objects)); enable.add("Object.VisibleBuy", boost::bind(&visible_buy_object)); commit.add("Object.Buy", boost::bind(&handle_buy)); @@ -9706,7 +9765,9 @@ void initialize_menus() commit.add("Object.EditGLTFMaterial", boost::bind(&handle_object_edit_gltf_material)); commit.add("Object.Inspect", boost::bind(&handle_object_inspect)); commit.add("Object.Open", boost::bind(&handle_object_open)); - commit.add("Object.Take", boost::bind(&handle_take)); + commit.add("Object.Take", boost::bind(&handle_take, false)); + commit.add("Object.TakeSeparate", boost::bind(&handle_take, true)); + commit.add("Object.TakeSeparateCopy", boost::bind(&handle_take_separate_copy)); commit.add("Object.ShowInspector", boost::bind(&handle_object_show_inspector)); enable.add("Object.EnableInspect", boost::bind(&enable_object_inspect)); enable.add("Object.EnableEditGLTFMaterial", boost::bind(&enable_object_edit_gltf_material)); diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 7142763451..b1ab7a2688 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -103,7 +103,7 @@ bool enable_object_delete(); // Buy either contents or object itself void handle_buy(); -void handle_take(); +void handle_take(bool take_separate = false); void handle_take_copy(); void handle_look_at_selection(const LLSD& param); void handle_zoom_to_object(LLUUID object_id); diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml index 5507c9f3a1..ab8aaf4688 100644 --- a/indra/newview/skins/default/xui/en/menu_object.xml +++ b/indra/newview/skins/default/xui/en/menu_object.xml @@ -183,6 +183,28 @@ + + + + + + + + + + Date: Fri, 2 Feb 2024 19:53:08 +0100 Subject: GH-68175 [SL-17986] Ability to drag Favorites to the Overflow menu --- indra/newview/llfavoritesbar.cpp | 364 +++++++++++++++++++++++++-------------- indra/newview/llfavoritesbar.h | 39 ++--- 2 files changed, 251 insertions(+), 152 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index cdce6f7156..f926a8a6d5 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -79,7 +79,7 @@ public: } void setLandmarkID(const LLUUID& id) { mLandmarkID = id; } - const LLUUID& getLandmarkId() const { return mLandmarkID; } + const LLUUID& getLandmarkID() const { return mLandmarkID; } const std::string& getName() { @@ -192,7 +192,7 @@ public: } void setLandmarkID(const LLUUID& id){ mLandmarkInfoGetter.setLandmarkID(id); } - const LLUUID& getLandmarkId() const { return mLandmarkInfoGetter.getLandmarkId(); } + const LLUUID& getLandmarkID() const { return mLandmarkInfoGetter.getLandmarkID(); } void onMouseEnter(S32 x, S32 y, MASK mask) { @@ -237,7 +237,8 @@ public: return TRUE; } - void setLandmarkID(const LLUUID& id){ mLandmarkInfoGetter.setLandmarkID(id); } + const LLUUID& getLandmarkID() const { return mLandmarkInfoGetter.getLandmarkID(); } + void setLandmarkID(const LLUUID& id) { mLandmarkInfoGetter.setLandmarkID(id); } virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) { @@ -285,15 +286,44 @@ private: class LLFavoriteLandmarkToggleableMenu : public LLToggleableMenu { public: - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg) - { - *accept = ACCEPT_NO; - return TRUE; - } + // virtual + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, + void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) override + { + mToolbar->handleDragAndDropToMenu(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + return TRUE; + } + + // virtual + BOOL handleHover(S32 x, S32 y, MASK mask) override + { + mIsHovering = true; + LLToggleableMenu::handleHover(x, y, mask); + mIsHovering = false; + return TRUE; + } + + // virtual + void setVisible(BOOL visible) override + { + // Avoid of hiding the menu during hovering + if (visible || !mIsHovering) + { + LLToggleableMenu::setVisible(visible); + } + } + + void setToolbar(LLFavoritesBarCtrl* toolbar) + { + mToolbar = toolbar; + } + + ~LLFavoriteLandmarkToggleableMenu() + { + // Enable subsequent setVisible(FALSE) + mIsHovering = false; + setVisible(FALSE); + } protected: LLFavoriteLandmarkToggleableMenu(const LLToggleableMenu::Params& p): @@ -301,6 +331,10 @@ protected: { } +private: + LLFavoritesBarCtrl* mToolbar { nullptr }; + bool mIsHovering { false }; + friend class LLUICtrlFactory; }; @@ -378,12 +412,12 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) mOverflowMenuHandle(), mContextMenuHandle(), mImageDragIndication(p.image_drag_indication), - mShowDragMarker(FALSE), + mShowDragMarker(false), mLandingTab(NULL), mLastTab(NULL), - mTabsHighlightEnabled(TRUE), mUpdateDropDownItems(true), mRestoreOverflowMenu(false), + mDragToOverflowMenu(false), mGetPrevItems(true), mMouseX(0), mMouseY(0), @@ -416,17 +450,16 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) LLFavoritesBarCtrl::~LLFavoritesBarCtrl() { - gInventory.removeObserver(this); + gInventory.removeObserver(this); - if (mOverflowMenuHandle.get()) mOverflowMenuHandle.get()->die(); - if (mContextMenuHandle.get()) mContextMenuHandle.get()->die(); + if (mOverflowMenuHandle.get()) + mOverflowMenuHandle.get()->die(); + if (mContextMenuHandle.get()) + mContextMenuHandle.get()->die(); } BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg) + EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { *accept = ACCEPT_NO; @@ -452,26 +485,52 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // Copy the item into the favorites folder (if it's not already there). LLInventoryItem *item = (LLInventoryItem *)cargo_data; - if (LLFavoriteLandmarkButton* dest = dynamic_cast(findChildByLocalCoords(x, y))) + if (mDragToOverflowMenu) { - setLandingTab(dest); + LLView* overflow_menu = mOverflowMenuHandle.get(); + if (overflow_menu && !overflow_menu->isDead() && overflow_menu->getVisible()) + { + overflow_menu->handleHover(x, y, mask); + } } - else if (mLastTab && (x >= mLastTab->getRect().mRight)) + else // Drag to the toolbar itself { - /* - * the condition dest == NULL can be satisfied not only in the case - * of dragging to the right from the last tab of the favbar. there is a - * small gap between each tab. if the user drags something exactly there - * then mLandingTab will be set to NULL and the dragged item will be pushed - * to the end of the favorites bar. this is incorrect behavior. that's why - * we need an additional check which excludes the case described previously - * making sure that the mouse pointer is beyond the last tab. - */ - setLandingTab(NULL); + // Drag to a landmark button? + if (LLFavoriteLandmarkButton* dest = dynamic_cast(findChildByLocalCoords(x, y))) + { + setLandingTab(dest); + } + else + { + // Drag to the "More" button? + if (mMoreTextBox && mMoreTextBox->getVisible() && mMoreTextBox->getRect().pointInRect(x, y)) + { + LLView* overflow_menu = mOverflowMenuHandle.get(); + if (!overflow_menu || overflow_menu->isDead() || !overflow_menu->getVisible()) + { + showDropDownMenu(); + } + } + + // Drag to the right of the last landmark button? + if (mLastTab && (x >= mLastTab->getRect().mRight)) + { + /* + * the condition dest == NULL can be satisfied not only in the case + * of dragging to the right from the last tab of the favbar. there is a + * small gap between each tab. if the user drags something exactly there + * then mLandingTab will be set to NULL and the dragged item will be pushed + * to the end of the favorites bar. this is incorrect behavior. that's why + * we need an additional check which excludes the case described previously + * making sure that the mouse pointer is beyond the last tab. + */ + setLandingTab(NULL); + } + } } - // check if we are dragging an existing item from the favorites bar - bool existing_drop = false; + // Check whether we are dragging an existing item from the favorites bar + bool existing_item = false; if (item && mDragItemId == item->getUUID()) { // There is a chance of mDragItemId being obsolete @@ -479,21 +538,19 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // results in viewer not geting a 'mouse up' signal for (LLInventoryModel::item_array_t::iterator i = mItems.begin(); i != mItems.end(); ++i) { - LLViewerInventoryItem* currItem = *i; - - if (currItem->getUUID() == mDragItemId) + if ((*i)->getUUID() == mDragItemId) { - existing_drop = true; + existing_item = true; break; } } } - if (existing_drop) + if (existing_item) { *accept = ACCEPT_YES_SINGLE; - showDragMarker(TRUE); + showDragMarker(true); if (drop) { @@ -511,14 +568,14 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, *accept = ACCEPT_YES_COPY_MULTI; - showDragMarker(TRUE); + showDragMarker(true); if (drop) { if (mItems.empty()) { setLandingTab(NULL); - mLastTab = NULL; + mLastTab = NULL; } handleNewFavoriteDragAndDrop(item, favorites_id, x, y); } @@ -532,82 +589,56 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return TRUE; } +bool LLFavoritesBarCtrl::handleDragAndDropToMenu(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) +{ + mDragToOverflowMenu = true; + BOOL handled = handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + mDragToOverflowMenu = false; + return handled; +} + void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) { - if (mItems.empty()) - { - // Isn't supposed to be empty + if (LL_UNLIKELY(mItems.empty())) return; - } - // Identify the button hovered and the side to drop - LLFavoriteLandmarkButton* dest = dynamic_cast(mLandingTab); - bool insert_before = true; - if (!dest) - { - insert_before = false; - dest = dynamic_cast(mLastTab); - } - - // There is no need to handle if an item was dragged onto itself - if (dest && dest->getLandmarkId() == mDragItemId) - { - return; - } - - // Insert the dragged item in the right place - if (dest) - { - LLInventoryModel::updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId(), insert_before); - } - else - { - // This can happen when the item list is empty - mItems.push_back(gInventory.getItem(mDragItemId)); - } + LLUUID target_id; + bool insert_before = false; + if (!findDragAndDropTarget(target_id, insert_before, x, y)) + return; - LLFavoritesOrderStorage::instance().saveItemsOrder(mItems); + // There is no need to handle if an item was dragged onto itself + if (target_id == mDragItemId) + return; - LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); + // Move the dragged item to the right place in the array + LLInventoryModel::updateItemsOrder(mItems, mDragItemId, target_id, insert_before); + LLFavoritesOrderStorage::instance().saveItemsOrder(mItems); - if (menu && menu->getVisible()) - { - menu->setVisible(FALSE); - showDropDownMenu(); - } + LLView* menu = mOverflowMenuHandle.get(); + if (menu && !menu->isDead() && menu->getVisible()) + { + updateOverflowMenuItems(); + positionAndShowOverflowMenu(); + } } void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y) { // Identify the button hovered and the side to drop - LLFavoriteLandmarkButton* dest = NULL; - bool insert_before = true; - if (!mItems.empty()) - { - // [MAINT-2386] When multiple landmarks are selected and dragged onto an empty favorites bar, - // the viewer would crash when casting mLastTab below, as mLastTab is still null when the - // second landmark is being added. - // To ensure mLastTab is valid, we need to call updateButtons() at the end of this function - dest = dynamic_cast(mLandingTab); - if (!dest) - { - insert_before = false; - dest = dynamic_cast(mLastTab); - } - } - - // There is no need to handle if an item was dragged onto itself - if (dest && dest->getLandmarkId() == mDragItemId) - { - return; - } - + LLUUID target_id; + bool insert_before = false; + // There is no need to handle if an item was dragged onto itself + if (findDragAndDropTarget(target_id, insert_before, x, y) && (target_id == mDragItemId)) + return; + LLPointer viewer_item = new LLViewerInventoryItem(item); - // Insert the dragged item in the right place - if (dest) + // Insert the dragged item to the right place + if (target_id.notNull()) { - insertItem(mItems, dest->getLandmarkId(), viewer_item, insert_before); + insertItem(mItems, target_id, viewer_item, insert_before); } else { @@ -663,10 +694,75 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con // This also ensures that mLastTab will be valid when dropping multiple // landmarks to an empty favorites bar. updateButtons(); - + + LLView* overflow_menu = mOverflowMenuHandle.get(); + if (overflow_menu && !overflow_menu->isDead() && overflow_menu->getVisible()) + { + updateOverflowMenuItems(); + positionAndShowOverflowMenu(); + } + LL_INFOS("FavoritesBar") << "Copied inventory item #" << item->getUUID() << " to favorites." << LL_ENDL; } +bool LLFavoritesBarCtrl::findDragAndDropTarget(LLUUID& target_id, bool& insert_before, S32 x, S32 y) +{ + if (mItems.empty()) + return false; + + if (mDragToOverflowMenu) + { + LLView* overflow_menu = mOverflowMenuHandle.get(); + if (LL_UNLIKELY(!overflow_menu || overflow_menu->isDead() || !overflow_menu->getVisible())) + return false; + + // Identify the menu item hovered and the side to drop + LLFavoriteLandmarkMenuItem* target_item = dynamic_cast(overflow_menu->childFromPoint(x, y)); + if (target_item) + { + insert_before = true; + } + else + { + // Choose the bottom landmark menu item + auto begin = overflow_menu->getChildList()->begin(); + auto end = overflow_menu->getChildList()->end(); + auto check = [](const LLView* child) -> bool + { + return dynamic_cast(child); + }; + // Menu items are placed in the backward order, so the bottom goes first + auto it = std::find_if(begin, end, check); + if (LL_UNLIKELY(it == end)) + return false; + target_item = (LLFavoriteLandmarkMenuItem*)*it; + insert_before = false; + } + target_id = target_item->getLandmarkID(); + } + else + { + // Identify the button hovered and the side to drop + LLFavoriteLandmarkButton* hovered_button = dynamic_cast(mLandingTab); + if (hovered_button) + { + insert_before = true; + } + else + { + // Choose the right landmark button + hovered_button = dynamic_cast(mLastTab); + if (LL_UNLIKELY(!hovered_button)) + return false; + + insert_before = false; + } + target_id = hovered_button->getLandmarkID(); + } + + return true; +} + //virtual void LLFavoritesBarCtrl::changed(U32 mask) { @@ -737,7 +833,7 @@ void LLFavoritesBarCtrl::draw() mImageDragIndication->draw(rect.mRight, rect.getHeight(), w, h); } // Once drawn, mark this false so we won't draw it again (unless we hit the favorite bar again) - mShowDragMarker = FALSE; + mShowDragMarker = false; } if (mItemsChangedTimer.getStarted()) { @@ -833,7 +929,7 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update) if (item) { // an child's order and mItems should be same - if (button->getLandmarkId() != item->getUUID() // sort order has been changed + if (button->getLandmarkID() != item->getUUID() // sort order has been changed || button->getLabelSelected() != item->getName()) // favorite's name has been changed { break; @@ -907,11 +1003,7 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update) { // mMoreTextBox was removed, so LLFavoriteLandmarkButtons // should be the only ones in the list - LLFavoriteLandmarkButton* button = dynamic_cast (childs->back()); - if (button) - { - mLastTab = button; - } + mLastTab = dynamic_cast(childs->back()); } mFirstDropDownItem = j; @@ -919,15 +1011,13 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update) if (mFirstDropDownItem < mItems.size()) { // if updateButton had been called it means: - //or there are some new favorites, or width had been changed + // or there are some new favorites, or width had been changed // so if we need to display chevron button, we must update dropdown items too. mUpdateDropDownItems = true; S32 buttonHGap = button_params.rect.left; // default value - LLRect rect; // Chevron button should stay right aligned - rect.setOriginAndSize(getRect().mRight - mMoreTextBox->getRect().getWidth() - buttonHGap, 0, - mMoreTextBox->getRect().getWidth(), - mMoreTextBox->getRect().getHeight()); + LLRect rect(mMoreTextBox->getRect()); + rect.translate(getRect().mRight - rect.mRight - buttonHGap, 0); addChild(mMoreTextBox); mMoreTextBox->setRect(rect); @@ -1060,14 +1150,16 @@ void LLFavoritesBarCtrl::showDropDownMenu() { if (mUpdateDropDownItems) { - updateMenuItems(menu); + updateOverflowMenuItems(); + } + else + { + menu->buildDrawLabels(); } - menu->buildDrawLabels(); menu->updateParent(LLMenuGL::sMenuContainer); menu->setButtonRect(mMoreTextBox->getRect(), this); - positionAndShowMenu(menu); - mDropDownItemsCount = menu->getItemCount(); + positionAndShowOverflowMenu(); } } @@ -1081,12 +1173,14 @@ void LLFavoritesBarCtrl::createOverflowMenu() menu_p.max_scrollable_items = 10; menu_p.preferred_width = DROP_DOWN_MENU_WIDTH; - LLToggleableMenu* menu = LLUICtrlFactory::create(menu_p); + LLFavoriteLandmarkToggleableMenu* menu = LLUICtrlFactory::create(menu_p); + menu->setToolbar(this); mOverflowMenuHandle = menu->getHandle(); } -void LLFavoritesBarCtrl::updateMenuItems(LLToggleableMenu* menu) +void LLFavoritesBarCtrl::updateOverflowMenuItems() { + LLToggleableMenu* menu = (LLToggleableMenu*)mOverflowMenuHandle.get(); menu->empty(); U32 widest_item = 0; @@ -1115,6 +1209,8 @@ void LLFavoritesBarCtrl::updateMenuItems(LLToggleableMenu* menu) menu->addChild(menu_item); } + menu->buildDrawLabels(); + mDropDownItemsCount = menu->getItemCount(); addOpenLandmarksMenuItem(menu); mUpdateDropDownItems = false; } @@ -1171,8 +1267,9 @@ void LLFavoritesBarCtrl::addOpenLandmarksMenuItem(LLToggleableMenu* menu) menu->addChild(menu_item); } -void LLFavoritesBarCtrl::positionAndShowMenu(LLToggleableMenu* menu) +void LLFavoritesBarCtrl::positionAndShowOverflowMenu() { + LLToggleableMenu* menu = (LLToggleableMenu*)mOverflowMenuHandle.get(); U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); S32 menu_x = getRect().getWidth() - max_width; @@ -1460,7 +1557,7 @@ void LLFavoritesBarCtrl::onButtonMouseDown(LLUUID id, LLUICtrl* ctrl, S32 x, S32 } mDragItemId = id; - mStartDrag = TRUE; + mStartDrag = true; S32 screenX, screenY; localPointToScreen(x, y, &screenX, &screenY); @@ -1470,7 +1567,7 @@ void LLFavoritesBarCtrl::onButtonMouseDown(LLUUID id, LLUICtrl* ctrl, S32 x, S32 void LLFavoritesBarCtrl::onButtonMouseUp(LLUUID id, LLUICtrl* ctrl, S32 x, S32 y, MASK mask) { - mStartDrag = FALSE; + mStartDrag = false; mDragItemId = LLUUID::null; } @@ -1478,7 +1575,7 @@ void LLFavoritesBarCtrl::onEndDrag() { mEndDragConnection.disconnect(); - showDragMarker(FALSE); + showDragMarker(false); mDragItemId = LLUUID::null; LLView::getWindow()->setCursor(UI_CURSOR_ARROW); } @@ -1496,7 +1593,7 @@ BOOL LLFavoritesBarCtrl::handleHover(S32 x, S32 y, MASK mask) DAD_LANDMARK, mDragItemId, LLToolDragAndDrop::SOURCE_LIBRARY); - mStartDrag = FALSE; + mStartDrag = false; return LLToolDragAndDrop::getInstance()->handleHover(x, y, mask); } @@ -1525,6 +1622,7 @@ LLUICtrl* LLFavoritesBarCtrl::findChildByLocalCoords(S32 x, S32 y) } } } + return ctrl; } @@ -2134,8 +2232,10 @@ bool LLFavoritesOrderStorage::isStorageUpdateNeeded() void AddFavoriteLandmarkCallback::fire(const LLUUID& inv_item_id) { - if (mTargetLandmarkId.isNull()) return; - - LLFavoritesOrderStorage::instance().rearrangeFavoriteLandmarks(inv_item_id, mTargetLandmarkId); + if (!mTargetLandmarkId.isNull()) + { + LLFavoritesOrderStorage::instance().rearrangeFavoriteLandmarks(inv_item_id, mTargetLandmarkId); + } } + // EOF diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 3b439b31fd..6b9f2cee69 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -56,22 +56,21 @@ protected: public: virtual ~LLFavoritesBarCtrl(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild() override; /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg); + EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) override; + bool handleDragAndDropToMenu(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; // LLInventoryObserver observer trigger - virtual void changed(U32 mask); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - virtual void draw(); + /*virtual*/ void changed(U32 mask) override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + /*virtual*/ void draw() override; - void showDragMarker(BOOL show) { mShowDragMarker = show; } + void showDragMarker(bool show) { mShowDragMarker = show; } void setLandingTab(LLUICtrl* tab) { mLandingTab = tab; } protected: @@ -108,7 +107,7 @@ protected: S32 mDropDownItemsCount; bool mUpdateDropDownItems; bool mRestoreOverflowMenu; - + bool mDragToOverflowMenu; bool mGetPrevItems; LLUUID mSelectedItemID; @@ -118,19 +117,21 @@ protected: private: /* * Helper function to make code more readable. It handles all drag and drop - * operations of the existing favorites items on the favorites bar. + * operations of the existing favorites items to the favorites bar to on the overflow menu. */ void handleExistingFavoriteDragAndDrop(S32 x, S32 y); /* * Helper function to make code more readable. It handles all drag and drop - * operations of the new landmark to the favorites bar. + * operations of the new landmark to the favorites bar or to the overflow menu. */ void handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y); // finds a control under the specified LOCAL point LLUICtrl* findChildByLocalCoords(S32 x, S32 y); + bool findDragAndDropTarget(LLUUID &target_id, bool &insert_before, S32 x, S32 y); + // checks if the current order of the favorites items must be saved BOOL needToSaveItemsOrder(const LLInventoryModel::item_array_t& items); @@ -145,27 +146,25 @@ private: void createOverflowMenu(); - void updateMenuItems(LLToggleableMenu* menu); + void updateOverflowMenuItems(); // Fits menu item label width with favorites menu width void fitLabelWidth(LLMenuItemCallGL* menu_item); void addOpenLandmarksMenuItem(LLToggleableMenu* menu); - void positionAndShowMenu(LLToggleableMenu* menu); + void positionAndShowOverflowMenu(); - BOOL mShowDragMarker; + bool mShowDragMarker; LLUICtrl* mLandingTab; LLUICtrl* mLastTab; LLTextBox* mMoreTextBox; LLTextBox* mBarLabel; LLUUID mDragItemId; - BOOL mStartDrag; + bool mStartDrag; LLInventoryModel::item_array_t mItems; - BOOL mTabsHighlightEnabled; - S32 mMouseX; S32 mMouseY; -- cgit v1.2.3 From 1925866e1075fa7cee5e554bb2ff452b52359d55 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 6 Feb 2024 23:02:39 +0200 Subject: SL-19730 update menu items --- indra/newview/llviewermenu.cpp | 24 +++++++++++---- indra/newview/skins/default/xui/en/menu_object.xml | 36 +++++++++++++++++++--- 2 files changed, 49 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index be48d1c5e2..ae365de6fc 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5249,9 +5249,19 @@ bool visible_take_object() return !is_selection_buy_not_take() && enable_take(); } -bool visible_take_objects() +bool is_multiple_selection() { - return visible_take_object() && (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 1); + return (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 1); +} + +bool is_single_selection() +{ + return !is_multiple_selection(); +} + +bool enable_take_objects() +{ + return visible_take_object() && is_multiple_selection(); } bool tools_visible_buy_object() @@ -8021,9 +8031,9 @@ bool enable_object_take_copy() return all_valid; } -bool visible_take_copy_objects() +bool enable_take_copy_objects() { - return enable_object_take_copy() && (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 1); + return enable_object_take_copy() && is_multiple_selection(); } class LLHasAsset : public LLInventoryCollectFunctor @@ -9495,7 +9505,7 @@ void initialize_menus() enable.add("Tools.EnableUnlink", boost::bind(&LLSelectMgr::enableUnlinkObjects, LLSelectMgr::getInstance())); view_listener_t::addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake"); enable.add("Tools.EnableTakeCopy", boost::bind(&enable_object_take_copy)); - enable.add("Tools.VisibleCopySeparate", boost::bind(&visible_take_copy_objects)); + enable.add("Tools.EnableCopySeparate", boost::bind(&enable_take_copy_objects)); enable.add("Tools.VisibleBuyObject", boost::bind(&tools_visible_buy_object)); enable.add("Tools.VisibleTakeObject", boost::bind(&tools_visible_take_object)); view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory"); @@ -9756,7 +9766,9 @@ void initialize_menus() view_listener_t::addMenu(new LLObjectMute(), "Object.Mute"); enable.add("Object.VisibleTake", boost::bind(&visible_take_object)); - enable.add("Object.VisibleTakeMultiple", boost::bind(&visible_take_objects)); + enable.add("Object.VisibleTakeMultiple", boost::bind(&is_multiple_selection)); + enable.add("Object.VisibleTakeSingle", boost::bind(&is_single_selection)); + enable.add("Object.EnableTakeMultiple", boost::bind(&enable_take_objects)); enable.add("Object.VisibleBuy", boost::bind(&visible_buy_object)); commit.add("Object.Buy", boost::bind(&handle_buy)); diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml index ab8aaf4688..d652b721a4 100644 --- a/indra/newview/skins/default/xui/en/menu_object.xml +++ b/indra/newview/skins/default/xui/en/menu_object.xml @@ -173,6 +173,8 @@ function="Object.Take"/> + + + + + + + + + + + + + function="Object.EnableTakeMultiple"/> + function="Tools.EnableCopySeparate"/> + function="Object.VisibleTakeMultiple"/> Date: Mon, 29 Jan 2024 19:42:19 +0100 Subject: Fix for a potential crash in LLReflectionMapManager::registerSpatialGroup() The spatial partion could potentially be NULL and shall therefore been tested for this case. Similar fix to https://github.com/secondlife/viewer/commit/08cf926d3b6eb28e0b9751ba62b1ce01230a150b --- indra/newview/llreflectionmapmanager.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 69674417c1..aa905bf2f8 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -463,17 +463,22 @@ void LLReflectionMapManager::getReflectionMaps(std::vector& ma LLReflectionMap* LLReflectionMapManager::registerSpatialGroup(LLSpatialGroup* group) { - if (group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_VOLUME) + if (!group) { - OctreeNode* node = group->getOctreeNode(); - F32 size = node->getSize().getF32ptr()[0]; - if (size >= 15.f && size <= 17.f) - { - return addProbe(group); - } + return nullptr; } - - return nullptr; + LLSpatialPartition* part = group->getSpatialPartition(); + if (!part || part->mPartitionType != LLViewerRegion::PARTITION_VOLUME) + { + return nullptr; + } + OctreeNode* node = group->getOctreeNode(); + F32 size = node->getSize().getF32ptr()[0]; + if (size < 15.f || size > 17.f) + { + return nullptr; + } + return addProbe(group); } LLReflectionMap* LLReflectionMapManager::registerViewerObject(LLViewerObject* vobj) -- cgit v1.2.3 From 78dc1c872aa966de010ca94c4d7a651259679502 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 6 Feb 2024 17:28:35 +0200 Subject: Enable OpenAL Soft on MacOS --- indra/newview/viewer_manifest.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1fa4df1682..07c659df0c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1031,6 +1031,14 @@ class Darwin_x86_64_Manifest(ViewerManifest): "libfmod.dylib", ): dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + + # OpenAL dylibs + if self.args['openal'] == 'ON': + for libfile in ( + "libopenal.dylib", + "libalut.dylib", + ): + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) # our apps executable_path = {} -- cgit v1.2.3 From 4cec3133197cd39efd607b82169a85f56c77aa68 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 6 Feb 2024 01:26:53 +0200 Subject: SL-19585 Switch OpenAL's wind to float Fixes wind being odly distorted --- indra/newview/llvieweraudio.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 6a0edbecb1..949cafb3d3 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -545,8 +545,13 @@ void audio_update_wind(bool force_update) // don't use the setter setMaxWindGain() because we don't // want to screw up the fade-in on startup by setting actual source gain // outside the fade-in. - F32 master_volume = gSavedSettings.getBOOL("MuteAudio") ? 0.f : gSavedSettings.getF32("AudioLevelMaster"); - F32 ambient_volume = gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient"); + static LLCachedControl mute_audio(gSavedSettings, "MuteAudio"); + static LLCachedControl mute_ambient(gSavedSettings, "MuteAmbient"); + static LLCachedControl level_master(gSavedSettings, "AudioLevelMaster"); + static LLCachedControl level_ambient(gSavedSettings, "AudioLevelAmbient"); + + F32 master_volume = mute_audio() ? 0.f : level_master(); + F32 ambient_volume = mute_ambient() ? 0.f : level_ambient(); F32 max_wind_volume = master_volume * ambient_volume; const F32 WIND_SOUND_TRANSITION_TIME = 2.f; -- cgit v1.2.3 From 762855f2554393dd3bcacd9b5d205765409f6a95 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 1 Feb 2024 23:00:53 +0200 Subject: SL-19585 Try replacing fmod with openal Since now VLC is responsible for played parcel media (should be since SL-19042) should be possible to switch remaining audio to OpenAL with no loss of functionality --- indra/newview/CMakeLists.txt | 14 -------------- indra/newview/app_settings/cmd_line.xml | 6 ------ indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llprogressview.cpp | 15 --------------- indra/newview/llstartup.cpp | 28 ++-------------------------- indra/newview/viewer_manifest.py | 31 ------------------------------- 6 files changed, 2 insertions(+), 103 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7a70d0b6e6..4fac765f80 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -16,7 +16,6 @@ include(CubemapToEquirectangularJS) include(DBusGlib) include(DragDrop) include(EXPAT) -include(FMODSTUDIO) include(Hunspell) include(JPEGEncoderBasic) include(JsonCpp) @@ -1753,13 +1752,6 @@ if (WINDOWS) ) endif (ADDRESS_SIZE EQUAL 64) - if (TARGET ll::fmodstudio) - list(APPEND COPY_INPUT_DEPENDENCIES - ${SHARED_LIB_STAGING_DIR}/fmod.dll - ${SHARED_LIB_STAGING_DIR}/fmodL.dll - ) - endif () - if (TARGET ll::openal) list(APPEND COPY_INPUT_DEPENDENCIES ${SHARED_LIB_STAGING_DIR}/OpenAL32.dll @@ -1776,7 +1768,6 @@ if (WINDOWS) --arch=${ARCH} --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" - "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ @@ -1836,7 +1827,6 @@ if (WINDOWS) --arch=${ARCH} --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" - "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ @@ -1963,7 +1953,6 @@ if (LINUX) --arch=${ARCH} --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" - "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} @@ -1991,7 +1980,6 @@ if (LINUX) --arch=${ARCH} --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" - "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} @@ -2069,7 +2057,6 @@ if (DARWIN) --arch=${ARCH} --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" - "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ @@ -2104,7 +2091,6 @@ if (DARWIN) --arch=${ARCH} --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" - "--fmodstudio=${USE_FMODSTUDIO}" "--openal=${USE_OPENAL}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 340334aee8..e16a5c7e76 100644 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -209,12 +209,6 @@ NoAudio - nofmod - - map-to - UseMediaPluginsForStreamingAudio - - noninteractive desc diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8f651a0294..4fd422e59a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7099,17 +7099,6 @@ Value 0 - UseMediaPluginsForStreamingAudio - - Comment - Use media plugins (VLC) for streaming audio. - Persist - 1 - Type - Boolean - Value - 0 - NoHardwareProbe Comment diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 416848f9af..6eb55c8b6a 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -399,21 +399,6 @@ void LLProgressView::initLogos() temp_str += gDirUtilp->getDirDelimiter(); -#ifdef LL_FMODSTUDIO - // original image size is 264x96, it is on longer side but - // with no internal paddings so it gets additional padding - icon_width = 77; - icon_height = 21; - S32 pad_fmod_y = 4; - texture_start_x++; - loadLogo(temp_str + "fmod_logo.png", - image_codec, - LLRect(texture_start_x, texture_start_y + pad_fmod_y + icon_height, texture_start_x + icon_width, texture_start_y + pad_fmod_y), - default_clip, - default_clip); - - texture_start_x += icon_width + default_pad + 1; -#endif //LL_FMODSTUDIO #ifdef LL_HAVOK // original image size is 342x113, central element is on a larger side // plus internal padding, so it gets slightly more height than desired 32 diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d0b76848f7..7abf9f8bc2 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -40,10 +40,6 @@ #include "llviewermedia_streamingaudio.h" #include "llaudioengine.h" -#ifdef LL_FMODSTUDIO -# include "llaudioengine_fmodstudio.h" -#endif - #ifdef LL_OPENAL #include "llaudioengine_openal.h" #endif @@ -649,15 +645,6 @@ bool idle_startup() delete gAudiop; gAudiop = NULL; -#ifdef LL_FMODSTUDIO -#if !LL_WINDOWS - if (NULL == getenv("LL_BAD_FMODSTUDIO_DRIVER")) -#endif // !LL_WINDOWS - { - gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODSTUDIO(gSavedSettings.getBOOL("FMODExProfilerEnable")); - } -#endif - #ifdef LL_OPENAL #if !LL_WINDOWS if (NULL == getenv("LL_BAD_OPENAL_DRIVER")) @@ -678,19 +665,8 @@ bool idle_startup() #endif if (gAudiop->init(window_handle, LLAppViewer::instance()->getSecondLifeTitle())) { - if (FALSE == gSavedSettings.getBOOL("UseMediaPluginsForStreamingAudio")) - { - LL_INFOS("AppInit") << "Using default impl to render streaming audio" << LL_ENDL; - gAudiop->setStreamingAudioImpl(gAudiop->createDefaultStreamingAudioImpl()); - } - - // if the audio engine hasn't set up its own preferred handler for streaming audio - // then set up the generic streaming audio implementation which uses media plugins - if (NULL == gAudiop->getStreamingAudioImpl()) - { - LL_INFOS("AppInit") << "Using media plugins to render streaming audio" << LL_ENDL; - gAudiop->setStreamingAudioImpl(new LLStreamingAudio_MediaPlugins()); - } + LL_INFOS("AppInit") << "Using media plugins to render streaming audio" << LL_ENDL; + gAudiop->setStreamingAudioImpl(new LLStreamingAudio_MediaPlugins()); gAudiop->setMuted(TRUE); } diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 07c659df0c..2d7e39e8cc 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -547,12 +547,6 @@ class Windows_x86_64_Manifest(ViewerManifest): # Get shared libs from the shared libs staging directory with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'sharedlibs', self.args['buildtype'])): - # Get fmodstudio dll if needed - if self.args['fmodstudio'] == 'ON': - if(self.args['buildtype'].lower() == 'debug'): - self.path("fmodL.dll") - else: - self.path("fmod.dll") if self.args['openal'] == 'ON': # Get openal dll @@ -1018,19 +1012,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): 'libvivoxsdk.dylib', ): self.path2basename(relpkgdir, libfile) - - # Fmod studio dylibs (vary based on configuration) - if self.args['fmodstudio'] == 'ON': - if self.args['buildtype'].lower() == 'debug': - for libfile in ( - "libfmodL.dylib", - ): - dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) - else: - for libfile in ( - "libfmod.dylib", - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) # OpenAL dylibs if self.args['openal'] == 'ON': @@ -1368,16 +1349,6 @@ class Linux_i686_Manifest(LinuxManifest): print("tcmalloc files not found, skipping") pass - if self.args['fmodstudio'] == 'ON': - try: - self.path("libfmod.so.11.7") - self.path("libfmod.so.11") - self.path("libfmod.so") - pass - except: - print("Skipping libfmod.so - not found") - pass - # Vivox runtimes with self.prefix(src=relpkgdir, dst="bin"): self.path("SLVoice") @@ -1407,11 +1378,9 @@ if __name__ == "__main__": print(('%s \\\n%s' % (sys.executable, ' '.join((("'%s'" % arg) if ' ' in arg else arg) for arg in sys.argv)))) - # fmodstudio and openal can be used simultaneously and controled by environment extra_arguments = [ dict(name='bugsplat', description="""BugSplat database to which to post crashes, if BugSplat crash reporting is desired""", default=''), - dict(name='fmodstudio', description="""Indication if fmod studio libraries are needed""", default='OFF'), dict(name='openal', description="""Indication openal libraries are needed""", default='OFF'), ] try: -- cgit v1.2.3 From c8ee05a2712e56a7cdcb2b9e25c8b092c088d4d4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 9 Feb 2024 01:31:05 +0200 Subject: Triage Issue #49 Better inspection of media urls Part 1: Ability to copy urls from nearby media for inspection --- indra/newview/llconversationloglist.cpp | 12 ++-- indra/newview/llpanelnearbymedia.cpp | 84 +++++++++++++++++++--- indra/newview/llpanelnearbymedia.h | 16 +++-- indra/newview/llpanelpeople.cpp | 19 ----- indra/newview/llpanelpeople.h | 1 - .../skins/default/xui/en/menu_nearby_media.xml | 15 ++++ 6 files changed, 106 insertions(+), 41 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/menu_nearby_media.xml (limited to 'indra/newview') diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index 97b16a5e93..e6ebfc2f1b 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -91,12 +91,12 @@ BOOL LLConversationLogList::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); LLToggleableMenu* context_menu = mContextMenu.get(); - { - context_menu->buildDrawLabels(); - if (context_menu && size()) - context_menu->updateParent(LLMenuGL::sMenuContainer); - LLMenuGL::showPopup(this, context_menu, x, y); - } + if (context_menu && size()) + { + context_menu->buildDrawLabels(); + context_menu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, context_menu, x, y); + } return handled; } diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 3c3cd5d522..c911f102a1 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -30,6 +30,7 @@ #include "llaudioengine.h" #include "llcheckboxctrl.h" +#include "llclipboard.h" #include "llcombobox.h" #include "llresizebar.h" #include "llresizehandle.h" @@ -53,7 +54,9 @@ #include "llvovolume.h" #include "llstatusbar.h" #include "llsdutil.h" +#include "lltoggleablemenu.h" #include "llvieweraudio.h" +#include "llviewermenu.h" #include "llfloaterreg.h" #include "llfloaterpreference.h" // for the gear icon @@ -77,7 +80,8 @@ LLPanelNearByMedia::LLPanelNearByMedia() mAllMediaDisabled(false), mDebugInfoVisible(false), mParcelMediaItem(NULL), - mParcelAudioItem(NULL) + mParcelAudioItem(NULL), + mMoreLessBtn(NULL) { // This is just an initial value, mParcelAudioAutoStart does not affect ParcelMediaAutoPlayEnable mParcelAudioAutoStart = gSavedSettings.getS32("ParcelMediaAutoPlayEnable") != 0 @@ -96,7 +100,14 @@ LLPanelNearByMedia::LLPanelNearByMedia() mCommitCallbackRegistrar.add("SelectedMediaCtrl.Volume", boost::bind(&LLPanelNearByMedia::onCommitSelectedMediaVolume, this)); mCommitCallbackRegistrar.add("SelectedMediaCtrl.Zoom", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaZoom, this)); mCommitCallbackRegistrar.add("SelectedMediaCtrl.Unzoom", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaUnzoom, this)); - + + // Context menu handler. + mCommitCallbackRegistrar.add("SelectedMediaCtrl.Action", + [this](LLUICtrl* ctrl, const LLSD& data) + { + onMenuAction(data); + }); + buildFromFile( "panel_nearby_media.xml"); } @@ -147,7 +158,8 @@ BOOL LLPanelNearByMedia::postBuild() mUnzoomCtrl = getChild("unzoom"); mVolumeSlider = getChild("volume_slider"); mMuteBtn = getChild("mute_btn"); - + mMoreLessBtn = getChild("more_btn"); + mEmptyNameString = getString("empty_item_text"); mParcelMediaName = getString("parcel_media_name"); mParcelAudioName = getString("parcel_audio_name"); @@ -166,8 +178,13 @@ BOOL LLPanelNearByMedia::postBuild() mLessRect = getRect(); mLessRect.mBottom = minimized_controls->getRect().mBottom; - getChild("more_btn")->setVisible(false); + mMoreLessBtn->setVisible(false); onMoreLess(); + + mContextMenu = LLUICtrlFactory::getInstance()->createFromFile( + "menu_nearby_media.xml", + gMenuHolder, + LLViewerMenuHolderGL::child_registry_t::instance()); return TRUE; } @@ -193,8 +210,7 @@ void LLPanelNearByMedia::reshape(S32 width, S32 height, BOOL called_from_parent) { LLPanelPulldown::reshape(width, height, called_from_parent); - LLButton* more_btn = findChild("more_btn"); - if (more_btn && more_btn->getValue().asBoolean()) + if (mMoreLessBtn && mMoreLessBtn->getValue().asBoolean()) { mMoreRect = getRect(); } @@ -234,6 +250,26 @@ BOOL LLPanelNearByMedia::handleHover(S32 x, S32 y, MASK mask) return true; } +BOOL LLPanelNearByMedia::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + S32 x_list, y_list; + localPointToOtherView(x, y, &x_list, &y_list, mMediaList); + if (mMoreLessBtn->getToggleState() + && mMediaList->pointInView(x_list, y_list) + && mMediaList->selectItemAt(x_list, y_list, mask)) + { + if (mContextMenu) + { + mContextMenu->buildDrawLabels(); + mContextMenu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, mContextMenu, x, y); + return TRUE; + } + } + + return LLPanelPulldown::handleRightMouseDown(x, y, mask); +} + bool LLPanelNearByMedia::getParcelAudioAutoStart() { return mParcelAudioAutoStart; @@ -923,7 +959,7 @@ void LLPanelNearByMedia::onAdvancedButtonClick() void LLPanelNearByMedia::onMoreLess() { - bool is_more = getChild("more_btn")->getToggleState(); + bool is_more = mMoreLessBtn->getToggleState(); mNearbyMediaPanel->setVisible(is_more); // enable resizing when expanded @@ -934,7 +970,7 @@ void LLPanelNearByMedia::onMoreLess() setShape(new_rect); - getChild("more_btn")->setVisible(true); + mMoreLessBtn->setVisible(true); } void LLPanelNearByMedia::updateControls() @@ -1174,6 +1210,38 @@ void LLPanelNearByMedia::onClickSelectedMediaUnzoom() LLViewerMediaFocus::getInstance()->unZoom(); } +void LLPanelNearByMedia::onMenuAction(const LLSD& userdata) +{ + const std::string command_name = userdata.asString(); + if ("copy" == command_name) + { + LLClipboard::instance().reset(); + LLUUID selected_media_id = mMediaList->getValue().asUUID(); + std::string url; + + if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID) + { + url = LLViewerMedia::getInstance()->getParcelAudioURL(); + } + else if (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) + { + url = LLViewerParcelMedia::getInstance()->getURL(); + } + else + { + LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); + if (NULL != impl) + { + url = impl->getCurrentMediaURL(); + } + } + + if (!url.empty()) + { + LLClipboard::instance().copyToClipboard(utf8str_to_wstring(url), 0, url.size()); + } + } +} // static void LLPanelNearByMedia::getNameAndUrlHelper(LLViewerMediaImpl* impl, std::string& name, std::string & url, const std::string &defaultName) diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h index 2d898d0aa1..7239a80043 100644 --- a/indra/newview/llpanelnearbymedia.h +++ b/indra/newview/llpanelnearbymedia.h @@ -36,6 +36,7 @@ class LLSlider; class LLSliderCtrl; class LLCheckBoxCtrl; class LLTextBox; +class LLToggleableMenu; class LLComboBox; class LLViewerMediaImpl; @@ -43,10 +44,11 @@ class LLPanelNearByMedia : public LLPanelPulldown { public: - /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); + BOOL postBuild() override; + void draw() override; + void reshape(S32 width, S32 height, BOOL called_from_parent) override; + BOOL handleHover(S32 x, S32 y, MASK mask) override; + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; // this is part of the nearby media *dialog* so we can track whether // the user *implicitly* wants audio on or off via their *explicit* @@ -104,15 +106,12 @@ private: void onClickDisableAll(); void onClickEnableParcelMedia(); void onClickDisableParcelMedia(); - void onClickMuteParcelMedia(); - void onParcelMediaVolumeSlider(); void onClickParcelMediaPlay(); void onClickParcelMediaStop(); void onClickParcelMediaPause(); void onClickParcelAudioPlay(); void onClickParcelAudioStop(); void onClickParcelAudioPause(); - void onCheckAutoPlay(); void onAdvancedButtonClick(); void onMoreLess(); @@ -141,6 +140,7 @@ private: void onCommitSelectedMediaVolume(); void onClickSelectedMediaZoom(); void onClickSelectedMediaUnzoom(); + void onMenuAction(const LLSD& userdata); LLUICtrl* mNearbyMediaPanel; LLScrollListCtrl* mMediaList; @@ -158,6 +158,7 @@ private: LLUICtrl* mUnzoomCtrl; LLSlider* mVolumeSlider; LLButton* mMuteBtn; + LLButton* mMoreLessBtn; bool mAllMediaDisabled; bool mDebugInfoVisible; @@ -171,6 +172,7 @@ private: LLRect mLessRect; LLScrollListItem* mParcelMediaItem; LLScrollListItem* mParcelAudioItem; + LLToggleableMenu* mContextMenu; }; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 13b52e97c5..b3224c2c1f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -961,25 +961,6 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const } -void LLPanelPeople::showGroupMenu(LLMenuGL* menu) -{ - // Shows the menu at the top of the button bar. - - // Calculate its coordinates. - // (assumes that groups panel is the current tab) - LLPanel* bottom_panel = mTabContainer->getCurrentPanel()->getChild("bottom_panel"); - LLPanel* parent_panel = mTabContainer->getCurrentPanel(); - menu->arrangeAndClear(); - S32 menu_height = menu->getRect().getHeight(); - S32 menu_x = -2; // *HACK: compensates HPAD in showPopup() - S32 menu_y = bottom_panel->getRect().mTop + menu_height; - - // Actually show the menu. - menu->buildDrawLabels(); - menu->updateParent(LLMenuGL::sMenuContainer); - LLMenuGL::showPopup(parent_panel, menu, menu_x, menu_y); -} - void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save) { switch (order) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 14205cebe2..25abebc576 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -87,7 +87,6 @@ private: std::string getActiveTabName() const; LLUUID getCurrentItemID() const; void getCurrentItemIDs(uuid_vec_t& selected_uuids) const; - void showGroupMenu(LLMenuGL* menu); void setSortOrder(LLAvatarList* list, ESortOrder order, bool save = true); // UI callbacks diff --git a/indra/newview/skins/default/xui/en/menu_nearby_media.xml b/indra/newview/skins/default/xui/en/menu_nearby_media.xml new file mode 100644 index 0000000000..11a5dfa5fa --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_nearby_media.xml @@ -0,0 +1,15 @@ + + + + + + -- cgit v1.2.3 From b8952923ac2564f85b83da6893f89a6a45c952fd Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 9 Feb 2024 23:06:55 +0200 Subject: Triage Issue #49 Better inspection of data urls in media --- indra/newview/llpanelnearbymedia.cpp | 83 ++++++++++++++++++---- indra/newview/llpanelnearbymedia.h | 3 + .../skins/default/xui/en/menu_nearby_media.xml | 14 +++- 3 files changed, 84 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index c911f102a1..83f0fca1be 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -29,6 +29,7 @@ #include "llpanelnearbymedia.h" #include "llaudioengine.h" +#include "llbase64.h" #include "llcheckboxctrl.h" #include "llclipboard.h" #include "llcombobox.h" @@ -107,6 +108,11 @@ LLPanelNearByMedia::LLPanelNearByMedia() { onMenuAction(data); }); + mEnableCallbackRegistrar.add("SelectedMediaCtrl.Visible", + [this](LLUICtrl* ctrl, const LLSD& data) + { + return onMenuVisible(data); + }); buildFromFile( "panel_nearby_media.xml"); } @@ -270,6 +276,16 @@ BOOL LLPanelNearByMedia::handleRightMouseDown(S32 x, S32 y, MASK mask) return LLPanelPulldown::handleRightMouseDown(x, y, mask); } + +void LLPanelNearByMedia::onVisibilityChange(BOOL new_visibility) +{ + if (!new_visibility && mContextMenu->getVisible()) + { + gMenuHolder->hideMenus(); + } + LLPanelPulldown::onVisibilityChange(new_visibility); +} + bool LLPanelNearByMedia::getParcelAudioAutoStart() { return mParcelAudioAutoStart; @@ -1213,34 +1229,49 @@ void LLPanelNearByMedia::onClickSelectedMediaUnzoom() void LLPanelNearByMedia::onMenuAction(const LLSD& userdata) { const std::string command_name = userdata.asString(); - if ("copy" == command_name) + if ("copy_url" == command_name) { LLClipboard::instance().reset(); - LLUUID selected_media_id = mMediaList->getValue().asUUID(); - std::string url; + std::string url = getSelectedUrl(); - if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID) + if (!url.empty()) { - url = LLViewerMedia::getInstance()->getParcelAudioURL(); + LLClipboard::instance().copyToClipboard(utf8str_to_wstring(url), 0, url.size()); } - else if (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) + } + else if ("copy_data" == command_name) + { + LLClipboard::instance().reset(); + std::string url = getSelectedUrl(); + static const std::string encoding_specifier = "base64,"; + size_t pos = url.find(encoding_specifier); + if (pos != std::string::npos) { - url = LLViewerParcelMedia::getInstance()->getURL(); + pos += encoding_specifier.size(); + std::string res = LLBase64::decodeAsString(url.substr(pos)); + LLClipboard::instance().copyToClipboard(utf8str_to_wstring(res), 0, res.size()); } else { - LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); - if (NULL != impl) - { - url = impl->getCurrentMediaURL(); - } + url = LLURI::unescape(url); + LLClipboard::instance().copyToClipboard(utf8str_to_wstring(url), 0, url.size()); } + } +} - if (!url.empty()) +bool LLPanelNearByMedia::onMenuVisible(const LLSD& userdata) +{ + const std::string command_name = userdata.asString(); + if ("copy_data" == command_name) + { + std::string url = getSelectedUrl(); + if (url.rfind("data:", 0) == 0) { - LLClipboard::instance().copyToClipboard(utf8str_to_wstring(url), 0, url.size()); + // might be a a good idea to permit text/html only + return true; } } + return false; } // static @@ -1268,3 +1299,27 @@ void LLPanelNearByMedia::getNameAndUrlHelper(LLViewerMediaImpl* impl, std::strin } } +std::string LLPanelNearByMedia::getSelectedUrl() +{ + std::string url; + LLUUID selected_media_id = mMediaList->getValue().asUUID(); + if (selected_media_id == PARCEL_AUDIO_LIST_ITEM_UUID) + { + url = LLViewerMedia::getInstance()->getParcelAudioURL(); + } + else if (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) + { + url = LLViewerParcelMedia::getInstance()->getURL(); + } + else + { + LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(selected_media_id); + if (NULL != impl) + { + std::string name; + getNameAndUrlHelper(impl, name, url, mEmptyNameString); + } + } + return url; +} + diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h index 7239a80043..5e04ad4d86 100644 --- a/indra/newview/llpanelnearbymedia.h +++ b/indra/newview/llpanelnearbymedia.h @@ -49,6 +49,7 @@ public: void reshape(S32 width, S32 height, BOOL called_from_parent) override; BOOL handleHover(S32 x, S32 y, MASK mask) override; BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + void onVisibilityChange(BOOL new_visibility) override; // this is part of the nearby media *dialog* so we can track whether // the user *implicitly* wants audio on or off via their *explicit* @@ -123,6 +124,7 @@ private: bool setDisabled(const LLUUID &id, bool disabled); static void getNameAndUrlHelper(LLViewerMediaImpl* impl, std::string& name, std::string & url, const std::string &defaultName); + std::string getSelectedUrl(); void updateColumns(); @@ -141,6 +143,7 @@ private: void onClickSelectedMediaZoom(); void onClickSelectedMediaUnzoom(); void onMenuAction(const LLSD& userdata); + bool onMenuVisible(const LLSD& userdata); LLUICtrl* mNearbyMediaPanel; LLScrollListCtrl* mMediaList; diff --git a/indra/newview/skins/default/xui/en/menu_nearby_media.xml b/indra/newview/skins/default/xui/en/menu_nearby_media.xml index 11a5dfa5fa..7c91241a19 100644 --- a/indra/newview/skins/default/xui/en/menu_nearby_media.xml +++ b/indra/newview/skins/default/xui/en/menu_nearby_media.xml @@ -7,9 +7,19 @@ mouse_opaque="false"> + name="copy_url"> + parameter="copy_url" /> + + + + -- cgit v1.2.3 From 165f7bf35047e9106a7ccb2530fd2bfdf8e6259c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 10 Feb 2024 00:02:29 +0200 Subject: Triage Issue #49 Fix MacOS build failure --- indra/newview/llpanelnearbymedia.cpp | 1 - indra/newview/llpanelnearbymedia.h | 1 - 2 files changed, 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 83f0fca1be..eaf339a295 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -78,7 +78,6 @@ static const LLUUID PARCEL_AUDIO_LIST_ITEM_UUID = LLUUID("DF4B020D-8A24-4B95-AB5 LLPanelNearByMedia::LLPanelNearByMedia() : mMediaList(NULL), mEnableAllCtrl(NULL), - mAllMediaDisabled(false), mDebugInfoVisible(false), mParcelMediaItem(NULL), mParcelAudioItem(NULL), diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h index 5e04ad4d86..603349792e 100644 --- a/indra/newview/llpanelnearbymedia.h +++ b/indra/newview/llpanelnearbymedia.h @@ -163,7 +163,6 @@ private: LLButton* mMuteBtn; LLButton* mMoreLessBtn; - bool mAllMediaDisabled; bool mDebugInfoVisible; bool mParcelAudioAutoStart; std::string mEmptyNameString; -- cgit v1.2.3 From 7bd33add51f0d7339b8198447ec043fd92ced6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pantera=20P=C3=B3=C5=82nocy?= Date: Sun, 11 Feb 2024 18:09:06 +0100 Subject: Fixing the 'lightning' -> 'lighting' typo Unless, of course, we have some dedicated lightning effects - then I will stand corrected. ~ --- indra/newview/skins/default/xui/en/floater_adjust_environment.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml index 91a1dffcb5..889eeb5369 100644 --- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml +++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml @@ -12,7 +12,7 @@ can_resize="false"> HDR Scale: Brightness: - Intensity of lightning effects such as realistically bright skies and dynamic exposure. 1.0 is the default, 0 is off, values between 0 and 1 are mixing Ambient with HDR. + Intensity of lighting effects such as realistically bright skies and dynamic exposure. 1.0 is the default, 0 is off, values between 0 and 1 are mixing Ambient with HDR. Date: Sun, 11 Feb 2024 18:11:49 +0100 Subject: Fixing 'tooltip' typo in attribute name --- indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml index da82c95c83..46e0fb8a74 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml @@ -318,7 +318,7 @@ layout="topleft" left_delta="-5" top_delta="25" - tooltip="Irradiance control. When not zero, enables HDR lighting model." + tool_tip="Irradiance control. When not zero, enables HDR lighting model." width="200"> Reflection Probe Ambiance (HDR): -- cgit v1.2.3 From 5e4afb76af172af73620a3587271ac7474668ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Fri, 9 Feb 2024 20:09:55 +0100 Subject: llinventory: BOOL (int) to real bool --- indra/newview/llviewerinventory.cpp | 6 +++--- indra/newview/llviewerinventory.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 0a0a19d095..3b50dc354f 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -540,10 +540,10 @@ void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const } // virtual -BOOL LLViewerInventoryItem::importLegacyStream(std::istream& input_stream) +bool LLViewerInventoryItem::importLegacyStream(std::istream& input_stream) { - BOOL rv = LLInventoryItem::importLegacyStream(input_stream); - mIsComplete = TRUE; + bool rv = LLInventoryItem::importLegacyStream(input_stream); + mIsComplete = true; return rv; } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index e043285ffb..7541a0f23c 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -132,7 +132,7 @@ public: virtual void packMessage(LLMessageSystem* msg) const; virtual BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); virtual BOOL unpackMessage(const LLSD& item); - virtual BOOL importLegacyStream(std::istream& input_stream); + virtual bool importLegacyStream(std::istream& input_stream); // new methods bool isFinished() const { return mIsComplete; } -- cgit v1.2.3 From 2b31dad40026d8078ea30d0da0656a4078d0f5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Fri, 9 Feb 2024 22:26:02 +0100 Subject: miscellaneous: BOOL (int) to real bool --- indra/newview/llagent.cpp | 44 +++++++++++------------ indra/newview/llagent.h | 4 +-- indra/newview/llagentwearables.cpp | 4 +-- indra/newview/llaisapi.cpp | 2 +- indra/newview/llappearancemgr.cpp | 10 +++--- indra/newview/llconversationmodel.h | 2 +- indra/newview/llfavoritesbar.cpp | 14 ++++---- indra/newview/llfloatercreatelandmark.cpp | 2 +- indra/newview/llfloatergesture.cpp | 4 +-- indra/newview/llfloatermyenvironment.cpp | 2 +- indra/newview/llinventorybridge.cpp | 30 ++++++++-------- indra/newview/llinventorybridge.h | 12 +++---- indra/newview/llinventoryfunctions.cpp | 2 +- indra/newview/llinventorymodel.cpp | 10 +++--- indra/newview/llinventorymodelbackgroundfetch.cpp | 2 +- indra/newview/llpanellandmarkinfo.cpp | 2 +- indra/newview/llpanelobjectinventory.cpp | 20 +++++------ indra/newview/llpanelpermissions.cpp | 4 +-- indra/newview/llpanelplaces.cpp | 2 +- indra/newview/llpreview.cpp | 4 +-- indra/newview/llpreviewgesture.cpp | 2 +- indra/newview/llpreviewnotecard.cpp | 2 +- indra/newview/llselectmgr.cpp | 4 +-- indra/newview/llsettingsvo.cpp | 4 +-- indra/newview/llsidepaneliteminfo.cpp | 4 +-- indra/newview/llviewerinventory.cpp | 32 ++++++++--------- indra/newview/llviewerinventory.h | 18 +++++----- indra/newview/llviewermenu.cpp | 4 +-- indra/newview/llviewermessage.cpp | 4 +-- indra/newview/tests/lllogininstance_test.cpp | 2 +- 30 files changed, 126 insertions(+), 126 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e7234303a8..cdb4130d42 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -103,7 +103,7 @@ using namespace LLAvatarAppearanceDefines; extern LLMenuBarGL* gMenuBarView; -const BOOL ANIMATE = TRUE; +const bool ANIMATE = true; const U8 AGENT_STATE_TYPING = 0x04; const U8 AGENT_STATE_EDITING = 0x10; @@ -373,7 +373,7 @@ bool LLAgent::isMicrophoneOn(const LLSD& sdname) //----------------------------------------------------------------------------- LLAgent::LLAgent() : mGroupPowers(0), - mHideGroupTitle(FALSE), + mHideGroupTitle(false), mGroupID(), mInitialized(false), @@ -417,24 +417,24 @@ LLAgent::LLAgent() : mRenderState(0), mTypingTimer(), - mViewsPushed(FALSE), + mViewsPushed(false), - mCustomAnim(FALSE), - mShowAvatar(TRUE), + mCustomAnim(false), + mShowAvatar(true), mFrameAgent(), mIsDoNotDisturb(false), mControlFlags(0x00000000), - mbFlagsDirty(FALSE), - mbFlagsNeedReset(FALSE), + mbFlagsDirty(false), + mbFlagsNeedReset(false), - mAutoPilot(FALSE), - mAutoPilotFlyOnStop(FALSE), - mAutoPilotAllowFlying(TRUE), + mAutoPilot(false), + mAutoPilotFlyOnStop(false), + mAutoPilotAllowFlying(true), mAutoPilotTargetGlobal(), mAutoPilotStopDistance(1.f), - mAutoPilotUseRotation(FALSE), + mAutoPilotUseRotation(false), mAutoPilotTargetFacing(LLVector3::zero), mAutoPilotTargetDist(0.f), mAutoPilotNoProgressFrameCount(0), @@ -442,18 +442,18 @@ LLAgent::LLAgent() : mAutoPilotFinishedCallback(NULL), mAutoPilotCallbackData(NULL), - mMovementKeysLocked(FALSE), + mMovementKeysLocked(false), mEffectColor(new LLUIColor(LLColor4(0.f, 1.f, 1.f, 1.f))), - mHaveHomePosition(FALSE), + mHaveHomePosition(false), mHomeRegionHandle( 0 ), mNearChatRadius(CHAT_NORMAL_RADIUS / 2.f), mNextFidgetTime(0.f), mCurrentFidget(0), mFirstLogin(false), - mOutfitChosen(FALSE), + mOutfitChosen(false), mVoiceConnected(false), @@ -481,7 +481,7 @@ void LLAgent::init() { mMoveTimer.start(); - gSavedSettings.declareBOOL("SlowMotionAnimation", FALSE, "Declared in code", LLControlVariable::PERSIST_NO); + gSavedSettings.declareBOOL("SlowMotionAnimation", false, "Declared in code", LLControlVariable::PERSIST_NO); gSavedSettings.getControl("SlowMotionAnimation")->getSignal()->connect(boost::bind(&handleSlowMotionAnimation, _2)); // *Note: this is where LLViewerCamera::getInstance() used to be constructed. @@ -847,20 +847,20 @@ void LLAgent::movePitch(F32 mag) // Does this parcel allow you to fly? -BOOL LLAgent::canFly() +bool LLAgent::canFly() { - if (isGodlike()) return TRUE; + if (isGodlike()) return true; LLViewerRegion* regionp = getRegion(); - if (regionp && regionp->getBlockFly()) return FALSE; + if (regionp && regionp->getBlockFly()) return false; LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (!parcel) return FALSE; + if (!parcel) return false; // Allow owners to fly on their own land. if (LLViewerParcelMgr::isParcelOwnedByAgent(parcel, GP_LAND_ALLOW_FLY)) { - return TRUE; + return true; } return parcel->getAllowFly(); @@ -952,7 +952,7 @@ void LLAgent::toggleFlying() // static bool LLAgent::enableFlying() { - BOOL sitting = FALSE; + bool sitting = false; if (isAgentAvatarValid()) { sitting = gAgentAvatarp->isSitting(); @@ -963,7 +963,7 @@ bool LLAgent::enableFlying() // static bool LLAgent::isSitting() { - BOOL sitting = FALSE; + bool sitting = false; if (isAgentAvatarValid()) { sitting = gAgentAvatarp->isSitting(); diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index fd3a9b1d7b..c1162c1609 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -43,7 +43,7 @@ #include #include -extern const BOOL ANIMATE; +extern const bool ANIMATE; extern const U8 AGENT_STATE_TYPING; // Typing indication extern const U8 AGENT_STATE_EDITING; // Set when agent has objects selected @@ -356,7 +356,7 @@ public: void setFlying(BOOL fly, BOOL fail_sound = FALSE); static void toggleFlying(); static bool enableFlying(); - BOOL canFly(); // Does this parcel allow you to fly? + bool canFly(); // Does this parcel allow you to fly? static bool isSitting(); //-------------------------------------------------------------------- diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index db99f20775..8bd9169c7d 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -76,7 +76,7 @@ void set_default_permissions(LLViewerInventoryItem* item) item->setPermissions(perm); - item->updateServer(FALSE); + item->updateServer(false); } } @@ -304,7 +304,7 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy item->setAssetUUID(wearable->getAssetID()); item->setTransactionID(wearable->getTransactionID()); gInventory.addChangedMask(LLInventoryObserver::INTERNAL, item_id); - item->updateServer(FALSE); + item->updateServer(false); } gInventory.notifyObservers(); } diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 17e1a27934..26c717c0ad 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -1678,7 +1678,7 @@ void AISUpdate::doUpdate() LLPointer new_item = lost_it->second; new_item->setParent(lost_uuid); - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); } } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4c3a9229d2..6545b1d278 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1336,7 +1336,7 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable) wearable_item->setAssetUUID(new_wearable->getAssetID()); wearable_item->setTransactionID(new_wearable->getTransactionID()); gInventory.updateItem(wearable_item, LLInventoryObserver::INTERNAL); - wearable_item->updateServer(FALSE); + wearable_item->updateServer(false); use_count++; } @@ -4231,12 +4231,12 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b // FIXME switch to use AISv3 where supported. //items need to be updated on a dataserver - item->setComplete(TRUE); - item->updateServer(FALSE); + item->setComplete(true); + item->updateServer(false); gInventory.updateItem(item); - swap_item->setComplete(TRUE); - swap_item->updateServer(FALSE); + swap_item->setComplete(true); + swap_item->updateServer(false); gInventory.updateItem(swap_item); //to cause appearance of the agent to be updated diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 0cbfad8b73..3f426327b0 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -80,7 +80,7 @@ public: virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } virtual std::string getLabelSuffix() const { return LLStringUtil::null; } virtual BOOL isItemRenameable() const { return TRUE; } - virtual BOOL renameItem(const std::string& new_name) { mName = new_name; mNeedsRefresh = true; return TRUE; } + virtual bool renameItem(const std::string& new_name) { mName = new_name; mNeedsRefresh = true; return true; } virtual BOOL isItemMovable( void ) const { return FALSE; } virtual BOOL isItemRemovable( void ) const { return FALSE; } virtual BOOL isItemInTrash( void) const { return FALSE; } diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index f926a8a6d5..1c9dd652d8 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -356,8 +356,8 @@ public: { LLFavoritesOrderStorage::instance().setSortIndex(item, mSortField); - item->setComplete(TRUE); - item->updateServer(FALSE); + item->setComplete(true); + item->updateServer(false); gInventory.updateItem(item); gInventory.notifyObservers(); @@ -662,8 +662,8 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con { LLFavoritesOrderStorage::instance().setSortIndex(currItem, ++sortField); - currItem->setComplete(TRUE); - currItem->updateServer(FALSE); + currItem->setComplete(true); + currItem->updateServer(false); gInventory.updateItem(currItem); } @@ -1478,7 +1478,7 @@ bool LLFavoritesBarCtrl::onRenameCommit(const LLSD& notification, const LLSD& re { LLPointer new_item = new LLViewerInventoryItem(item); new_item->rename(landmark_name); - new_item->updateServer(FALSE); + new_item->updateServer(false); gInventory.updateItem(new_item); } } @@ -2039,8 +2039,8 @@ void LLFavoritesOrderStorage::saveItemsOrder( const LLInventoryModel::item_array setSortIndex(item, ++sortField); - item->setComplete(TRUE); - item->updateServer(FALSE); + item->setComplete(true); + item->updateServer(false); gInventory.updateItem(item); diff --git a/indra/newview/llfloatercreatelandmark.cpp b/indra/newview/llfloatercreatelandmark.cpp index b82d8a29ba..6faa659d87 100644 --- a/indra/newview/llfloatercreatelandmark.cpp +++ b/indra/newview/llfloatercreatelandmark.cpp @@ -345,7 +345,7 @@ void LLFloaterCreateLandmark::onSaveClicked() gInventory.accountForUpdate(update); new_item->setParent(folder_id); - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); } removeObserver(); diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index f29046c513..2ebe67e600 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -85,7 +85,7 @@ public: perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Gestures")); perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Gestures")); item->setPermissions(perm); - item->updateServer(FALSE); + item->updateServer(false); } } }; @@ -678,7 +678,7 @@ void LLFloaterGesture::onDeleteSelected() new_item->setParent(trash_id); // no need to restamp it though it's a move into trash because // it's a brand new item already. - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); gInventory.updateItem(new_item); } } diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index 21d106c8b1..ba1ca868bc 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -247,7 +247,7 @@ void LLFloaterMyEnvironment::onDeleteSelected() LLPointer new_item = new LLViewerInventoryItem(inv_item); new_item->setParent(trash_id); - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); gInventory.updateItem(new_item); } } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b44fcf3e03..2f2b5a7b88 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2114,14 +2114,14 @@ BOOL LLItemBridge::isItemRenameable() const return FALSE; } -BOOL LLItemBridge::renameItem(const std::string& new_name) +bool LLItemBridge::renameItem(const std::string& new_name) { if(!isItemRenameable()) - return FALSE; + return false; LLPreview::dirty(mUUID); LLInventoryModel* model = getInventoryModel(); if(!model) - return FALSE; + return false; LLViewerInventoryItem* item = getItem(); if(item && (item->getName() != new_name)) { @@ -2129,9 +2129,9 @@ BOOL LLItemBridge::renameItem(const std::string& new_name) updates["name"] = new_name; update_inventory_item(item->getUUID(),updates, NULL); } - // return FALSE because we either notified observers (& therefore + // return false because we either notified observers (& therefore // rebuilt) or we didn't update. - return FALSE; + return false; } BOOL LLItemBridge::removeItem() @@ -3767,7 +3767,7 @@ LLUIImagePtr LLFolderBridge::getIconOverlay() const return NULL; } -BOOL LLFolderBridge::renameItem(const std::string& new_name) +bool LLFolderBridge::renameItem(const std::string& new_name) { LLScrollOnRenameObserver *observer = new LLScrollOnRenameObserver(mUUID, mRoot); @@ -3775,9 +3775,9 @@ BOOL LLFolderBridge::renameItem(const std::string& new_name) rename_category(getInventoryModel(), mUUID, new_name); - // return FALSE because we either notified observers (& therefore + // return false because we either notified observers (& therefore // rebuilt) or we didn't update. - return FALSE; + return false; } BOOL LLFolderBridge::removeItem() @@ -6907,20 +6907,20 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -BOOL LLObjectBridge::renameItem(const std::string& new_name) +bool LLObjectBridge::renameItem(const std::string& new_name) { if(!isItemRenameable()) - return FALSE; + return false; LLPreview::dirty(mUUID); LLInventoryModel* model = getInventoryModel(); if(!model) - return FALSE; + return false; LLViewerInventoryItem* item = getItem(); if(item && (item->getName() != new_name)) { LLPointer new_item = new LLViewerInventoryItem(item); new_item->rename(new_name); - new_item->updateServer(FALSE); + new_item->updateServer(false); model->updateItem(new_item); model->notifyObservers(); buildDisplayName(); @@ -6939,7 +6939,7 @@ BOOL LLObjectBridge::renameItem(const std::string& new_name) } // return FALSE because we either notified observers (& therefore // rebuilt) or we didn't update. - return FALSE; + return false; } // +=================================================+ @@ -6973,7 +6973,7 @@ LLWearableBridge::LLWearableBridge(LLInventoryPanel* inventory, mInvType = inv_type; } -BOOL LLWearableBridge::renameItem(const std::string& new_name) +bool LLWearableBridge::renameItem(const std::string& new_name) { if (get_is_item_worn(mUUID)) { @@ -7427,7 +7427,7 @@ void LLSettingsBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -BOOL LLSettingsBridge::renameItem(const std::string& new_name) +bool LLSettingsBridge::renameItem(const std::string& new_name) { /*TODO: change internal settings name? */ return LLItemBridge::renameItem(new_name); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 3cbbd68e51..854113df5c 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -113,7 +113,7 @@ public: virtual void showProperties(); virtual BOOL isItemRenameable() const { return TRUE; } virtual BOOL isMultiPreviewAllowed() { return TRUE; } - //virtual BOOL renameItem(const std::string& new_name) {} + //virtual bool renameItem(const std::string& new_name) {} virtual BOOL isItemRemovable() const; virtual BOOL isItemMovable() const; virtual BOOL isItemInTrash() const; @@ -247,7 +247,7 @@ public: virtual PermissionMask getPermissionMask() const; virtual time_t getCreationDate() const; virtual BOOL isItemRenameable() const; - virtual BOOL renameItem(const std::string& new_name); + virtual bool renameItem(const std::string& new_name); virtual BOOL removeItem(); virtual bool isItemCopyable(bool can_copy_as_link = true) const; virtual bool hasChildren() const { return FALSE; } @@ -305,7 +305,7 @@ public: void setShowDescendantsCount(bool show_count) {mShowDescendantsCount = show_count;} - virtual BOOL renameItem(const std::string& new_name); + virtual bool renameItem(const std::string& new_name); virtual BOOL removeItem(); BOOL removeSystemFolder(); @@ -522,7 +522,7 @@ public: virtual BOOL isItemWearable() const { return TRUE; } virtual std::string getLabelSuffix() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual BOOL renameItem(const std::string& new_name); + virtual bool renameItem(const std::string& new_name); LLInventoryObject* getObject() const; protected: static LLUUID sContextMenuItemID; // Only valid while the context menu is open. @@ -555,7 +555,7 @@ public: virtual BOOL isItemWearable() const { return TRUE; } virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual std::string getLabelSuffix() const; - virtual BOOL renameItem(const std::string& new_name); + virtual bool renameItem(const std::string& new_name); virtual LLWearableType::EType getWearableType() const { return mWearableType; } static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu @@ -632,7 +632,7 @@ public: virtual void openItem(); virtual BOOL isMultiPreviewAllowed() { return FALSE; } virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual BOOL renameItem(const std::string& new_name); + virtual bool renameItem(const std::string& new_name); virtual BOOL isItemRenameable() const; virtual LLSettingsType::type_e getSettingsType() const { return mSettingsType; } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 4aeacae6ed..7056eeb496 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2066,7 +2066,7 @@ void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id) LLPointer new_item = new LLViewerInventoryItem(inv_item); new_item->setParent(new_parent_id); - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 05aa2e423f..fef0366868 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1474,7 +1474,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask) { // Parent id at server is null, so update server even if item already is in the same folder old_item->setParent(new_parent_id); - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); } mask |= LLInventoryObserver::INTERNAL; } @@ -1495,7 +1495,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask) gInventory.accountForUpdate(update); // *FIX: bit of a hack to call update server from here... - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); item_array->push_back(new_item); } else @@ -1540,7 +1540,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask) gInventory.accountForUpdate(update); // *FIX: bit of a hack to call update server from // here... - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); item_array->push_back(new_item); } else @@ -3040,10 +3040,10 @@ void LLInventoryModel::buildParentChildMap() // FIXME note that updateServer() fails with protected // types, so this will not work as intended in that case. // UpdateServer uses AIS, AIS cat move is not implemented yet - // cat->updateServer(TRUE); + // cat->updateServer(true); // MoveInventoryFolder message, intentionally per item - cat->updateParentOnServer(FALSE); + cat->updateParentOnServer(false); catsp = getUnlockedCatArray(cat->getParentUUID()); if(catsp) { diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 1f410bea10..2b4bef278e 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -1332,7 +1332,7 @@ void BGFolderHttpHandler::processData(LLSD & content, LLCore::HttpResponse * res gInventory.accountForUpdate(update); titem->setParent(lost_uuid); - titem->updateParentOnServer(FALSE); + titem->updateParentOnServer(false); gInventory.updateItem(titem); } } diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index cc3c51dd83..cea078bc23 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -545,7 +545,7 @@ void LLPanelLandmarkInfo::collectLandmarkFolders(LLInventoryModel::cat_array_t& gInventory.accountForUpdate(update); mItem->setParent(mNewParentId); - mItem->updateParentOnServer(FALSE); + mItem->updateParentOnServer(false); gInventory.updateItem(mItem); gInventory.notifyObservers(); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index f3a41f2e25..18e134e4e4 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -128,7 +128,7 @@ public: virtual void selectItem() {} virtual void navigateToFolder(bool new_window = false, bool change_mode = false) {} virtual BOOL isItemRenameable() const; - virtual BOOL renameItem(const std::string& new_name); + virtual bool renameItem(const std::string& new_name); virtual BOOL isItemMovable() const; virtual BOOL isItemRemovable() const; virtual BOOL removeItem(); @@ -304,7 +304,7 @@ BOOL LLTaskInvFVBridge::isItemRenameable() const return FALSE; } -BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name) +bool LLTaskInvFVBridge::renameItem(const std::string& new_name) { LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) @@ -322,7 +322,7 @@ BOOL LLTaskInvFVBridge::renameItem(const std::string& new_name) false); } } - return TRUE; + return true; } BOOL LLTaskInvFVBridge::isItemMovable() const @@ -333,7 +333,7 @@ BOOL LLTaskInvFVBridge::isItemMovable() const // return TRUE; //} //return FALSE; - return TRUE; + return true; } BOOL LLTaskInvFVBridge::isItemRemovable() const @@ -587,7 +587,7 @@ public: virtual const std::string& getDisplayName() const; virtual BOOL isItemRenameable() const; // virtual BOOL isItemCopyable() const { return FALSE; } - virtual BOOL renameItem(const std::string& new_name); + virtual bool renameItem(const std::string& new_name); virtual BOOL isItemRemovable() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual bool hasChildren() const; @@ -643,9 +643,9 @@ BOOL LLTaskCategoryBridge::isItemRenameable() const return FALSE; } -BOOL LLTaskCategoryBridge::renameItem(const std::string& new_name) +bool LLTaskCategoryBridge::renameItem(const std::string& new_name) { - return FALSE; + return false; } BOOL LLTaskCategoryBridge::isItemRemovable() const @@ -906,7 +906,7 @@ public: LLTaskInvFVBridge(panel, uuid, name) {} virtual BOOL isItemRenameable() const; - virtual BOOL renameItem(const std::string& new_name); + virtual bool renameItem(const std::string& new_name); }; BOOL LLTaskCallingCardBridge::isItemRenameable() const @@ -914,9 +914,9 @@ BOOL LLTaskCallingCardBridge::isItemRenameable() const return FALSE; } -BOOL LLTaskCallingCardBridge::renameItem(const std::string& new_name) +bool LLTaskCallingCardBridge::renameItem(const std::string& new_name) { - return FALSE; + return false; } diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 67f913a067..8a8518ce0d 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -1175,7 +1175,7 @@ void LLPanelPermissions::onCommitName(LLUICtrl*, void* data) { LLPointer new_item = new LLViewerInventoryItem(item); new_item->rename(tb->getText()); - new_item->updateServer(FALSE); + new_item->updateServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); } @@ -1202,7 +1202,7 @@ void LLPanelPermissions::onCommitDesc(LLUICtrl*, void* data) { LLPointer new_item = new LLViewerInventoryItem(item); new_item->setDescription(le->getText()); - new_item->updateServer(FALSE); + new_item->updateServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); } diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 1d5ed93c4d..b603c361d8 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -831,7 +831,7 @@ void LLPanelPlaces::onSaveButtonClicked() gInventory.accountForUpdate(update); new_item->setParent(folder_id); - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); } gInventory.updateItem(new_item); diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 0117db86e8..fd552d8b7a 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -172,7 +172,7 @@ void LLPreview::onCommit() } else if(item->getPermissions().getOwner() == gAgent.getID()) { - new_item->updateServer(FALSE); + new_item->updateServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); @@ -460,7 +460,7 @@ void LLPreview::onDiscardBtn(void* data) new_item->setParent(trash_id); // no need to restamp it though it's a move into trash because // it's a brand new item already. - new_item->updateParentOnServer(FALSE); + new_item->updateParentOnServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); } diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 544ff8b5dc..2e40455a46 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -1196,7 +1196,7 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data, new_item->setDescription(info->mDesc); new_item->setTransactionID(info->mTransactionID); new_item->setAssetUUID(asset_uuid); - new_item->updateServer(FALSE); + new_item->updateServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); } diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 6681703625..1a613afbb8 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -659,7 +659,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data LLPointer new_item = new LLViewerInventoryItem(item); new_item->setAssetUUID(asset_uuid); new_item->setTransactionID(info->mTransactionID); - new_item->updateServer(FALSE); + new_item->updateServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index d172a87b1d..61508f8648 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -4185,14 +4185,14 @@ 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. diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 7009fb98ab..4df80cb2b9 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -181,7 +181,7 @@ void LLSettingsVOBase::onInventoryItemCreated(const LLUUID &inventoryId, LLSetti { perm.setMaskEveryone(PERM_COPY); pitem->setPermissions(perm); - pitem->updateServer(FALSE); + pitem->updateServer(false); } } if (!settings) @@ -240,7 +240,7 @@ void LLSettingsVOBase::updateInventoryItem(const LLSettingsBase::ptr_t &settings } if (need_update) { - new_item->updateServer(FALSE); + new_item->updateServer(false); gInventory.updateItem(new_item); gInventory.notifyObservers(); } diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index d6d5a4ef2d..298fac1bfe 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -673,7 +673,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) /////////////// const LLSaleInfo& sale_info = item->getSaleInfo(); - BOOL is_for_sale = sale_info.isForSale(); + bool is_for_sale = sale_info.isForSale(); LLComboBox* combo_sale_type = getChild("ComboBoxSaleType"); LLUICtrl* edit_cost = getChild("Edit Cost"); @@ -1144,7 +1144,7 @@ void LLSidepanelItemInfo::onCommitChanges(LLPointer item) mUpdatePendingId++; LLPointer callback = new PropertiesChangedCallback(getHandle(), mItemID, mUpdatePendingId); update_inventory_item(item.get(), callback); - //item->updateServer(FALSE); + //item->updateServer(false); gInventory.updateItem(item); gInventory.notifyObservers(); } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 3b50dc354f..eefe050d46 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -406,7 +406,7 @@ void LLViewerInventoryItem::cloneViewerItem(LLPointer& ne } } -void LLViewerInventoryItem::updateServer(BOOL is_new) const +void LLViewerInventoryItem::updateServer(bool is_new) const { if(!mIsComplete) { @@ -494,24 +494,24 @@ void LLViewerInventoryItem::fetchFromServer(void) const } // virtual -BOOL LLViewerInventoryItem::unpackMessage(const LLSD& item) +bool LLViewerInventoryItem::unpackMessage(const LLSD& item) { BOOL rv = LLInventoryItem::fromLLSD(item); LLLocalizedInventoryItemsDictionary::getInstance()->localizeInventoryObjectName(mName); - mIsComplete = TRUE; + mIsComplete = true; return rv; } // virtual -BOOL LLViewerInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num) +bool LLViewerInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num) { BOOL rv = LLInventoryItem::unpackMessage(msg, block, block_num); LLLocalizedInventoryItemsDictionary::getInstance()->localizeInventoryObjectName(mName); - mIsComplete = TRUE; + mIsComplete = true; return rv; } @@ -547,7 +547,7 @@ bool LLViewerInventoryItem::importLegacyStream(std::istream& input_stream) return rv; } -void LLViewerInventoryItem::updateParentOnServer(BOOL restamp) const +void LLViewerInventoryItem::updateParentOnServer(bool restamp) const { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MoveInventoryItem); @@ -628,7 +628,7 @@ void LLViewerInventoryCategory::packMessage(LLMessageSystem* msg) const msg->addStringFast(_PREHASH_Name, mName); } -void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const +void LLViewerInventoryCategory::updateParentOnServer(bool restamp) const { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MoveInventoryFolder); @@ -643,7 +643,7 @@ void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const gAgent.sendReliableMessage(); } -void LLViewerInventoryCategory::updateServer(BOOL is_new) const +void LLViewerInventoryCategory::updateServer(bool is_new) const { // communicate that change with the server. @@ -877,9 +877,9 @@ void LLViewerInventoryCategory::localizeName() } // virtual -BOOL LLViewerInventoryCategory::unpackMessage(const LLSD& category) +bool LLViewerInventoryCategory::unpackMessage(const LLSD& category) { - BOOL rv = LLInventoryCategory::fromLLSD(category); + bool rv = LLInventoryCategory::fromLLSD(category); localizeName(); return rv; } @@ -998,7 +998,7 @@ void set_default_permissions(LLViewerInventoryItem* item, std::string perm_type) item->setPermissions(perm); - item->updateServer(FALSE); + item->updateServer(false); } } @@ -2141,7 +2141,7 @@ U32 LLViewerInventoryItem::getCRC32() const // *TODO: mantipov: should be removed with LMSortPrefix patch in llinventorymodel.cpp, EXT-3985 static char getSeparator() { return '@'; } -BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName) +bool LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName) { using std::string; using std::stringstream; @@ -2149,7 +2149,7 @@ BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& na const char separator = getSeparator(); const string::size_type separatorPos = name.find(separator, 0); - BOOL result = FALSE; + BOOL result = false; if (separatorPos < string::npos) { @@ -2170,7 +2170,7 @@ BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& na *displayName = name.substr(separatorPos + 1, string::npos); } - result = TRUE; + result = true; } return result; @@ -2319,9 +2319,9 @@ BOOL LLViewerInventoryItem::regenerateLink() { LLViewerInventoryItem *item = (*item_iter); item->setAssetUUID(target_item_id); - item->updateServer(FALSE); + item->updateServer(false); gInventory.addChangedMask(LLInventoryObserver::REBUILD, item->getUUID()); } gInventory.notifyObservers(); - return TRUE; + return true; } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 7541a0f23c..f700fcc11f 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -56,7 +56,7 @@ public: protected: ~LLViewerInventoryItem( void ); // ref counted - BOOL extractSortFieldAndDisplayName(S32* sortField, std::string* displayName) const { return extractSortFieldAndDisplayName(mName, sortField, displayName); } + bool extractSortFieldAndDisplayName(S32* sortField, std::string* displayName) const { return extractSortFieldAndDisplayName(mName, sortField, displayName); } mutable std::string mDisplayName; public: @@ -83,7 +83,7 @@ public: virtual time_t getCreationDate() const; virtual U32 getCRC32() const; // really more of a checksum. - static BOOL extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName); + static bool extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName); // construct a complete viewer inventory item LLViewerInventoryItem(const LLUUID& uuid, const LLUUID& parent_uuid, @@ -125,13 +125,13 @@ public: void cloneViewerItem(LLPointer& newitem) const; // virtual methods - virtual void updateParentOnServer(BOOL restamp) const; - virtual void updateServer(BOOL is_new) const; + virtual void updateParentOnServer(bool restamp) const; + virtual void updateServer(bool is_new) const; void fetchFromServer(void) const; virtual void packMessage(LLMessageSystem* msg) const; - virtual BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); - virtual BOOL unpackMessage(const LLSD& item); + virtual bool unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); + virtual bool unpackMessage(const LLSD& item); virtual bool importLegacyStream(std::istream& input_stream); // new methods @@ -197,8 +197,8 @@ public: LLViewerInventoryCategory(const LLViewerInventoryCategory* other); void copyViewerCategory(const LLViewerInventoryCategory* other); - virtual void updateParentOnServer(BOOL restamp_children) const; - virtual void updateServer(BOOL is_new) const; + virtual void updateParentOnServer(bool restamp_children) const; + virtual void updateServer(bool is_new) const; virtual void packMessage(LLMessageSystem* msg) const; @@ -236,7 +236,7 @@ public: void determineFolderType(); void changeType(LLFolderType::EType new_folder_type); virtual void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); - virtual BOOL unpackMessage(const LLSD& category); + virtual bool unpackMessage(const LLSD& category); // returns true if the category object will accept the incoming item bool acceptItem(LLInventoryItem* inv_item); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ae365de6fc..3d2feb5b1f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8341,7 +8341,7 @@ void handle_grab_baked_texture(void* data) LLInventoryItemFlags::II_FLAGS_NONE, creation_date_now); - item->updateServer(TRUE); + item->updateServer(true); gInventory.updateItem(item); gInventory.notifyObservers(); @@ -8372,7 +8372,7 @@ BOOL enable_grab_baked_texture(void* data) { return gAgentAvatarp->canGrabBakedTexture(index); } - return FALSE; + return false; } // Returns a pointer to the avatar give the UUID of the avatar OR of an attachment the avatar is wearing. diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ada898b98c..721f822f63 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5978,7 +5978,7 @@ void container_inventory_arrived(LLViewerObject* object, LLSaleInfo::DEFAULT, item->getFlags(), creation_date_utc); - new_item->updateServer(TRUE); + new_item->updateServer(true); gInventory.updateItem(new_item); } } @@ -6019,7 +6019,7 @@ void container_inventory_arrived(LLViewerObject* object, LLSaleInfo::DEFAULT, item->getFlags(), creation_date_utc); - new_item->updateServer(TRUE); + new_item->updateServer(true); gInventory.updateItem(new_item); gInventory.notifyObservers(); if(active_panel) diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index 696fe3536c..f0479f07b2 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -204,7 +204,7 @@ F32 LLControlGroup::getF32(const std::string& name) { return 0.0f; } U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only) { return 1; } void LLControlGroup::setString(const std::string& name, const std::string& val) {} std::string LLControlGroup::getString(const std::string& name) { return "test_string"; } -LLControlVariable* LLControlGroup::declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return NULL; } +LLControlVariable* LLControlGroup::declareBOOL(const std::string& name, bool initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return NULL; } LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return NULL; } #include "lluicolortable.h" -- cgit v1.2.3 From 70f8dc7a4f4be217fea5439e474fc75e567c23c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Sat, 10 Feb 2024 22:37:52 +0100 Subject: miscellaneous: BOOL (int) to real bool --- indra/newview/llcommandlineparser.cpp | 2 +- indra/newview/llvoavatar.cpp | 22 +++++++++++----------- indra/newview/llvoavatar.h | 12 ++++++------ indra/newview/llvoavatarself.cpp | 10 +++++----- indra/newview/llvoavatarself.h | 6 +++--- 5 files changed, 26 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 06d959ba3c..794bb78b9c 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -572,7 +572,7 @@ void setControlValueCB(const LLCommandLineParser::token_vector_t& value, // There's a token. check the string for true/false/1/0 etc. BOOL result = false; - BOOL gotSet = LLStringUtil::convertToBOOL(token, result); + bool gotSet = LLStringUtil::convertToBOOL(token, result); if (gotSet) { ctrl->setValue(LLSD(result), false); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c95648d62e..3332a2ef53 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6904,17 +6904,17 @@ void LLVOAvatar::requestStopMotion( LLMotion* motion ) // loadSkeletonNode(): loads node from XML tree //----------------------------------------------------------------------------- //virtual -BOOL LLVOAvatar::loadSkeletonNode () +bool LLVOAvatar::loadSkeletonNode () { if (!LLAvatarAppearance::loadSkeletonNode()) { - return FALSE; + return false; } bool ignore_hud_joints = false; initAttachmentPoints(ignore_hud_joints); - return TRUE; + return true; } //----------------------------------------------------------------------------- @@ -7883,9 +7883,9 @@ S32 LLVOAvatar::getAttachmentCount() return count; } -BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const +bool LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const { - if (mIsDummy) return TRUE; + if (mIsDummy) return true; if (isSelf()) { @@ -7898,7 +7898,7 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const case LLWearableType::WT_SKIN: case LLWearableType::WT_HAIR: case LLWearableType::WT_EYES: - return TRUE; // everyone has all bodyparts + return true; // everyone has all bodyparts default: break; // Do nothing } @@ -7919,10 +7919,10 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; return isTextureDefined(LLAvatarAppearance::getDictionary()->getBakedTexture(baked_index)->mTextureIndex); } - return FALSE; + return false; } } - return FALSE; + return false; } LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) const @@ -11462,17 +11462,17 @@ F32 calc_bouncy_animation(F32 x) } //virtual -BOOL LLVOAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U32 index ) const +bool LLVOAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U32 index ) const { if (isIndexLocalTexture(te)) { - return FALSE; + return false; } if( !getImage( te, index ) ) { LL_WARNS() << "getImage( " << te << ", " << index << " ) returned 0" << LL_ENDL; - return FALSE; + return false; } return (getImage(te, index)->getID() != IMG_DEFAULT_AVATAR && diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 759d02959c..81831c3829 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -461,7 +461,7 @@ public: void debugBodySize() const; void postPelvisSetRecalc( void ); - /*virtual*/ BOOL loadSkeletonNode(); + /*virtual*/ bool loadSkeletonNode(); void initAttachmentPoints(bool ignore_hud_joints = false); /*virtual*/ void buildCharacter(); void resetVisualParams(); @@ -701,7 +701,7 @@ public: // Loading status //-------------------------------------------------------------------- public: - virtual BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; + virtual bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; virtual BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; virtual BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const; @@ -875,11 +875,11 @@ public: // True if we are computing our appearance via local compositing // instead of baked textures, as for example during wearable // editing or when waiting for a subsequent server rebake. - /*virtual*/ BOOL isUsingLocalAppearance() const { return mUseLocalAppearance; } + /*virtual*/ bool isUsingLocalAppearance() const { return mUseLocalAppearance; } // True if we are currently in appearance editing mode. Often but // not always the same as isUsingLocalAppearance(). - /*virtual*/ BOOL isEditingAppearance() const { return mIsEditingAppearance; } + /*virtual*/ bool isEditingAppearance() const { return mIsEditingAppearance; } // FIXME review isUsingLocalAppearance uses, some should be isEditing instead. @@ -887,7 +887,7 @@ private: BOOL mAppearanceAnimating; LLFrameTimer mAppearanceMorphTimer; F32 mLastAppearanceBlendTime; - BOOL mIsEditingAppearance; // flag for if we're actively in appearance editing mode + bool mIsEditingAppearance; // flag for if we're actively in appearance editing mode BOOL mUseLocalAppearance; // flag for if we're using a local composite //-------------------------------------------------------------------- @@ -919,7 +919,7 @@ public: void cleanupAttachedMesh( LLViewerObject* pVO ); bool hasPendingAttachedMeshes(); static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj); - /*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type ) const; + /*virtual*/ bool isWearingWearableType(LLWearableType::EType type ) const; LLViewerObject * findAttachmentByID( const LLUUID & target_id ) const; LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* viewer_object); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 7b24b9ee02..528407b82c 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -300,9 +300,9 @@ void LLVOAvatarSelf::markDead() LLVOAvatar::markDead(); } -/*virtual*/ BOOL LLVOAvatarSelf::loadAvatar() +/*virtual*/ bool LLVOAvatarSelf::loadAvatar() { - BOOL success = LLVOAvatar::loadAvatar(); + bool success = LLVOAvatar::loadAvatar(); // set all parameters stored directly in the avatar to have // the isSelfParam to be TRUE - this is used to prevent @@ -314,7 +314,7 @@ void LLVOAvatarSelf::markDead() { if (param->getWearableType() != LLWearableType::WT_INVALID) { - param->setIsDummy(TRUE); + param->setIsDummy(true); } } @@ -691,7 +691,7 @@ bool LLVOAvatarSelf::updateCharacter(LLAgent &agent) } // virtual -BOOL LLVOAvatarSelf::isValid() const +bool LLVOAvatarSelf::isValid() const { return ((getRegion() != NULL) && !isDead()); } @@ -1516,7 +1516,7 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const return TRUE; } -BOOL LLVOAvatarSelf::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const +bool LLVOAvatarSelf::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const { LLUUID id; BOOL isDefined = TRUE; diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 6384e2b844..a121ef356e 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -59,7 +59,7 @@ public: virtual void initInstance(); // Called after construction to initialize the class. void cleanup(); protected: - /*virtual*/ BOOL loadAvatar(); + /*virtual*/ bool loadAvatar(); BOOL loadAvatarSelf(); BOOL buildSkeletonSelf(const LLAvatarSkeletonInfo *info); BOOL buildMenus(); @@ -110,7 +110,7 @@ private: public: /*virtual*/ bool isSelf() const { return true; } - /*virtual*/ BOOL isValid() const; + /*virtual*/ bool isValid() const; //-------------------------------------------------------------------- // Updates @@ -180,7 +180,7 @@ public: BOOL isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const; BOOL isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const; // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index - /*virtual*/ BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; + /*virtual*/ bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const; /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const; -- cgit v1.2.3 From 4419bb870986c6900fc096338622d27b999cd771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Sun, 11 Feb 2024 01:23:28 +0100 Subject: more misc: BOOL (int) to real bool --- indra/newview/llappearancemgr.cpp | 6 +++--- indra/newview/llbreastmotion.h | 2 +- indra/newview/llcallbacklist.cpp | 6 +++--- indra/newview/lldonotdisturbnotificationstorage.cpp | 4 ++-- indra/newview/lldonotdisturbnotificationstorage.h | 2 +- indra/newview/llemote.h | 4 ++-- indra/newview/llfloaterlinkreplace.cpp | 4 ++-- indra/newview/llfloaterlinkreplace.h | 2 +- indra/newview/llfloaterpreference.cpp | 4 ++-- indra/newview/llfloaterregionrestarting.cpp | 4 ++-- indra/newview/llfloaterregionrestarting.h | 2 +- indra/newview/llfloateruipreview.cpp | 12 ++++++------ indra/newview/llimview.cpp | 6 +++--- indra/newview/llimview.h | 2 +- indra/newview/lllocalbitmaps.cpp | 4 ++-- indra/newview/lllocalbitmaps.h | 2 +- indra/newview/lllocalgltfmaterials.cpp | 4 ++-- indra/newview/lllocalgltfmaterials.h | 2 +- indra/newview/llmediadataclient.cpp | 8 ++++---- indra/newview/llmediadataclient.h | 4 ++-- indra/newview/llpanelpeople.cpp | 14 +++++++------- indra/newview/llphysicsmotion.h | 2 +- indra/newview/llsetkeybinddialog.cpp | 4 ++-- indra/newview/llspeakers.cpp | 4 ++-- indra/newview/llspeakers.h | 2 +- indra/newview/lltoast.cpp | 4 ++-- indra/newview/lltoast.h | 2 +- indra/newview/llviewerjointattachment.cpp | 2 +- indra/newview/llviewerjointattachment.h | 2 +- indra/newview/llviewerjointmesh.cpp | 4 ++-- indra/newview/llviewerjointmesh.h | 2 +- indra/newview/llviewermessage.cpp | 8 ++++---- indra/newview/llviewerobject.cpp | 6 +++--- indra/newview/llviewerobject.h | 2 +- indra/newview/llviewerparcelmediaautoplay.cpp | 6 +++--- indra/newview/llviewerparcelmediaautoplay.h | 2 +- indra/newview/llvoavatar.cpp | 8 ++++---- indra/newview/llvoavatar.h | 2 +- indra/newview/llvograss.cpp | 10 +++++----- indra/newview/llvograss.h | 2 +- indra/newview/llvosurfacepatch.cpp | 4 ++-- indra/newview/llvosurfacepatch.h | 2 +- indra/newview/llvovolume.cpp | 10 +++++----- indra/newview/llvovolume.h | 2 +- 44 files changed, 95 insertions(+), 95 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 6545b1d278..48af00d063 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -125,13 +125,13 @@ public: } /*virtual*/ - BOOL tick() + bool tick() { if(mEventTimer.hasExpired()) { LLAppearanceMgr::instance().setOutfitLocked(false); } - return FALSE; + return false; } void stop() { mEventTimer.stop(); } void start() { mEventTimer.start(); } @@ -333,7 +333,7 @@ public: // virtual // Will be deleted after returning true - only safe to do this if all callbacks have fired. - BOOL tick() + bool tick() { // mPendingRequests will be zero if all requests have been // responded to. mWaitTimes.empty() will be true if we have diff --git a/indra/newview/llbreastmotion.h b/indra/newview/llbreastmotion.h index aa0fdf9f8b..433fece29f 100644 --- a/indra/newview/llbreastmotion.h +++ b/indra/newview/llbreastmotion.h @@ -66,7 +66,7 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + virtual bool getLoop() { return true; } // motions must report their total duration virtual F32 getDuration() { return 0.0; } diff --git a/indra/newview/llcallbacklist.cpp b/indra/newview/llcallbacklist.cpp index 59ecbdd0ea..0096e2532c 100644 --- a/indra/newview/llcallbacklist.cpp +++ b/indra/newview/llcallbacklist.cpp @@ -191,10 +191,10 @@ public: } private: - BOOL tick() + bool tick() { mCallable(); - return TRUE; + return true; } nullary_func_t mCallable; @@ -215,7 +215,7 @@ public: { } private: - BOOL tick() + bool tick() { return mCallable(); } diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 4d9ef99319..93a0ef0e82 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -55,7 +55,7 @@ LLDoNotDisturbNotificationStorageTimer::~LLDoNotDisturbNotificationStorageTimer( } -BOOL LLDoNotDisturbNotificationStorageTimer::tick() +bool LLDoNotDisturbNotificationStorageTimer::tick() { LLDoNotDisturbNotificationStorage * doNotDisturbNotificationStorage = LLDoNotDisturbNotificationStorage::getInstance(); @@ -64,7 +64,7 @@ BOOL LLDoNotDisturbNotificationStorageTimer::tick() { doNotDisturbNotificationStorage->saveNotifications(); } - return FALSE; + return false; } LLDoNotDisturbNotificationStorage::LLDoNotDisturbNotificationStorage() diff --git a/indra/newview/lldonotdisturbnotificationstorage.h b/indra/newview/lldonotdisturbnotificationstorage.h index 237d58b4de..6e1bf6076c 100644 --- a/indra/newview/lldonotdisturbnotificationstorage.h +++ b/indra/newview/lldonotdisturbnotificationstorage.h @@ -42,7 +42,7 @@ public: ~LLDoNotDisturbNotificationStorageTimer(); public: - BOOL tick(); + bool tick(); }; class LLDoNotDisturbNotificationStorage : public LLParamSingleton, public LLNotificationStorage diff --git a/indra/newview/llemote.h b/indra/newview/llemote.h index 4c516998dc..9ea6be6b1e 100644 --- a/indra/newview/llemote.h +++ b/indra/newview/llemote.h @@ -69,7 +69,7 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return FALSE; } + virtual bool getLoop() { return false; } // motions must report their total duration virtual F32 getDuration() { return EMOTE_MORPH_FADEIN_TIME + EMOTE_MORPH_IN_TIME + EMOTE_MORPH_FADEOUT_TIME; } @@ -106,7 +106,7 @@ public: // called when a motion is deactivated virtual void onDeactivate(); - virtual BOOL canDeprecate() { return FALSE; } + virtual bool canDeprecate() { return false; } protected: diff --git a/indra/newview/llfloaterlinkreplace.cpp b/indra/newview/llfloaterlinkreplace.cpp index b42c49c607..459fff0812 100644 --- a/indra/newview/llfloaterlinkreplace.cpp +++ b/indra/newview/llfloaterlinkreplace.cpp @@ -310,7 +310,7 @@ void LLFloaterLinkReplace::decreaseOpenItemCount() } } -BOOL LLFloaterLinkReplace::tick() +bool LLFloaterLinkReplace::tick() { LL_DEBUGS() << "Calling tick - remaining items = " << mRemainingInventoryItems.size() << LL_ENDL; @@ -329,7 +329,7 @@ BOOL LLFloaterLinkReplace::tick() } processBatch(current_batch); - return FALSE; + return false; } void LLFloaterLinkReplace::processBatch(LLInventoryModel::item_array_t items) diff --git a/indra/newview/llfloaterlinkreplace.h b/indra/newview/llfloaterlinkreplace.h index 060773f93e..ab2ff87042 100644 --- a/indra/newview/llfloaterlinkreplace.h +++ b/indra/newview/llfloaterlinkreplace.h @@ -89,7 +89,7 @@ public: BOOL postBuild(); virtual void onOpen(const LLSD& key); - virtual BOOL tick(); + virtual bool tick(); private: void checkEnableStart(); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d15c52cc24..ab9714b89f 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1980,12 +1980,12 @@ public: protected: - BOOL tick() + bool tick() { mCallback(mNewValue); mEventTimer.stop(); - return FALSE; + return false; } private: diff --git a/indra/newview/llfloaterregionrestarting.cpp b/indra/newview/llfloaterregionrestarting.cpp index 95d4265bb4..6817cce5f6 100644 --- a/indra/newview/llfloaterregionrestarting.cpp +++ b/indra/newview/llfloaterregionrestarting.cpp @@ -74,11 +74,11 @@ void LLFloaterRegionRestarting::regionChange() close(); } -BOOL LLFloaterRegionRestarting::tick() +bool LLFloaterRegionRestarting::tick() { refresh(); - return FALSE; + return false; } void LLFloaterRegionRestarting::refresh() diff --git a/indra/newview/llfloaterregionrestarting.h b/indra/newview/llfloaterregionrestarting.h index 46416db2c8..5b46f72b09 100644 --- a/indra/newview/llfloaterregionrestarting.h +++ b/indra/newview/llfloaterregionrestarting.h @@ -43,7 +43,7 @@ private: LLFloaterRegionRestarting(const LLSD& key); virtual ~LLFloaterRegionRestarting(); virtual BOOL postBuild(); - virtual BOOL tick(); + virtual bool tick(); virtual void refresh(); virtual void draw(); virtual void regionChange(); diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 67a205417e..83b886237f 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -254,7 +254,7 @@ class LLFadeEventTimer : public LLEventTimer { public: LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent); - BOOL tick(); + bool tick(); LLGUIPreviewLiveFile* mParent; private: BOOL mFadingOut; // fades in then out; this is toggled in between @@ -355,17 +355,17 @@ LLFadeEventTimer::LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent) } // Single tick of fade event timer: increment the color -BOOL LLFadeEventTimer::tick() +bool LLFadeEventTimer::tick() { float diff = 0.04f; - if(TRUE == mFadingOut) // set fade for in/out color direction + if(true == mFadingOut) // set fade for in/out color direction { diff = -diff; } if(NULL == mParent) // no more need to tick, so suicide { - return TRUE; + return true; } // Set up colors @@ -385,10 +385,10 @@ BOOL LLFadeEventTimer::tick() if(bg_color[2] <= 0.0f) // end of fade out, start fading in { - mFadingOut = FALSE; + mFadingOut = false; } - return FALSE; + return false; } // Constructor diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 61a01d7418..e3567f4595 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -99,16 +99,16 @@ const LLUUID LLOutgoingCallDialog::OCD_KEY = LLUUID("7CF78E11-0CFE-498D-ADB9-141 LLIMMgr* gIMMgr = NULL; -BOOL LLSessionTimeoutTimer::tick() +bool LLSessionTimeoutTimer::tick() { - if (mSessionId.isNull()) return TRUE; + if (mSessionId.isNull()) return true; LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(mSessionId); if (session && !session->mSessionInitialized) { gIMMgr->showSessionStartError("session_initialization_timed_out_error", mSessionId); } - return TRUE; + return true; } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 946eb02f26..b9c7065872 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -51,7 +51,7 @@ class LLSessionTimeoutTimer : public LLEventTimer public: LLSessionTimeoutTimer(const LLUUID& session_id, F32 period) : LLEventTimer(period), mSessionId(session_id) {} virtual ~LLSessionTimeoutTimer() {}; - /* virtual */ BOOL tick(); + /* virtual */ bool tick(); private: LLUUID mSessionId; diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 5a5fb7474c..fcf0f1d641 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -1009,10 +1009,10 @@ bool LLLocalBitmapTimer::isRunning() return mEventTimer.getStarted(); } -BOOL LLLocalBitmapTimer::tick() +bool LLLocalBitmapTimer::tick() { LLLocalBitmapMgr::getInstance()->doUpdates(); - return FALSE; + return false; } /*=======================================*/ diff --git a/indra/newview/lllocalbitmaps.h b/indra/newview/lllocalbitmaps.h index 1fdf9dccbf..da854d672d 100644 --- a/indra/newview/lllocalbitmaps.h +++ b/indra/newview/lllocalbitmaps.h @@ -121,7 +121,7 @@ class LLLocalBitmapTimer : public LLEventTimer void startTimer(); void stopTimer(); bool isRunning(); - BOOL tick(); + bool tick(); }; diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp index 61e0163798..cf0742299c 100644 --- a/indra/newview/lllocalgltfmaterials.cpp +++ b/indra/newview/lllocalgltfmaterials.cpp @@ -301,11 +301,11 @@ bool LLLocalGLTFMaterialTimer::isRunning() return mEventTimer.getStarted(); } -BOOL LLLocalGLTFMaterialTimer::tick() +bool LLLocalGLTFMaterialTimer::tick() { // todo: do on idle? No point in timer LLLocalGLTFMaterialMgr::getInstance()->doUpdates(); - return FALSE; + return false; } /*=======================================*/ diff --git a/indra/newview/lllocalgltfmaterials.h b/indra/newview/lllocalgltfmaterials.h index 13b7577e96..46776430ff 100644 --- a/indra/newview/lllocalgltfmaterials.h +++ b/indra/newview/lllocalgltfmaterials.h @@ -90,7 +90,7 @@ public: void startTimer(); void stopTimer(); bool isRunning(); - BOOL tick(); + bool tick(); }; class LLLocalGLTFMaterialMgr : public LLSingleton diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index d3b981e205..d5a2f07e11 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -418,9 +418,9 @@ LLMediaDataClient::QueueTimer::QueueTimer(F32 time, LLMediaDataClient *mdc) } // virtual -BOOL LLMediaDataClient::QueueTimer::tick() +bool LLMediaDataClient::QueueTimer::tick() { - BOOL result = TRUE; + BOOL result = true; if (!mMDC.isNull()) { @@ -451,7 +451,7 @@ LLMediaDataClient::RetryTimer::RetryTimer(F32 time, Request::ptr_t request) } // virtual -BOOL LLMediaDataClient::RetryTimer::tick() +bool LLMediaDataClient::RetryTimer::tick() { mRequest->stopTracking(); @@ -469,7 +469,7 @@ BOOL LLMediaDataClient::RetryTimer::tick() mRequest.reset(); // Don't fire again - return TRUE; + return true; } diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 58f8bad3e4..cd45825c77 100644 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -219,7 +219,7 @@ protected: { public: RetryTimer(F32 time, Request::ptr_t); - virtual BOOL tick(); + virtual bool tick(); private: // back-pointer Request::ptr_t mRequest; @@ -286,7 +286,7 @@ private: { public: QueueTimer(F32 time, LLMediaDataClient *mdc); - virtual BOOL tick(); + virtual bool tick(); private: // back-pointer LLPointer mMDC; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b3224c2c1f..31fe6bc49b 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -313,9 +313,9 @@ public: mEventTimer.stop(); } - virtual BOOL tick() // from LLEventTimer + virtual bool tick() // from LLEventTimer { - return FALSE; + return false; } }; @@ -367,9 +367,9 @@ public: } - /*virtual*/ BOOL tick() + /*virtual*/ bool tick() { - if (!mIsActive) return FALSE; + if (!mIsActive) return false; if (mMask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) { @@ -380,7 +380,7 @@ public: mEventTimer.stop(); mMask = 0; - return FALSE; + return false; } // virtual @@ -508,10 +508,10 @@ public: } } - /*virtual*/ BOOL tick() + /*virtual*/ bool tick() { update(); - return FALSE; + return false; } private: }; diff --git a/indra/newview/llphysicsmotion.h b/indra/newview/llphysicsmotion.h index b246fa99bb..a3b8e293f1 100644 --- a/indra/newview/llphysicsmotion.h +++ b/indra/newview/llphysicsmotion.h @@ -66,7 +66,7 @@ public: //------------------------------------------------------------------------- // motions must specify whether or not they loop - virtual BOOL getLoop() { return TRUE; } + virtual bool getLoop() { return true; } // motions must report their total duration virtual F32 getDuration() { return 0.0; } diff --git a/indra/newview/llsetkeybinddialog.cpp b/indra/newview/llsetkeybinddialog.cpp index 74844a80e8..c5a8380eff 100644 --- a/indra/newview/llsetkeybinddialog.cpp +++ b/indra/newview/llsetkeybinddialog.cpp @@ -53,11 +53,11 @@ public: virtual ~Updater(){} protected: - BOOL tick() + bool tick() { mCallback(mMask); // Deletes itseft after execution - return TRUE; + return true; } private: diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 60bada8f58..2bc8d04a8e 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -181,13 +181,13 @@ LLSpeakerActionTimer::LLSpeakerActionTimer(action_callback_t action_cb, F32 acti { } -BOOL LLSpeakerActionTimer::tick() +bool LLSpeakerActionTimer::tick() { if (mActionCallback) { return (BOOL)mActionCallback(mSpeakerId); } - return TRUE; + return true; } void LLSpeakerActionTimer::unset() diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index ed795b5155..f1c0de2a9b 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -159,7 +159,7 @@ public: * * If action callback is not specified returns true. Instance will be deleted by LLEventTimer::updateClass(). */ - virtual BOOL tick(); + virtual bool tick(); /** * Clears the callback. diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 223aaad811..0d71287fc5 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -44,13 +44,13 @@ LLToastLifeTimer::LLToastLifeTimer(LLToast* toast, F32 period) } /*virtual*/ -BOOL LLToastLifeTimer::tick() +bool LLToastLifeTimer::tick() { if (mEventTimer.hasExpired()) { mToast->expire(); } - return FALSE; + return false; } void LLToastLifeTimer::stop() diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index ab559f1e6f..412656937b 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -53,7 +53,7 @@ public: LLToastLifeTimer(LLToast* toast, F32 period); /*virtual*/ - BOOL tick(); + bool tick(); void stop(); void start(); void restart(); diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index b3bfb86b99..55fa2682e1 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -424,7 +424,7 @@ void LLViewerJointAttachment::calcLOD() //----------------------------------------------------------------------------- // updateLOD() //----------------------------------------------------------------------------- -BOOL LLViewerJointAttachment::updateLOD(F32 pixel_area, BOOL activate) +bool LLViewerJointAttachment::updateLOD(F32 pixel_area, bool activate) { BOOL res = FALSE; if (!mValid) diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h index e5edf2c06b..4f72f3dfa9 100644 --- a/indra/newview/llviewerjointattachment.h +++ b/indra/newview/llviewerjointattachment.h @@ -57,7 +57,7 @@ public: // Called by render(). /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy ); - /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); + /*virtual*/ bool updateLOD(F32 pixel_area, bool activate); // // accessors diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 5d46c695b7..7f774e9f63 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -436,9 +436,9 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w //----------------------------------------------------------------------------- // updateLOD() //----------------------------------------------------------------------------- -BOOL LLViewerJointMesh::updateLOD(F32 pixel_area, BOOL activate) +bool LLViewerJointMesh::updateLOD(F32 pixel_area, bool activate) { - BOOL valid = mValid; + bool valid = mValid; setValid(activate, TRUE); return (valid != activate); } diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index 0db2836e15..1fe58c60ad 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -62,7 +62,7 @@ public: /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE, bool terse_update = false); - /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); + /*virtual*/ bool updateLOD(F32 pixel_area, bool activate); /*virtual*/ void updateJointGeometry(); /*virtual*/ void dump(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 721f822f63..8c76f575a9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2885,7 +2885,7 @@ public: virtual ~LLPostTeleportNotifiers(); //function to be called at the supplied frequency - virtual BOOL tick(); + virtual bool tick(); }; LLPostTeleportNotifiers::LLPostTeleportNotifiers() : LLEventTimer( 2.0 ) @@ -2896,9 +2896,9 @@ LLPostTeleportNotifiers::~LLPostTeleportNotifiers() { } -BOOL LLPostTeleportNotifiers::tick() +bool LLPostTeleportNotifiers::tick() { - BOOL all_done = FALSE; + bool all_done = false; if ( gAgent.getTeleportState() == LLAgent::TELEPORT_NONE ) { // get callingcards and landmarks available to the user arriving. @@ -2922,7 +2922,7 @@ BOOL LLPostTeleportNotifiers::tick() gInventory.addObserver(fetcher); } } - all_done = TRUE; + all_done = true; } return all_done; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index c4e5fcc7b6..a0a9da5bec 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3656,14 +3656,14 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) } } -BOOL LLViewerObject::updateLOD() +bool LLViewerObject::updateLOD() { - return FALSE; + return false; } BOOL LLViewerObject::updateGeometry(LLDrawable *drawable) { - return TRUE; + return false; } void LLViewerObject::updateGL() diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index b85dcc5da2..81413f3976 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -221,7 +221,7 @@ public: virtual BOOL updateGeometry(LLDrawable *drawable); virtual void updateGL(); virtual void updateFaceSize(S32 idx); - virtual BOOL updateLOD(); + virtual bool updateLOD(); virtual BOOL setDrawableParent(LLDrawable* parentp); F32 getRotTime() { return mRotTime; } private: diff --git a/indra/newview/llviewerparcelmediaautoplay.cpp b/indra/newview/llviewerparcelmediaautoplay.cpp index db8fcb4dc4..6db54d812f 100644 --- a/indra/newview/llviewerparcelmediaautoplay.cpp +++ b/indra/newview/llviewerparcelmediaautoplay.cpp @@ -60,7 +60,7 @@ void LLViewerParcelMediaAutoPlay::playStarted() LLSingleton::getInstance()->mPlayed = TRUE; } -BOOL LLViewerParcelMediaAutoPlay::tick() +bool LLViewerParcelMediaAutoPlay::tick() { LLParcel *this_parcel = NULL; LLViewerRegion *this_region = NULL; @@ -94,7 +94,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick() this_region_id != mLastRegionID) { // we've entered a new parcel - mPlayed = FALSE; // we haven't autoplayed yet + mPlayed = false; // we haven't autoplayed yet mTimeInParcel = 0; // reset our timer mLastParcelID = this_parcel_id; mLastRegionID = this_region_id; @@ -156,7 +156,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick() } - return FALSE; // continue ticking forever please. + return false; // continue ticking forever please. } //static diff --git a/indra/newview/llviewerparcelmediaautoplay.h b/indra/newview/llviewerparcelmediaautoplay.h index d71fd4c075..952747a2af 100644 --- a/indra/newview/llviewerparcelmediaautoplay.h +++ b/indra/newview/llviewerparcelmediaautoplay.h @@ -35,7 +35,7 @@ class LLViewerParcelMediaAutoPlay : LLEventTimer, public LLSingletongetNumFaces() <= 0) { - return FALSE; + return false; } LLFace* face = mDrawable->getFace(0); @@ -350,7 +350,7 @@ BOOL LLVOGrass::updateLOD() face->setSize(0, 0); gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); } - return TRUE ; + return true ; } if(!mNumBlades) { @@ -387,10 +387,10 @@ BOOL LLVOGrass::updateLOD() face->setSize(mNumBlades*8, mNumBlades*12); } gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); - return TRUE; + return true; } - return FALSE; + return false; } LLDrawable* LLVOGrass::createDrawable(LLPipeline *pipeline) diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h index 63876dc099..09783ede2e 100644 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -67,7 +67,7 @@ public: void updateFaceSize(S32 idx) { } /*virtual*/ void updateTextures(); - /*virtual*/ BOOL updateLOD(); + /*virtual*/ bool updateLOD(); /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area void plantBlades(); diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index 15fabf0414..be0e992e2c 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -236,9 +236,9 @@ void LLVOSurfacePatch::updateFaceSize(S32 idx) } } -BOOL LLVOSurfacePatch::updateLOD() +bool LLVOSurfacePatch::updateLOD() { - return TRUE; + return true; } void LLVOSurfacePatch::getGeometry(LLStrider &verticesp, diff --git a/indra/newview/llvosurfacepatch.h b/indra/newview/llvosurfacepatch.h index aed67162d1..c5f7f103f4 100644 --- a/indra/newview/llvosurfacepatch.h +++ b/indra/newview/llvosurfacepatch.h @@ -61,7 +61,7 @@ public: /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); /*virtual*/ void updateGL(); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - /*virtual*/ BOOL updateLOD(); + /*virtual*/ bool updateLOD(); /*virtual*/ void updateFaceSize(S32 idx); void getGeometry(LLStrider &verticesp, LLStrider &normalsp, diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ad6c39de48..0917a819d0 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1549,16 +1549,16 @@ BOOL LLVOVolume::calcLOD() return FALSE; } -BOOL LLVOVolume::updateLOD() +bool LLVOVolume::updateLOD() { if (mDrawable.isNull()) { - return FALSE; + return false; } LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME; - BOOL lod_changed = FALSE; + bool lod_changed = false; if (!LLSculptIDSize::instance().isUnloaded(getVolume()->getParams().getSculptID())) { @@ -1566,13 +1566,13 @@ BOOL LLVOVolume::updateLOD() } else { - return FALSE; + return false; } if (lod_changed) { gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME); - mLODChanged = TRUE; + mLODChanged = true; } else { diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index aadc1fbcf3..b65450a3f2 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -238,7 +238,7 @@ public: void updateRelativeXform(bool force_identity = false); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; /*virtual*/ void updateFaceSize(S32 idx) override; - /*virtual*/ BOOL updateLOD() override; + /*virtual*/ bool updateLOD() override; void updateRadius() override; /*virtual*/ void updateTextures() override; void updateTextureVirtualSize(bool forced = false); -- cgit v1.2.3 From 2d8654db9cff989c4a9927207dc25d4cb480912a Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 12 Feb 2024 23:17:03 +0200 Subject: VS build fix: missed values --- indra/newview/llfloateruipreview.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 83b886237f..6256bc800b 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -243,7 +243,7 @@ public: virtual ~LLGUIPreviewLiveFile(); LLFloaterUIPreview* mParent; LLFadeEventTimer* mFadeTimer; // timer for fade-to-yellow-and-back effect to warn that file has been reloaded - BOOL mFirstFade; // setting this avoids showing the fade reload warning on first load + bool mFirstFade; // setting this avoids showing the fade reload warning on first load std::string mFileName; protected: bool loadFile(); @@ -257,7 +257,7 @@ public: bool tick(); LLGUIPreviewLiveFile* mParent; private: - BOOL mFadingOut; // fades in then out; this is toggled in between + bool mFadingOut; // fades in then out; this is toggled in between LLColor4 mOriginalColor; // original color; color is reset to this after fade is coimplete }; @@ -311,7 +311,7 @@ LLLocalizationResetForcer::~LLLocalizationResetForcer() LLGUIPreviewLiveFile::LLGUIPreviewLiveFile(std::string path, std::string name, LLFloaterUIPreview* parent) : mFileName(name), mParent(parent), - mFirstFade(TRUE), + mFirstFade(true), mFadeTimer(NULL), LLLiveFile(path, 1.0) {} @@ -332,7 +332,7 @@ bool LLGUIPreviewLiveFile::loadFile() mParent->displayFloater(FALSE,1); // redisplay the floater if(mFirstFade) // only fade if it wasn't just clicked on; can't use "clicked" BOOL below because of an oddity with setting LLLiveFile initial state { - mFirstFade = FALSE; + mFirstFade = false; } else { @@ -348,7 +348,7 @@ bool LLGUIPreviewLiveFile::loadFile() // Initialize fade event timer LLFadeEventTimer::LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent) : mParent(parent), - mFadingOut(TRUE), + mFadingOut(true), LLEventTimer(refresh) { mOriginalColor = mParent->mParent->mDisplayedFloater->getBackgroundColor(); -- cgit v1.2.3 From db51b083b05663b55807847039254179dfc022f6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 10 Feb 2024 00:25:56 +0200 Subject: Issue #71 Login failures cause growing black zone in the top --- indra/newview/llstartup.cpp | 5 +++ indra/newview/llviewerwindow.cpp | 72 ++++++++++++++++++++++++++-------------- indra/newview/llviewerwindow.h | 1 + 3 files changed, 54 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 7abf9f8bc2..390890706e 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2991,6 +2991,11 @@ void reset_login() // Hide any other stuff LLFloaterReg::hideVisibleInstances(); + + if (LLStartUp::getStartupState() > STATE_WORLD_INIT) + { + gViewerWindow->resetStatusBarContainer(); + } LLStartUp::setStartupState( STATE_BROWSER_INIT ); if (LLVoiceClient::instanceExists()) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f661887c65..349847c57a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2180,31 +2180,40 @@ void LLViewerWindow::initWorldUI() // Force gFloaterTools to initialize LLFloaterReg::getInstance("build"); - // Status bar - LLPanel* status_bar_container = getRootView()->getChild("status_bar_container"); - gStatusBar = new LLStatusBar(status_bar_container->getLocalRect()); - gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_RIGHT); - gStatusBar->setShape(status_bar_container->getLocalRect()); - // sync bg color with menu bar - gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() ); - // add InBack so that gStatusBar won't be drawn over menu - status_bar_container->addChildInBack(gStatusBar, 2/*tab order, after menu*/); - status_bar_container->setVisible(TRUE); - - // Navigation bar - LLView* nav_bar_container = getRootView()->getChild("nav_bar_container"); - - LLNavigationBar* navbar = LLNavigationBar::getInstance(); - navbar->setShape(nav_bar_container->getLocalRect()); - navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); - nav_bar_container->addChild(navbar); - nav_bar_container->setVisible(TRUE); - + LLNavigationBar* navbar = LLNavigationBar::getInstance(); + if (!gStatusBar) + { + // Status bar + LLPanel* status_bar_container = getRootView()->getChild("status_bar_container"); + gStatusBar = new LLStatusBar(status_bar_container->getLocalRect()); + gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_RIGHT); + gStatusBar->setShape(status_bar_container->getLocalRect()); + // sync bg color with menu bar + gStatusBar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); + // add InBack so that gStatusBar won't be drawn over menu + status_bar_container->addChildInBack(gStatusBar, 2/*tab order, after menu*/); + status_bar_container->setVisible(TRUE); + + // Navigation bar + LLView* nav_bar_container = getRootView()->getChild("nav_bar_container"); + + navbar->setShape(nav_bar_container->getLocalRect()); + navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); + nav_bar_container->addChild(navbar); + nav_bar_container->setVisible(TRUE); + } + else + { + LLPanel* status_bar_container = getRootView()->getChild("status_bar_container"); + LLView* nav_bar_container = getRootView()->getChild("nav_bar_container"); + status_bar_container->setVisible(TRUE); + nav_bar_container->setVisible(TRUE); + } - if (!gSavedSettings.getBOOL("ShowNavbarNavigationPanel")) - { - navbar->setVisible(FALSE); - } + if (!gSavedSettings.getBOOL("ShowNavbarNavigationPanel")) + { + navbar->setVisible(FALSE); + } else { reshapeStatusBarContainer(); @@ -6041,6 +6050,21 @@ void LLViewerWindow::reshapeStatusBarContainer() } status_bar_container->reshape(new_width, new_height, TRUE); } + +void LLViewerWindow::resetStatusBarContainer() +{ + LLNavigationBar* navbar = LLNavigationBar::getInstance(); + if (gSavedSettings.getBOOL("ShowNavbarNavigationPanel") || navbar->getVisible()) + { + // was previously showing navigation bar + LLView* nav_bar_container = getRootView()->getChild("nav_bar_container"); + LLPanel* status_bar_container = getRootView()->getChild("status_bar_container"); + S32 new_height = status_bar_container->getRect().getHeight(); + S32 new_width = status_bar_container->getRect().getWidth(); + new_height -= nav_bar_container->getRect().getHeight(); + status_bar_container->reshape(new_width, new_height, TRUE); + } +} //---------------------------------------------------------------------------- diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index ccef006a07..96c5c3115a 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -182,6 +182,7 @@ public: void handlePieMenu(S32 x, S32 y, MASK mask); void reshapeStatusBarContainer(); + void resetStatusBarContainer(); // undo changes done by resetStatusBarContainer on initWorldUI() BOOL handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down, bool &is_toolmgr_action); -- cgit v1.2.3 From 403af426cc14659bc2477bb56809b385c12c00a4 Mon Sep 17 00:00:00 2001 From: Pantera Date: Tue, 13 Feb 2024 10:25:47 +0100 Subject: Removing orphaned XML files from translation directories Spring cleanup --- .../xui/de/floater_texture_fetch_debugger.xml | 77 ---------------------- .../xui/es/floater_texture_fetch_debugger.xml | 77 ---------------------- .../xui/fr/floater_texture_fetch_debugger.xml | 77 ---------------------- .../xui/it/floater_texture_fetch_debugger.xml | 77 ---------------------- .../xui/ja/floater_outfit_photo_preview.xml | 18 ----- .../xui/ja/floater_simple_outfit_snapshot.xml | 7 -- .../xui/ja/floater_texture_fetch_debugger.xml | 77 ---------------------- .../default/xui/ja/panel_preferences_grids.xml | 21 ------ .../xui/pl/floater_outfit_photo_preview.xml | 13 ---- .../xui/pl/floater_simple_outfit_snapshot.xml | 6 -- .../xui/pl/floater_texture_fetch_debugger.xml | 73 -------------------- .../xui/pt/floater_texture_fetch_debugger.xml | 77 ---------------------- .../xui/ru/floater_texture_fetch_debugger.xml | 77 ---------------------- .../xui/tr/floater_texture_fetch_debugger.xml | 77 ---------------------- .../xui/zh/floater_texture_fetch_debugger.xml | 77 ---------------------- 15 files changed, 831 deletions(-) delete mode 100644 indra/newview/skins/default/xui/de/floater_texture_fetch_debugger.xml delete mode 100644 indra/newview/skins/default/xui/es/floater_texture_fetch_debugger.xml delete mode 100644 indra/newview/skins/default/xui/fr/floater_texture_fetch_debugger.xml delete mode 100644 indra/newview/skins/default/xui/it/floater_texture_fetch_debugger.xml delete mode 100644 indra/newview/skins/default/xui/ja/floater_outfit_photo_preview.xml delete mode 100644 indra/newview/skins/default/xui/ja/floater_simple_outfit_snapshot.xml delete mode 100644 indra/newview/skins/default/xui/ja/floater_texture_fetch_debugger.xml delete mode 100644 indra/newview/skins/default/xui/ja/panel_preferences_grids.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_outfit_photo_preview.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_simple_outfit_snapshot.xml delete mode 100644 indra/newview/skins/default/xui/pl/floater_texture_fetch_debugger.xml delete mode 100644 indra/newview/skins/default/xui/pt/floater_texture_fetch_debugger.xml delete mode 100644 indra/newview/skins/default/xui/ru/floater_texture_fetch_debugger.xml delete mode 100644 indra/newview/skins/default/xui/tr/floater_texture_fetch_debugger.xml delete mode 100644 indra/newview/skins/default/xui/zh/floater_texture_fetch_debugger.xml (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/de/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/de/floater_texture_fetch_debugger.xml deleted file mode 100644 index 97b0364832..0000000000 --- a/indra/newview/skins/default/xui/de/floater_texture_fetch_debugger.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - 1, Gesamtzahl abgerufener Texturen: [NUM] - - - 2, Gesamtzahl von Abrufanforderungen: [NUM] - - - 3, Gesamtzahl von Cachetreffern: [NUM] - - - 4, Gesamtzahl sichtbarer Texturen: [NUM] - - - 5, Gesamtzahl von Abrufanforderungen für sichtbare Texturen: [NUM] - - - 6, Gesamtmenge abgerufener Daten: [SIZE1] KB, decodierte Daten: [SIZE2] KB, [PIXEL] MPixel - - - 7, Gesamtmenge sichtbarer Daten: [SIZE1] KB, decodierte Daten: [SIZE2] KB - - - 8, Gesamtmenge dargestellter Daten: [SIZE1] KB, decodierte Daten: [SIZE2] KB, [PIXEL] MPixel - - - 9, Gesamtzeit Cache-Lesezugriffe: [TIME] s - - - 10, Gesamtzeit Cache-Schreibzugriffe: [TIME] s - - - 11, Gesamtzeit Decodierung: [TIME] s - - - 12, Gesamtzeit GL-Texturerstellung: [TIME] s - - - 13, Gesamtzeit HTTP-Abrufe: [TIME] s - - - 14, Gesamtzeit für alle Abrufe: [TIME] s - - - 15, Neuabruf sichtbarer Texturen aus Cache, Zeit: [TIME] s, Abrufmenge: [SIZE2] KB, [PIXEL] MPixel - - - 16, Neuabruf aller Texturen aus Cache, Zeit: [TIME] s, Abrufmenge: [SIZE2] KB, [PIXEL] MPixel - - - 17, Neuabruf sichtbarer Texturen von HTTP, Zeit: [TIME] s, Abrufmenge: [SIZE2] KB, [PIXEL] MPixel - - - 18, Neuabruf aller Texturen von HTTP, Zeit: [TIME] s, Abrufmenge: [SIZE2] KB, [PIXEL] MPixel - - - - 20, Texturquelle: - - - - - - - - + top_pad="3" + name="AvatarComplexityModeLabel" + text_readonly_color="LabelDisabledColor" + width="128"> + Detail Mode: + + + + + + + + + Avatar Detail Mode: + + + + + + [https://community.secondlife.com/t5/Featured-News/Why-are-all-these-people-made-of-colored-jelly/ba-p/3031255 What's this?] - - -