Merge branch 'master' into DRTVWR-482

master
Andrey Lihatskiy 2020-02-22 18:51:29 +02:00
commit 75bd1bcd12
26 changed files with 219 additions and 88 deletions

View File

@ -1 +1 @@
6.3.7
6.3.8

View File

@ -29,8 +29,10 @@
#include "llaudiosourcevo.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llmutelist.h"
#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
LLAudioSourceVO::LLAudioSourceVO(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, LLViewerObject *objectp)
@ -54,6 +56,79 @@ void LLAudioSourceVO::setGain(const F32 gain)
mGain = llclamp(gain, 0.f, 1.f);
}
void LLAudioSourceVO::checkCutOffRadius()
{
if (mSourceMuted // already muted by something, will be recalculated on update()
|| !mObjectp)
{
return;
}
F32 cutoff = mObjectp->getSoundCutOffRadius();
if (cutoff < 0.1f)
{
// consider cutoff below 0.1m as off (to avoid near zero comparison)
return;
}
LLVector3d pos_global = getPosGlobal();
if (!isInCutOffRadius(pos_global, cutoff))
{
mSourceMuted = true;
}
}
LLVector3d LLAudioSourceVO::getPosGlobal() const
{
if (mObjectp->isAttachment())
{
LLViewerObject* parent = mObjectp;
while (parent && !parent->isAvatar())
{
parent = (LLViewerObject*)parent->getParent();
}
if (parent)
{
return parent->getPositionGlobal();
}
}
else
{
return mObjectp->getPositionGlobal();
}
return LLVector3d();
}
bool LLAudioSourceVO::isInCutOffRadius(const LLVector3d pos_global, const F32 cutoff) const
{
static LLCachedControl<S32> ear_mode(gSavedSettings, "VoiceEarLocation", 0);
LLVector3d pos_ear;
switch (ear_mode())
{
case 0: // camera
pos_ear = gAgentCamera.getCameraPositionGlobal();
break;
case 1: // avatar
case 2:
// voice support 'mixed' in '2' case with agent's position and camera's rotations
// but it is not defined in settings and uses camera as default
pos_ear = gAgent.getPositionGlobal();
break;
default:
pos_ear = gAgentCamera.getCameraPositionGlobal();
break;
}
LLVector3d to_vec = pos_global - pos_ear;
F32 dist = (F32)to_vec.magVec();
return dist < cutoff;
}
void LLAudioSourceVO::updateMute()
{
if (!mObjectp || mObjectp->isDead())
@ -63,26 +138,11 @@ void LLAudioSourceVO::updateMute()
}
bool mute = false;
LLVector3d pos_global;
LLVector3d pos_global = getPosGlobal();
if (mObjectp->isAttachment())
{
LLViewerObject* parent = mObjectp;
while (parent && !parent->isAvatar())
{
parent = (LLViewerObject*)parent->getParent();
}
if (parent)
{
pos_global = parent->getPositionGlobal();
}
}
else
{
pos_global = mObjectp->getPositionGlobal();
}
if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global))
F32 cutoff = mObjectp->getSoundCutOffRadius();
if ((cutoff > 0.1f && !isInCutOffRadius(pos_global, cutoff)) // consider cutoff below 0.1m as off
|| !LLViewerParcelMgr::getInstance()->canHearSound(pos_global))
{
mute = true;
}

View File

@ -41,7 +41,11 @@ public:
/*virtual*/ void update();
/*virtual*/ void setGain(const F32 gain);
void checkCutOffRadius();
private:
LLVector3d getPosGlobal() const;
bool isInCutOffRadius(LLVector3d pos_global, const F32 cutoff) const;
void updateMute();
private:

View File

@ -175,7 +175,7 @@ BOOL LLConversationViewSession::postBuild()
LLAvatarIconCtrl* icon = mItemPanel->getChild<LLAvatarIconCtrl>("avatar_icon");
icon->setVisible(true);
icon->setValue(session->mOtherParticipantID);
mSpeakingIndicator->setSpeakerId(gAgentID, session->mSessionID, true);
mSpeakingIndicator->setSpeakerId(session->mOtherParticipantID, session->mSessionID, true);
mHasArrow = false;
}
break;

View File

@ -471,7 +471,7 @@ void LLFloaterModelPreview::initModelPreview()
mModelPreview = new LLModelPreview(tex_width, tex_height, this);
mModelPreview->setPreviewTarget(16.f);
mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5));
mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1));
mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::modelUpdated, this, _1));
}
void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl)
@ -568,7 +568,15 @@ void LLFloaterModelPreview::onClickCalculateBtn()
bool upload_joint_positions = childGetValue("upload_joints").asBoolean();
bool lock_scale_if_joint_position = childGetValue("lock_scale_if_joint_position").asBoolean();
mUploadModelUrl.clear();
if (upload_joint_positions)
{
// Diagnostic message showing list of joints for which joint offsets are defined.
// FIXME - given time, would be much better to put this in the UI, in updateStatusMessages().
mModelPreview->getPreviewAvatar()->showAttachmentOverrides();
}
mUploadModelUrl.clear();
mModelPhysicsFee.clear();
gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
childGetValue("upload_textures").asBoolean(),
@ -4992,6 +5000,17 @@ void LLFloaterModelPreview::setStatusMessage(const std::string& msg)
mStatusMessage = msg;
}
void LLFloaterModelPreview::toggleCalculateButton()
{
toggleCalculateButton(true);
}
void LLFloaterModelPreview::modelUpdated(bool calculate_visible)
{
mModelPhysicsFee.clear();
toggleCalculateButton(calculate_visible);
}
void LLFloaterModelPreview::toggleCalculateButton(bool visible)
{
mCalculateBtn->setVisible(visible);
@ -5017,7 +5036,10 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
childSetTextArg("download_weight", "[ST]", tbd);
childSetTextArg("server_weight", "[SIM]", tbd);
childSetTextArg("physics_weight", "[PH]", tbd);
childSetTextArg("upload_fee", "[FEE]", tbd);
if (!mModelPhysicsFee.isMap() || mModelPhysicsFee.emptyMap())
{
childSetTextArg("upload_fee", "[FEE]", tbd);
}
std::string dashes = hasString("--") ? getString("--") : "--";
childSetTextArg("price_breakdown", "[STREAMING]", dashes);
childSetTextArg("price_breakdown", "[PHYSICS]", dashes);
@ -5129,7 +5151,7 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived()
mUploadBtn->setEnabled(isModelUploadAllowed());
}
void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason)
void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result)
{
std::ostringstream out;
out << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status;
@ -5137,6 +5159,17 @@ void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std:
LL_WARNS() << out.str() << LL_ENDL;
LLFloaterModelPreview::addStringToLog(out, false);
doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true));
if (result.has("upload_price"))
{
mModelPhysicsFee = result;
childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger()));
childSetVisible("upload_fee", true);
}
else
{
mModelPhysicsFee.clear();
}
}
/*virtual*/

View File

@ -146,7 +146,7 @@ public:
/*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
void handleModelPhysicsFeeReceived();
/*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason);
/*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result);
/*virtual*/ void onModelUploadSuccess();
@ -232,6 +232,8 @@ private:
void onLoDSourceCommit(S32 lod);
void modelUpdated(bool calculate_visible);
// Toggles between "Calculate weights & fee" and "Upload" buttons.
void toggleCalculateButton(bool visible);

View File

@ -45,7 +45,7 @@ public:
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
virtual void onModelUploadSuccess() {};

View File

@ -62,6 +62,8 @@
#pragma warning (disable:4702)
#endif
extern void on_new_message(const LLSD& msg);
// Strip out "Resident" for display, but only if the message came from a user
// (rather than a script)
static std::string clean_name_from_im(const std::string& name, EInstantMessage type)
@ -1028,6 +1030,14 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
}
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
if (message != "")
{
LLSD msg_notify;
msg_notify["session_id"] = LLUUID();
msg_notify["from_id"] = chat.mFromID;
msg_notify["source_type"] = chat.mSourceType;
on_new_message(msg_notify);
}
}
@ -1559,6 +1569,12 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
return;
}
if (gAgent.getRegion() == NULL)
{
LL_WARNS("Messaging") << "Region null while attempting to load messages." << LL_ENDL;
return;
}
LL_INFOS("Messaging") << "Processing offline messages." << LL_ENDL;
std::vector<U8> data;

View File

@ -2270,7 +2270,7 @@ public:
// Can be destroyed (or moved to trash)
BOOL LLFolderBridge::isItemRemovable() const
{
if (!get_is_category_removable(getInventoryModel(), mUUID) || isMarketplaceListingsFolder())
if (!get_is_category_removable(getInventoryModel(), mUUID))
{
return FALSE;
}
@ -2287,6 +2287,11 @@ BOOL LLFolderBridge::isItemRemovable() const
}
}
if (isMarketplaceListingsFolder() && (!LLMarketplaceData::instance().isSLMDataFetched() || LLMarketplaceData::instance().getActivationState(mUUID)))
{
return FALSE;
}
return TRUE;
}

View File

@ -1100,9 +1100,7 @@ void LLLocationInputCtrl::changeLocationPresentation()
//change location presentation only if user does not select/paste anything and
//human-readable region name is being displayed
std::string text = mTextEntry->getText();
LLStringUtil::trim(text);
if(!mTextEntry->hasSelection() && text == mHumanReadableLocation)
if(!mTextEntry->hasSelection() && mTextEntry->getText() == mHumanReadableLocation)
{
//needs unescaped one
LLSLURL slurl;

View File

@ -1294,6 +1294,11 @@ void LLMarketplaceData::setSLMDataFetched(U32 status)
}
}
bool LLMarketplaceData::isSLMDataFetched()
{
return mMarketPlaceDataFetched == MarketplaceFetchCodes::MARKET_FETCH_DONE;
}
// Creation / Deletion / Update
// Methods publicly called
bool LLMarketplaceData::createListing(const LLUUID& folder_id)

View File

@ -204,7 +204,9 @@ public:
void setDataFetchedSignal(const status_updated_signal_t::slot_type& cb);
void setSLMDataFetched(U32 status);
U32 getSLMDataFetched() { return mMarketPlaceDataFetched; }
bool isSLMDataFetched();
// High level create/delete/set Marketplace data: each method returns true if the function succeeds, false if error
bool createListing(const LLUUID& folder_id);
bool activateListing(const LLUUID& folder_id, bool activate, S32 depth = -1);

View File

@ -2772,7 +2772,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
if (observer)
{
observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
}
}
else
@ -2805,7 +2805,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
if (observer)
{
observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
}
}
}

View File

@ -354,7 +354,7 @@ void LLNetMap::draw()
LLColor4 color = show_as_friend ? map_avatar_friend_color : map_avatar_color;
unknown_relative_z = positions[i].mdV[VZ] == COARSEUPDATE_MAX_Z &&
unknown_relative_z = positions[i].mdV[VZ] >= COARSEUPDATE_MAX_Z &&
camera_position.mV[VZ] >= COARSEUPDATE_MAX_Z;
LLWorldMapView::drawAvatar(

View File

@ -245,11 +245,11 @@ void LLOutputMonitorCtrl::draw()
// virtual
BOOL LLOutputMonitorCtrl::handleMouseUp(S32 x, S32 y, MASK mask)
{
if (mSpeakerId != gAgentID && !mShowParticipantsSpeaking)
if (mSpeakerId != gAgentID)
{
LLFloaterReg::showInstance("floater_voice_volume", LLSD().with("avatar_id", mSpeakerId));
}
else if(mShowParticipantsSpeaking)
else if (mShowParticipantsSpeaking)
{
LLFloaterReg::showInstance("chat_voice", LLSD());
}

View File

@ -1230,6 +1230,8 @@ void LLPanelLogin::updateLoginButtons()
if (user_combo->getCurrentIndex() != -1)
{
remember_name->setValue(true);
LLCheckBoxCtrl* remember_pass = getChild<LLCheckBoxCtrl>("remember_password");
remember_pass->setEnabled(TRUE);
} // Note: might be good idea to do "else remember_name->setValue(mRememberedState)" but it might behave 'weird' to user
}
}
@ -1239,6 +1241,8 @@ void LLPanelLogin::populateUserList(LLPointer<LLCredential> credential)
LLComboBox* user_combo = getChild<LLComboBox>("username_combo");
user_combo->removeall();
user_combo->clear();
user_combo->setValue(std::string());
getChild<LLUICtrl>("password_edit")->setValue(std::string());
mUsernameLength = 0;
mPasswordLength = 0;
@ -1261,9 +1265,7 @@ void LLPanelLogin::populateUserList(LLPointer<LLCredential> credential)
if (credential.isNull() || !user_combo->setSelectedByValue(LLSD(credential->userID()), true))
{
// selection failed, just deselect whatever might be selected
user_combo->setValue(std::string());
getChild<LLUICtrl>("password_edit")->setValue(std::string());
// selection failed, fields will be mepty
updateLoginButtons();
}
else
@ -1278,7 +1280,8 @@ void LLPanelLogin::populateUserList(LLPointer<LLCredential> credential)
const LLSD &ident = credential->getIdentifier();
if (ident.isMap() && ident.has("type"))
{
user_combo->add(LLPanelLogin::getUserName(credential), credential->userID(), ADD_BOTTOM, TRUE);
// this llsd might hold invalid credencial (failed login), so
// do not add to the list, just set field.
setFields(credential);
}
else

View File

@ -82,8 +82,11 @@
#include <boost/bind.hpp>
// "Features" Tab
const F32 DEFAULT_GRAVITY_MULTIPLIER = 1.f;
const F32 DEFAULT_DENSITY = 1000.f;
// "Features" Tab
BOOL LLPanelVolume::postBuild()
{
// Flexible Objects Parameters
@ -830,7 +833,7 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data)
// static
void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
{
//LLPanelObject* self = (LLPanelObject*) userdata;
LLPanelVolume* self = (LLPanelVolume*)userdata;
LLComboBox* box = (LLComboBox*) ctrl;
if (box)
@ -841,6 +844,19 @@ void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
if (material_name != LEGACY_FULLBRIGHT_DESC)
{
U8 material_code = LLMaterialTable::basic.getMCode(material_name);
if (self)
{
LLViewerObject* objectp = self->mObject;
if (objectp)
{
objectp->setPhysicsGravity(DEFAULT_GRAVITY_MULTIPLIER);
objectp->setPhysicsFriction(LLMaterialTable::basic.getFriction(material_code));
//currently density is always set to 1000 serverside regardless of chosen material,
//actual material density should be used here, if this behavior change
objectp->setPhysicsDensity(DEFAULT_DENSITY);
objectp->setPhysicsRestitution(LLMaterialTable::basic.getRestitution(material_code));
}
}
LLSelectMgr::getInstance()->selectionSetMaterial(material_code);
}
}

View File

@ -367,6 +367,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
previewEditor->makePristine();
BOOL modifiable = preview->canModify(preview->mObjectID, preview->getItem());
preview->setEnabled(modifiable);
preview->syncExternal();
preview->mAssetStatus = PREVIEW_ASSET_LOADED;
}
else
@ -503,10 +504,6 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem, bool sync)
}
editor->makePristine();
if (sync)
{
syncExternal();
}
const LLInventoryItem* item = getItem();
// save it out to database
if (item)
@ -755,6 +752,7 @@ void LLPreviewNotecard::openInExternalEditor()
// Start watching file changes.
mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLPreviewNotecard::onExternalChange, this, _1));
mLiveFile->ignoreNextUpdate();
mLiveFile->addToEventTimer();
// Open it in external editor.

View File

@ -63,6 +63,7 @@ F32 SHINE_WIDTH = 0.6f;
F32 SHINE_OPACITY = 0.3f;
F32 FALL_TIME = 0.6f;
S32 BORDER_WIDTH = 6;
S32 TOP_PANEL_HEIGHT = 30;
const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
@ -293,8 +294,8 @@ void LLSnapshotLivePreview::draw()
F32 uv_width = isImageScaled() ? 1.f : llmin((F32)getWidth() / (F32)getCurrentImage()->getWidth(), 1.f);
F32 uv_height = isImageScaled() ? 1.f : llmin((F32)getHeight() / (F32)getCurrentImage()->getHeight(), 1.f);
gGL.pushMatrix();
{
gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f);
{
gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom + TOP_PANEL_HEIGHT, 0.f);
gGL.begin(LLRender::QUADS);
{
gGL.texCoord2f(uv_width, uv_height);
@ -346,14 +347,15 @@ void LLSnapshotLivePreview::draw()
F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME);
// draw "shine" effect
LLLocalClipRect clip(getLocalRect());
LLRect local_rect(0, getRect().getHeight() + TOP_PANEL_HEIGHT, getRect().getWidth(), 0);
LLLocalClipRect clip(local_rect);
{
// draw diagonal stripe with gradient that passes over screen
S32 x1 = gViewerWindow->getWindowWidthScaled() * ll_round((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
S32 x2 = x1 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
S32 x3 = x2 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
S32 y1 = 0;
S32 y2 = gViewerWindow->getWindowHeightScaled();
S32 y2 = gViewerWindow->getWindowHeightScaled() + TOP_PANEL_HEIGHT;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.begin(LLRender::QUADS);
@ -383,36 +385,6 @@ void LLSnapshotLivePreview::draw()
}
}
// draw framing rectangle
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4f(1.f, 1.f, 1.f, 1.f);
const LLRect& outline_rect = getImageRect();
gGL.begin(LLRender::QUADS);
{
gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop);
gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom);
gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom);
gGL.vertex2i(outline_rect.mRight, outline_rect.mTop);
gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH);
gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH);
}
gGL.end();
}
// draw old image dropping away
if (mFallAnimTimer.getStarted())
{

View File

@ -53,7 +53,7 @@ public:
virtual ~LLWholeModelFeeObserver() {}
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }

View File

@ -374,6 +374,11 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_
LL_INFOS("Messaging") << "give_money(" << uuid << "," << amount << ")"<< LL_ENDL;
if(can_afford_transaction(amount))
{
if (uuid.isNull())
{
LL_WARNS() << "Failed to send L$ gift to to Null UUID." << LL_ENDL;
return;
}
// gStatusBar->debitBalance(amount);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_MoneyTransferRequest);

View File

@ -268,6 +268,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mData(NULL),
mAudioSourcep(NULL),
mAudioGain(1.f),
mSoundCutOffRadius(0.f),
mAppAngle(0.f),
mPixelArea(1024.f),
mInventory(NULL),
@ -1245,6 +1246,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
LLUUID audio_uuid;
LLUUID owner_id; // only valid if audio_uuid or particle system is not null
F32 gain;
F32 cutoff;
U8 sound_flags;
mesgsys->getU32Fast( _PREHASH_ObjectData, _PREHASH_CRC, crc, block_num);
@ -1253,6 +1255,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// HACK: Owner id only valid if non-null sound id or particle system
mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, owner_id, block_num );
mesgsys->getF32Fast( _PREHASH_ObjectData, _PREHASH_Gain, gain, block_num );
mesgsys->getF32Fast( _PREHASH_ObjectData, _PREHASH_Radius, cutoff, block_num );
mesgsys->getU8Fast( _PREHASH_ObjectData, _PREHASH_Flags, sound_flags, block_num );
mesgsys->getU8Fast( _PREHASH_ObjectData, _PREHASH_Material, material, block_num );
mesgsys->getU8Fast( _PREHASH_ObjectData, _PREHASH_ClickAction, click_action, block_num);
@ -1261,6 +1264,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_ObjectData, data, length, block_num, MAX_OBJECT_BINARY_DATA_SIZE);
mTotalCRC = crc;
mSoundCutOffRadius = cutoff;
// Owner ID used for sound muting or particle system muting
setAttachedSound(audio_uuid, owner_id, gain, sound_flags);
@ -1957,6 +1961,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
}
mTotalCRC = crc;
mSoundCutOffRadius = cutoff;
setAttachedSound(sound_uuid, owner_id, gain, sound_flags);
@ -5913,6 +5918,8 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
if( gAgent.canAccessMaturityAtGlobal(this->getPositionGlobal()) )
{
//LL_INFOS() << "Playing attached sound " << audio_uuid << LL_ENDL;
// recheck cutoff radius in case this update was an object-update with new value
mAudioSourcep->checkCutOffRadius();
mAudioSourcep->play(audio_uuid);
}
}

View File

@ -403,6 +403,7 @@ public:
// Owner id is this object's owner
void setAttachedSound(const LLUUID &audio_uuid, const LLUUID& owner_id, const F32 gain, const U8 flags);
void adjustAudioGain(const F32 gain);
F32 getSoundCutOffRadius() const { return mSoundCutOffRadius; }
void clearAttachedSound() { mAudioSourcep = NULL; }
// Create if necessary
@ -790,6 +791,7 @@ protected:
LLPointer<LLViewerPartSourceScript> mPartSourcep; // Particle source associated with this object.
LLAudioSourceVO* mAudioSourcep;
F32 mAudioGain;
F32 mSoundCutOffRadius;
F32 mAppAngle; // Apparent visual arc in degrees
F32 mPixelArea; // Apparent area in pixels

View File

@ -4717,7 +4717,8 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
if ((image_width <= gGLManager.mGLMaxTextureSize && image_height <= gGLManager.mGLMaxTextureSize) &&
(image_width > window_width || image_height > window_height) && LLPipeline::sRenderDeferred && !show_ui)
{
if (scratch_space.allocate(image_width, image_height, GL_DEPTH_COMPONENT, true, true))
U32 color_fmt = type == LLSnapshotModel::SNAPSHOT_TYPE_DEPTH ? GL_DEPTH_COMPONENT : GL_RGBA;
if (scratch_space.allocate(image_width, image_height, color_fmt, true, true))
{
original_width = gPipeline.mDeferredScreen.getWidth();
original_height = gPipeline.mDeferredScreen.getHeight();

View File

@ -2045,8 +2045,10 @@ void LLVOAvatar::resetSkeleton(bool reset_animations)
LL_ERRS() << "Error resetting skeleton" << LL_ENDL;
}
// Reset attachment points (buildSkeleton only does bones and CVs)
bool ignore_hud_joints = true;
// Reset attachment points
// BuildSkeleton only does bones and CVs but we still need to reinit huds
// since huds can be animated.
bool ignore_hud_joints = !isSelf();
initAttachmentPoints(ignore_hud_joints);
// Fix up collision volumes
@ -6576,7 +6578,7 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints)
LLAvatarXmlInfo::LLAvatarAttachmentInfo *info = *iter;
if (info->mIsHUDAttachment && (!isSelf() || ignore_hud_joints))
{
//don't process hud joint for other avatars, or when doing a skeleton reset.
//don't process hud joint for other avatars.
continue;
}
@ -10335,7 +10337,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
// Diagnostic list of all textures on our avatar
static std::set<LLUUID> all_textures;
if (mVisualComplexityStale)
if (mVisualComplexityStale)
{
U32 cost = VISUAL_COMPLEXITY_UNKNOWN;
LLVOVolume::texture_cost_t textures;

View File

@ -1154,7 +1154,7 @@ void LLWorldMapView::drawAvatar(F32 x_pixels,
{
const F32 HEIGHT_THRESHOLD = 7.f;
LLUIImagePtr dot_image = sAvatarLevelImage;
if (unknown_relative_z)
if (unknown_relative_z && llabs(relative_z) > HEIGHT_THRESHOLD)
{
dot_image = sAvatarUnknownImage;
}