Merge viewer-neko

master
Ansariel 2017-12-20 23:07:38 +01:00
commit e41bdfc820
30 changed files with 354 additions and 183 deletions

View File

@ -106,16 +106,10 @@ LLMaterial::LLMaterial()
, mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY)
, mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
, mAlphaMaskCutoff(0)
, mIsDiffuseAlphaInvalid(false)
, mIsNormalInvalid(false)
, mIsSpecularInvalid(false)
{
}
LLMaterial::LLMaterial(const LLSD& material_data)
: mIsDiffuseAlphaInvalid(false)
, mIsNormalInvalid(false)
, mIsSpecularInvalid(false)
{
fromLLSD(material_data);
}
@ -205,17 +199,13 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode)
{
ret = getDiffuseAlphaMode();
}
if (mIsDiffuseAlphaInvalid && ret != DIFFUSE_ALPHA_MODE_DEFAULT)
{
ret = alpha_mode != DIFFUSE_ALPHA_MODE_NONE;
}
llassert(ret < SHADER_COUNT);
//next bit is whether or not specular map is present
const U32 SPEC_BIT = 0x4;
if (getSpecularID().notNull() && !mIsSpecularInvalid)
if (getSpecularID().notNull())
{
ret |= SPEC_BIT;
}
@ -224,7 +214,7 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode)
//next bit is whether or not normal map is present
const U32 NORM_BIT = 0x8;
if (getNormalID().notNull() && !mIsNormalInvalid)
if (getNormalID().notNull())
{
ret |= NORM_BIT;
}

View File

@ -120,13 +120,6 @@ public:
void setAlphaMaskCutoff(U8 cutoff) { mAlphaMaskCutoff = cutoff; }
bool isNull() const;
bool isDiffuseAlphaInvalid() const { return mIsDiffuseAlphaInvalid; }
void setDiffuseAlphaInvalid(bool is_invalid) { mIsDiffuseAlphaInvalid = is_invalid; }
bool isNormalInvalid() const { return mIsNormalInvalid; }
void setNormalInvalid(bool is_invalid) { mIsNormalInvalid = is_invalid; }
bool isSpecularInvalid() const { return mIsSpecularInvalid; }
void setSpecularInvalid(bool is_invalid) { mIsSpecularInvalid = is_invalid; }
static const LLMaterial null;
bool operator == (const LLMaterial& rhs) const;
@ -154,10 +147,6 @@ protected:
U8 mEnvironmentIntensity;
U8 mDiffuseAlphaMode;
U8 mAlphaMaskCutoff;
bool mIsDiffuseAlphaInvalid;
bool mIsNormalInvalid;
bool mIsSpecularInvalid;
};
typedef LLPointer<LLMaterial> LLMaterialPtr;

View File

@ -1213,10 +1213,12 @@ LLVertexBuffer::~LLVertexBuffer()
if (mFence)
{
// Sanity check. We have weird crashes in this destructor (on delete). Yet mFence is disabled.
// TODO: mFence was added in scope of SH-2038, but was never enabled, consider removing mFence.
LL_ERRS() << "LLVertexBuffer destruction failed" << LL_ENDL;
delete mFence;
mFence = NULL;
}
mFence = NULL;
sVertexCount -= mNumVerts;
sIndexCount -= mNumIndices;

View File

@ -265,27 +265,28 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
S32 chars_in_line = mMsgText->getRect().getWidth() / messageFont->getWidth("c");
S32 max_lines = notification["available_height"].asInteger() / (mMsgText->getTextPixelHeight() + 4);
S32 new_line_chars = std::count(messageText.begin(), messageText.end(), '\n');
S32 lines_count = (messageText.size() - new_line_chars) / chars_in_line + new_line_chars + 1;
int lines = 0;
int chars = 0;
//Remove excessive chars if message is not fit in available height. MAINT-6891
if(lines_count > max_lines)
//Remove excessive chars if message does not fit in available height. MAINT-6891
std::string::iterator it;
for (it = messageText.begin(); it < messageText.end() && lines < max_lines; it++)
{
while(lines_count > max_lines)
if (*it == '\n')
++lines;
else
++chars;
if (chars >= chars_in_line)
{
std::size_t nl_pos = messageText.rfind('\n');
if (nl_pos != std::string::npos)
{
nl_pos = nl_pos > messageText.length() - chars_in_line? nl_pos : messageText.length() - chars_in_line;
messageText.erase(messageText.begin() + nl_pos, messageText.end());
}
else
{
messageText.erase(messageText.end() - chars_in_line, messageText.end());
}
new_line_chars = std::count(messageText.begin(), messageText.end(), '\n');
lines_count = (messageText.size() - new_line_chars) / chars_in_line + new_line_chars;
chars = 0;
++lines;
}
}
if (it < messageText.end())
{
messageText.erase(it, messageText.end());
messageText += " ...";
}

View File

@ -1981,7 +1981,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
F32 env = mat->getEnvironmentIntensity()/255.f;
if (mat->getSpecularID().isNull() || mat->isSpecularInvalid())
if (mat->getSpecularID().isNull())
{
env = te->getShiny()*0.25f;
col.set(env,env,env,0);
@ -1994,7 +1994,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
sVertexProgram->uniform4f(LLShaderMgr::SPECULAR_COLOR, col.mV[0], col.mV[1], col.mV[2], spec);
sVertexProgram->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, env);
if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && !mat->isDiffuseAlphaInvalid())
if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
{
sVertexProgram->setMinimumAlpha(mat->getAlphaMaskCutoff()/255.f);
}

View File

@ -1132,7 +1132,7 @@ bool LLFace::canRenderAsMask()
}
LLMaterial* mat = te->getMaterialParams();
if (mat && !mat->isDiffuseAlphaInvalid() && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
{
return false;
}
@ -1392,14 +1392,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (LLPipeline::sRenderDeferred)
{ //store shiny in alpha if we don't have a specular map
if (!mat || mat->getSpecularID().isNull() || mat->isSpecularInvalid())
if (!mat || mat->getSpecularID().isNull())
{
shiny_in_alpha = true;
}
}
else
{
if (!mat || mat->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK || mat->isDiffuseAlphaInvalid())
if (!mat || mat->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
{
shiny_in_alpha = true;
}
@ -1899,7 +1899,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
std::vector<LLVector2> bump_tc;
if (mat && !(mat->getNormalID().isNull() || mat->isNormalInvalid()))
if (mat && !mat->getNormalID().isNull())
{ //writing out normal and specular texture coordinates, not bump offsets
do_bump = false;
}

View File

@ -171,8 +171,12 @@ void LLFloaterMediaSettings::onClose(bool app_quitting)
void LLFloaterMediaSettings::initValues( const LLSD& media_settings, bool editable )
{
if (sInstance->hasFocus()) return;
sInstance->clearValues(editable);
// Clear values
sInstance->mPanelMediaSettingsGeneral->clearValues(sInstance->mPanelMediaSettingsGeneral, editable, false /*don't update preview*/);
sInstance->mPanelMediaSettingsSecurity->clearValues(sInstance->mPanelMediaSettingsSecurity, editable);
sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions, editable);
// update all panels with values from simulator
sInstance->mPanelMediaSettingsGeneral->
initValues( sInstance->mPanelMediaSettingsGeneral, media_settings, editable );

View File

@ -1566,7 +1566,6 @@ void LLFloaterTools::getMediaState()
std::string multi_media_info_str = LLTrans::getString("Multiple Media");
std::string media_title = "";
mNeedMediaTitle = false;
// update UI depending on whether "object" (prim or face) has media
// and whether or not you are allowed to edit it.
@ -1584,17 +1583,12 @@ void LLFloaterTools::getMediaState()
{
// initial media title is the media URL (until we get the name)
media_title = media_data_get.getHomeURL();
// kick off a navigate and flag that we need to update the title
navigateToTitleMedia( media_data_get.getHomeURL() );
mNeedMediaTitle = true;
}
// else all faces might be empty.
}
else // there' re Different Medias' been set on on the faces.
{
media_title = multi_media_info_str;
mNeedMediaTitle = false;
}
// <FS:Ansariel> Don't exist as of 30-01-2017
@ -1613,7 +1607,6 @@ void LLFloaterTools::getMediaState()
if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia)
{
media_title = multi_media_info_str;
mNeedMediaTitle = false;
}
else
{
@ -1622,10 +1615,6 @@ void LLFloaterTools::getMediaState()
{
// initial media title is the media URL (until we get the name)
media_title = media_data_get.getHomeURL();
// kick off a navigate and flag that we need to update the title
navigateToTitleMedia( media_data_get.getHomeURL() );
mNeedMediaTitle = true;
}
}
@ -1636,6 +1625,8 @@ void LLFloaterTools::getMediaState()
getChildView("delete_media")->setEnabled(TRUE);
getChildView("add_media")->setEnabled(editable);
}
navigateToTitleMedia(media_title);
media_info->setText(media_title);
// load values for media settings
@ -1725,16 +1716,31 @@ void LLFloaterTools::clearMediaSettings()
//
void LLFloaterTools::navigateToTitleMedia( const std::string url )
{
if ( mTitleMedia )
std::string multi_media_info_str = LLTrans::getString("Multiple Media");
if (url.empty() || multi_media_info_str == url)
{
// nothing to show
mNeedMediaTitle = false;
}
else if (mTitleMedia)
{
LLPluginClassMedia* media_plugin = mTitleMedia->getMediaPlugin();
if ( media_plugin )
if ( media_plugin ) // Shouldn't this be after navigateTo creates plugin?
{
// if it's a movie, we don't want to hear it
media_plugin->setVolume( 0 );
};
mTitleMedia->navigateTo( url );
};
// check if url changed or if we need a new media source
if (mTitleMedia->getCurrentNavUrl() != url || media_plugin == NULL)
{
mTitleMedia->navigateTo( url );
}
// flag that we need to update the title (even if no request were made)
mNeedMediaTitle = true;
}
}
//////////////////////////////////////////////////////////////////////////////

View File

@ -108,8 +108,6 @@ public:
void onClickBtnAddMedia();
void onClickBtnEditMedia();
void clearMediaSettings();
void updateMediaTitle();
void navigateToTitleMedia( const std::string url );
bool selectedMediaEditable();
void updateLandImpacts();
@ -125,6 +123,8 @@ private:
void refreshMedia();
void getMediaState();
void updateMediaSettings();
void navigateToTitleMedia( const std::string url ); // navigate if changed
void updateMediaTitle();
static bool deleteMediaConfirm(const LLSD& notification, const LLSD& response);
static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
static void setObjectType( LLPCode pcode );

View File

@ -867,6 +867,10 @@ void reset_inventory_filter()
LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
if (main_inventory)
{
// <FS:Ansariel> FIRE-5160: Don't reset inventory filter when clearing search term
main_inventory->showAllItemsPanel();
main_inventory->resetFilters();
// </FS:Ansariel>
main_inventory->onFilterEdit("");
}
}

View File

@ -608,6 +608,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
{
setSelection(item_id, FALSE);
}
updateFolderLabel(model_item->getParentUUID());
}
//////////////////////////////
@ -619,6 +620,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
// Don't process the item if it is the root
if (old_parent)
{
LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent->getViewModelItem());
LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
// Item has been moved.
if (old_parent != new_parent)
@ -636,6 +638,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
setSelection(item_id, FALSE);
}
}
updateFolderLabel(model_item->getParentUUID());
}
else
{
@ -647,6 +650,10 @@ void LLInventoryPanel::modelChanged(U32 mask)
// doesn't include trash). Just remove the item's UI.
view_item->destroyView();
}
if(viewmodel_folder)
{
updateFolderLabel(viewmodel_folder->getUUID());
}
old_parent->getViewModelItem()->dirtyDescendantsFilter();
}
}
@ -664,6 +671,11 @@ void LLInventoryPanel::modelChanged(U32 mask)
if(parent)
{
parent->getViewModelItem()->dirtyDescendantsFilter();
LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent->getViewModelItem());
if(viewmodel_folder)
{
updateFolderLabel(viewmodel_folder->getUUID());
}
}
}
}
@ -1234,6 +1246,23 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it
}
void LLInventoryPanel::updateFolderLabel(const LLUUID& folder_id)
{
if(folder_id != mPreviousSelectedFolder) return;
LLFolderViewItem* folder_item = getItemByID(mPreviousSelectedFolder);
if(folder_item)
{
LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem();
if(bridge)
{
bridge->clearDisplayName();
bridge->setShowDescendantsCount(true);
folder_item->refresh();
}
}
}
void LLInventoryPanel::doCreate(const LLSD& userdata)
{
// <FS:Ansariel> FIRE-20108: Can't create new folder in secondary inventory if view is filtered
@ -1575,7 +1604,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
}
//static
void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel)
void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel, BOOL take_keyboard_focus, BOOL reset_filter)
{
LLInventoryPanel *active_panel;
bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)));
@ -1594,6 +1623,11 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
{
LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL;
if (reset_filter)
{
reset_inventory_filter();
}
// <FS:Ansariel> Optional hiding of Received Items folder aka Inbox
//if (in_inbox)
if (in_inbox && !show_inbox)
@ -1606,7 +1640,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
if (inventory_panel)
{
inventory_panel->setSelection(obj_id, TAKE_FOCUS_YES);
inventory_panel->setSelection(obj_id, take_keyboard_focus);
}
}
else
@ -1616,7 +1650,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
{
floater_inventory->setFocus(TRUE);
}
active_panel->setSelection(obj_id, TAKE_FOCUS_YES);
active_panel->setSelection(obj_id, take_keyboard_focus);
}
}
}

View File

@ -213,6 +213,8 @@ public:
bool attachObject(const LLSD& userdata);
static void idle(void* user_data);
void updateFolderLabel(const LLUUID& folder_id);
// <FS:Ansariel> Optional hiding of empty system folders
void updateHideEmptySystemFolders(const LLSD &data);
// <FS:Ansariel> Optional hiding of Inbox folder
@ -229,8 +231,12 @@ public:
// Find whichever inventory panel is active / on top.
// "Auto_open" determines if we open an inventory panel if none are open.
static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE);
static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel = FALSE);
static void openInventoryPanelAndSetSelection(BOOL auto_open,
const LLUUID& obj_id,
BOOL main_panel = FALSE,
BOOL take_keyboard_focus = TAKE_FOCUS_YES,
BOOL reset_filter = FALSE);
void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
void removeItemID(const LLUUID& id);

View File

@ -5080,26 +5080,32 @@ void on_new_single_inventory_upload_complete(
gInventory.notifyObservers();
success = true;
LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
// Show the preview panel for textures and sounds to let
// user know that the image (or snapshot) arrived intact.
LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel();
LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
if (panel)
{
LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
panel->setSelection(
server_response["new_inventory_item"].asUUID(),
TAKE_FOCUS_NO);
// restore keyboard focus
gFocusMgr.setKeyboardFocus(focus);
}
else
{
LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, server_response["new_inventory_item"].asUUID(), TRUE, TAKE_FOCUS_NO, TRUE);
}
// restore keyboard focus
gFocusMgr.setKeyboardFocus(focus);
}
else
{
LL_WARNS() << "Can't find a folder to put it in" << LL_ENDL;
}
// Todo: This is mesh repository code, is following code really needed?
// remove the "Uploading..." message
LLUploadDialog::modalUploadFinished();

View File

@ -1081,7 +1081,8 @@ void LLOutfitListBase::deselectOutfit(const LLUUID& category_id)
// Reset selection if the outfit is selected.
if (category_id == mSelectedOutfitUUID)
{
signalSelectionOutfitUUID(LLUUID::null);
mSelectedOutfitUUID = LLUUID::null;
signalSelectionOutfitUUID(mSelectedOutfitUUID);
}
}

View File

@ -803,7 +803,8 @@ void LLPanelLogin::loadLoginPage()
params["login_content_version"] = gSavedSettings.getString("LoginContentVersion");
// Make an LLURI with this augmented info
LLURI login_uri(LLURI::buildHTTP(login_page.authority(),
std::string url = login_page.scheme().empty()? login_page.authority() : login_page.scheme() + "://" + login_page.authority();
LLURI login_uri(LLURI::buildHTTP(url,
login_page.path(),
params));

View File

@ -1061,8 +1061,17 @@ void LLPanelMainInventory::updateItemcountText()
// </FS:Ansariel>
}
if(mCategoryCount != gInventory.getCategoryCount())
{
mCategoryCount = gInventory.getCategoryCount();
mCategoryCountString = "";
LLLocale locale(LLLocale::USER_LOCALE);
LLResMgr::getInstance()->getIntegerString(mCategoryCountString, mCategoryCount);
}
LLStringUtil::format_map_t string_args;
string_args["[ITEM_COUNT]"] = mItemCountString;
string_args["[CATEGORY_COUNT]"] = mCategoryCountString;
string_args["[FILTER]"] = getFilterText();
std::string text = "";
@ -1081,6 +1090,7 @@ void LLPanelMainInventory::updateItemcountText()
}
mCounterCtrl->setValue(text);
mCounterCtrl->setToolTip(text);
}
void LLPanelMainInventory::onFocusReceived()

View File

@ -160,7 +160,7 @@ private:
LLFilterEditor* mFilterEditor;
LLTabContainer* mFilterTabs;
LLUICtrl* mCounterCtrl;
LLUICtrl* mCounterCtrl;
LLHandle<LLFloater> mFinderHandle;
LLInventoryPanel* mActivePanel;
LLInventoryPanel* mWornItemsPanel;
@ -169,7 +169,9 @@ private:
std::string mFilterText;
std::string mFilterSubString;
S32 mItemCount;
std::string mItemCountString;
std::string mItemCountString;
S32 mCategoryCount;
std::string mCategoryCountString;
LLComboBox* mSearchTypeCombo;
// <FS:Zi> Filter dropdown

View File

@ -196,7 +196,7 @@ void LLPanelMediaSettingsGeneral::draw()
////////////////////////////////////////////////////////////////////////////////
// static
void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable, bool update_preview)
{
LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
self->mAutoLoop->clear();
@ -217,7 +217,10 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
self->mHeightPixels ->setEnabled(editable);
self->mHomeURL ->setEnabled(editable);
self->mWidthPixels ->setEnabled(editable);
self->updateMediaPreview();
if (update_preview)
{
self->updateMediaPreview();
}
}
// static

View File

@ -59,7 +59,7 @@ public:
void setParent( LLFloaterMediaSettings* parent );
static void initValues( void* userdata, const LLSD& media_settings ,bool editable);
static void clearValues( void* userdata, bool editable);
static void clearValues( void* userdata, bool editable, bool update_preview = true);
// Navigates the current selected face to the Home URL.
// If 'only_if_current_is_empty' is "true", it only performs

View File

@ -428,11 +428,16 @@ void LLPanelPlaces::onOpen(const LLSD& key)
mPlaceInfoType = key_type;
mPosGlobal.setZero();
mItem = NULL;
mRegionId.setNull();
togglePlaceInfoPanel(TRUE);
if (mPlaceInfoType == AGENT_INFO_TYPE)
{
mPlaceProfile->setInfoType(LLPanelPlaceInfo::AGENT);
if (gAgent.getRegion())
{
mRegionId = gAgent.getRegion()->getRegionID();
}
}
else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE)
{
@ -505,6 +510,8 @@ void LLPanelPlaces::onOpen(const LLSD& key)
if (!parcel_mgr)
return;
mParcelLocalId = parcel_mgr->getAgentParcel()->getLocalID();
// Start using LLViewerParcelMgr for land selection if
// information about nearby land is requested.
// Otherwise stop using land selection and deselect land.
@ -861,10 +868,21 @@ void LLPanelPlaces::onOverflowButtonClicked()
{
menu = mPlaceMenu;
bool landmark_item_enabled = false;
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
if (is_agent_place_info_visible
&& gAgent.getRegion()
&& mRegionId == gAgent.getRegion()->getRegionID()
&& parcel_mgr
&& parcel_mgr->getAgentParcel()->getLocalID() == mParcelLocalId)
{
// Floater still shows location identical to agent's position
landmark_item_enabled = !LLLandmarkActions::landmarkAlreadyExists();
}
// Enable adding a landmark only for agent current parcel and if
// there is no landmark already pointing to that parcel in agent's inventory.
menu->getChild<LLMenuItemCallGL>("landmark")->setEnabled(is_agent_place_info_visible &&
!LLLandmarkActions::landmarkAlreadyExists());
menu->getChild<LLMenuItemCallGL>("landmark")->setEnabled(landmark_item_enabled);
// STORM-411
// Creating landmarks for remote locations is impossible.
// So hide menu item "Make a Landmark" in "Teleport History Profile" panel.

View File

@ -153,6 +153,10 @@ private:
// Information type currently shown in Place Information panel
std::string mPlaceInfoType;
// Region and parcel ids, to detect location changes in case of AGENT_INFO_TYPE
LLUUID mRegionId;
S32 mParcelLocalId;
bool isLandmarkEditModeOn;
// Holds info whether "My Landmarks" and "Teleport History" tabs have been created.

View File

@ -1085,7 +1085,6 @@ bool idle_startup()
set_startup_status(0.03f, msg.c_str(), gAgent.mMOTD.c_str());
display_startup();
// LLViewerMedia::initBrowser();
show_release_notes_if_required();
LLStartUp::setStartupState( STATE_LOGIN_SHOW );
return FALSE;
}
@ -1118,6 +1117,7 @@ bool idle_startup()
// </FS:Zi>
init_menus();
}
show_release_notes_if_required();
if (show_connect_box)
{

View File

@ -796,17 +796,22 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti
{
success = true;
LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
// Show the preview panel for textures and sounds to let
// user know that the image (or snapshot) arrived intact.
LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel();
LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
if (panel)
{
LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
panel->setSelection(serverInventoryItem, TAKE_FOCUS_NO);
// restore keyboard focus
gFocusMgr.setKeyboardFocus(focus);
}
else
{
LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, TRUE, TAKE_FOCUS_NO, TRUE);
}
// restore keyboard focus
gFocusMgr.setKeyboardFocus(focus);
}
else
{

View File

@ -5215,9 +5215,10 @@ void LLViewerObject::updateText()
}
}
bool LLViewerObject::isOwnerInMuteList()
bool LLViewerObject::isOwnerInMuteList(LLUUID id)
{
if (isAvatar() || mOwnerID.isNull())
LLUUID owner_id = id.isNull() ? mOwnerID : id;
if (isAvatar() || owner_id.isNull())
{
return false;
}
@ -5229,7 +5230,7 @@ bool LLViewerObject::isOwnerInMuteList()
}
else
{
muted = LLMuteList::getInstance()->isMuted(mOwnerID);
muted = LLMuteList::getInstance()->isMuted(owner_id);
const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1;
mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES;

View File

@ -432,7 +432,7 @@ public:
void updateText(); // update text label position
virtual void updateDrawable(BOOL force_damped); // force updates on static objects
bool isOwnerInMuteList();
bool isOwnerInMuteList(LLUUID item_id = LLUUID());
void setDrawableState(U32 state, BOOL recursive = TRUE);
void clearDrawableState(U32 state, BOOL recursive = TRUE);

View File

@ -715,7 +715,7 @@ void LLViewerPartSim::updateSimulation()
upd = FALSE;
}
if(vobj && vobj->isOwnerInMuteList())
if(vobj && vobj->isOwnerInMuteList(mViewerPartSources[i]->getOwnerUUID()))
{
upd = FALSE;
}

View File

@ -1481,7 +1481,12 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated)
{
// Let the voice chat code check for its PTT key. Note that this never affects event processing.
LLVoiceClient::getInstance()->keyDown(key, mask);
if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
// *NOTE: We want to interpret KEY_RETURN later when it arrives as
// a Unicode char, not as a keydown. Otherwise when client frame
// rate is really low, hitting return sends your chat text before
@ -1495,13 +1500,7 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated)
return FALSE;
}
BOOL handled = gViewerKeyboard.handleKey(key, mask, repeated);
if (!handled || (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME))
{
gAgent.clearAFK();
}
return handled;
return gViewerKeyboard.handleKey(key, mask, repeated);
}
BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key, MASK mask)
@ -2117,7 +2116,11 @@ void LLViewerWindow::initBase()
// (But wait to add it as a child of the root view so that it will be in front of the
// other views.)
MainPanel* main_view = new MainPanel();
main_view->buildFromFile("main_view.xml");
if (!main_view->buildFromFile("main_view.xml"))
{
LL_ERRS() << "Failed to initialize viewer: Viewer couldn't process file main_view.xml, "
<< "if this problem happens again, please validate your installation." << LL_ENDL;
}
main_view->setShape(full_window);
getRootView()->addChild(main_view);
@ -5707,7 +5710,8 @@ void LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke
// err = LLFile::stat( filepath, &stat_info );
// i++;
//}
//while( -1 != err ); // search until the file is not found (i.e., stat() gives an error).
//while( -1 != err // Search until the file is not found (i.e., stat() gives an error).
// && is_snapshot_name_loc_set); // Or stop if we are rewriting.
//LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL;
//return image->save(filepath);

View File

@ -2239,81 +2239,134 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
}
bool LLVOVolume::notifyAboutCreatingTexture(LLViewerTexture *texture)
{
// Texture was created, process it and remove from wait list
{ //Ok, here we have confirmation about texture creation, check our wait-list
//and make changes, or return false
std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID());
if(range.first == range.second) return false;
bool needs_update = false;
typedef std::map<U8, LLMaterialPtr> map_te_material;
map_te_material new_material;
for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it)
{
LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te);
if (cur_material.isNull())
{
continue;
}
if (LLRender::DIFFUSE_MAP == range_it->second.map
&& GL_RGBA != texture->getPrimaryFormat()
&& cur_material->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_NONE
&& cur_material->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT)
{
// We have non 32 bit texture with alpha, it is invalid
//here we just interesting in DIFFUSE_MAP only!
if(NULL != cur_material.get() && LLRender::DIFFUSE_MAP == range_it->second.map && GL_RGBA != texture->getPrimaryFormat())
{ //ok let's check the diffuse mode
switch(cur_material->getDiffuseAlphaMode())
{
case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND:
case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE:
case LLMaterial::DIFFUSE_ALPHA_MODE_MASK:
{ //uups... we have non 32 bit texture with LLMaterial::DIFFUSE_ALPHA_MODE_* => LLMaterial::DIFFUSE_ALPHA_MODE_NONE
cur_material->setDiffuseAlphaInvalid(true);
needs_update = true;
}
LLMaterialPtr mat = NULL;
map_te_material::iterator it = new_material.find(range_it->second.te);
if(new_material.end() == it) {
mat = new LLMaterial(cur_material->asLLSD());
new_material.insert(map_te_material::value_type(range_it->second.te, mat));
} else {
mat = it->second;
}
mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
} break;
} //switch
} //if
} //for
//setup new materials
for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it)
{
LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second);
LLViewerObject::setTEMaterialParams(it->first, it->second);
}
//clear wait-list
mWaitingTextureInfo.erase(range.first, range.second);
return needs_update;
return 0 != new_material.size();
}
bool LLVOVolume::notifyAboutMissingAsset(LLViewerTexture *texture)
{
// Texture was marked as missing, process it and remove from wait list
{ //Ok, here if we wait information about texture and it's missing
//then depending from the texture map (diffuse, normal, or specular)
//make changes in material and confirm it. If not return false.
std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID());
if(range.first == range.second) return false;
typedef std::map<U8, LLMaterialPtr> map_te_material;
map_te_material new_material;
for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it)
{
LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te);
if (cur_material.isNull())
{
continue;
}
switch (range_it->second.map)
switch(range_it->second.map)
{
case LLRender::DIFFUSE_MAP:
{
cur_material->setDiffuseAlphaInvalid(true);
break;
}
if(LLMaterial::DIFFUSE_ALPHA_MODE_NONE != cur_material->getDiffuseAlphaMode())
{ //missing texture + !LLMaterial::DIFFUSE_ALPHA_MODE_NONE => LLMaterial::DIFFUSE_ALPHA_MODE_NONE
LLMaterialPtr mat = NULL;
map_te_material::iterator it = new_material.find(range_it->second.te);
if(new_material.end() == it) {
mat = new LLMaterial(cur_material->asLLSD());
new_material.insert(map_te_material::value_type(range_it->second.te, mat));
} else {
mat = it->second;
}
mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
}
} break;
case LLRender::NORMAL_MAP:
{
cur_material->setNormalInvalid(true);
break;
}
{ //missing texture => reset material texture id
LLMaterialPtr mat = NULL;
map_te_material::iterator it = new_material.find(range_it->second.te);
if(new_material.end() == it) {
mat = new LLMaterial(cur_material->asLLSD());
new_material.insert(map_te_material::value_type(range_it->second.te, mat));
} else {
mat = it->second;
}
mat->setNormalID(LLUUID::null);
} break;
case LLRender::SPECULAR_MAP:
{
cur_material->setSpecularInvalid(true);
break;
}
default:
{ //missing texture => reset material texture id
LLMaterialPtr mat = NULL;
map_te_material::iterator it = new_material.find(range_it->second.te);
if(new_material.end() == it) {
mat = new LLMaterial(cur_material->asLLSD());
new_material.insert(map_te_material::value_type(range_it->second.te, mat));
} else {
mat = it->second;
}
mat->setSpecularID(LLUUID::null);
} break;
case LLRender::NUM_TEXTURE_CHANNELS:
//nothing to do, make compiler happy
break;
}
} //switch
} //for
//setup new materials
for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it)
{
LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second);
LLViewerObject::setTEMaterialParams(it->first, it->second);
}
//clear wait-list
mWaitingTextureInfo.erase(range.first, range.second);
return true;
return 0 != new_material.size();
}
S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams)
@ -2329,25 +2382,44 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa
llassert(NULL != img_diffuse);
LLMaterialPtr new_material = NULL;
//diffuse
if(NULL != img_diffuse)
{
{ //guard
if(0 == img_diffuse->getPrimaryFormat() && !img_diffuse->isMissingAsset())
{
// Texture information is missing, wait for it
{ //ok here we don't have information about texture, let's belief and leave material settings
//but we remember this case
mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(img_diffuse->getID(), material_info(LLRender::DIFFUSE_MAP, te)));
}
else
{
bool bSetDiffuseNone = false;
if(img_diffuse->isMissingAsset())
{
pMaterial->setDiffuseAlphaInvalid(true);
bSetDiffuseNone = true;
}
else if (GL_RGBA != img_diffuse->getPrimaryFormat()
&& pMaterialParams->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_NONE
&& pMaterialParams->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT)
else
{
pMaterial->setDiffuseAlphaInvalid(true);
switch(pMaterialParams->getDiffuseAlphaMode())
{
case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND:
case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE:
case LLMaterial::DIFFUSE_ALPHA_MODE_MASK:
{ //all of them modes available only for 32 bit textures
if(GL_RGBA != img_diffuse->getPrimaryFormat())
{
bSetDiffuseNone = true;
}
} break;
}
} //else
if(bSetDiffuseNone)
{ //upps... we should substitute this material with LLMaterial::DIFFUSE_ALPHA_MODE_NONE
new_material = new LLMaterial(pMaterialParams->asLLSD());
new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
}
}
}
@ -2357,11 +2429,14 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa
{
if(img_normal && img_normal->isMissingAsset() && img_normal->getID() == pMaterialParams->getNormalID())
{
pMaterial->setNormalInvalid(true);
if(!new_material) {
new_material = new LLMaterial(pMaterialParams->asLLSD());
}
new_material->setNormalID(LLUUID::null);
}
else if(NULL == img_normal || 0 == img_normal->getPrimaryFormat())
{
// Texture information is missing, wait for it
{ //ok here we don't have information about texture, let's belief and leave material settings
//but we remember this case
mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getNormalID(), material_info(LLRender::NORMAL_MAP,te)));
}
@ -2373,14 +2448,22 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa
{
if(img_specular && img_specular->isMissingAsset() && img_specular->getID() == pMaterialParams->getSpecularID())
{
pMaterial->setSpecularInvalid(true);
if(!new_material) {
new_material = new LLMaterial(pMaterialParams->asLLSD());
}
new_material->setSpecularID(LLUUID::null);
}
else if(NULL == img_specular || 0 == img_specular->getPrimaryFormat())
{
// Texture information is missing, wait for it
{ //ok here we don't have information about texture, let's belief and leave material settings
//but we remember this case
mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getSpecularID(), material_info(LLRender::SPECULAR_MAP, te)));
}
}
if(new_material) {
pMaterial = new_material;
LLMaterialMgr::getInstance()->put(getID(),te,*pMaterial);
}
}
S32 res = LLViewerObject::setTEMaterialParams(te, pMaterial);
@ -4762,7 +4845,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
}
draw_info->mAlphaMaskCutoff = mat->getAlphaMaskCutoff() * (1.f / 255.f);
draw_info->mDiffuseAlphaMode = mat->isDiffuseAlphaInvalid() ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : mat->getDiffuseAlphaMode();
draw_info->mDiffuseAlphaMode = mat->getDiffuseAlphaMode();
draw_info->mNormalMap = facep->getViewerObject()->getTENormalMap(facep->getTEOffset());
}
@ -5064,14 +5147,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
LLMaterial* mat = te->getMaterialParams().get();
U8 alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
if (mat && !mat->isDiffuseAlphaInvalid())
{
alpha_mode = mat->getDiffuseAlphaMode();
}
if (mat && LLPipeline::sRenderDeferred)
{
U8 alpha_mode = mat->getDiffuseAlphaMode();
bool is_alpha = type == LLDrawPool::POOL_ALPHA &&
(alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND ||
te->getColor().mV[3] < 0.999f);
@ -5091,10 +5171,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{
bool fullbright = te->getFullbright();
bool is_alpha = type == LLDrawPool::POOL_ALPHA;
bool can_be_shiny = alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE ||
alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE;
U8 mode = mat->getDiffuseAlphaMode();
bool can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE ||
mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE;
if (alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f)
if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f)
{
pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE);
}
@ -5303,9 +5384,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
// </FS:ND>
{
LLMaterial* mat = te->getMaterialParams().get();
if (mat->getNormalID().notNull() && !mat->isNormalInvalid())
if (mat->getNormalID().notNull())
{
if (mat->getSpecularID().notNull() && !mat->isSpecularInvalid())
if (mat->getSpecularID().notNull())
{ //has normal and specular maps (needs texcoord1, texcoord2, and tangent)
if (normspec_count < MAX_FACE_COUNT)
{
@ -5320,7 +5401,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
}
}
else if (mat->getSpecularID().notNull() && !mat->isSpecularInvalid())
else if (mat->getSpecularID().notNull())
{ //has specular map but no normal map, needs texcoord2
if (spec_count < MAX_FACE_COUNT)
{
@ -5990,14 +6071,13 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE;
LLMaterial* mat = te->getMaterialParams().get();
U8 diffuse_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
bool can_be_shiny = true;
bool can_be_shiny = true;
if (mat)
{
diffuse_mode = mat->isDiffuseAlphaInvalid() ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : mat->getDiffuseAlphaMode();
can_be_shiny = diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE ||
diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE;
U8 mode = mat->getDiffuseAlphaMode();
can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE ||
mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE;
}
bool use_legacy_bump = te->getBumpmap() && (te->getBumpmap() < 18) && (!mat || mat->getNormalID().isNull());
@ -6013,7 +6093,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
//
if (te->getFullbright())
{
if (diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
{
if (opaque)
{
@ -6092,7 +6172,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
}
else if (mat)
{
U8 mode = diffuse_mode;
U8 mode = mat->getDiffuseAlphaMode();
if (te->getColor().mV[3] < 0.999f)
{
mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND;
@ -6188,7 +6268,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
}
else if (fullbright || bake_sunlight)
{ //fullbright
if (mat && diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
{
registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK);
}
@ -6210,7 +6290,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
else
{ //all around simple
llassert(mask & LLVertexBuffer::MAP_NORMAL);
if (mat && diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
{ //material alpha mask can be respected in non-deferred
registerFace(group, facep, LLRenderPass::PASS_ALPHA_MASK);
}

View File

@ -676,7 +676,7 @@ LLWearableItemsList::LLWearableItemsList(const LLWearableItemsList::Params& p)
setRightMouseDownCallback(boost::bind(&LLWearableItemsList::onRightClick, this, _2, _3));
}
mWornIndicationEnabled = p.worn_indication_enabled;
setNoItemsCommentText(LLTrans::getString("LoadingData"));
setNoItemsCommentText(LLTrans::getString("NoneFound"));
}
// virtual

View File

@ -1781,7 +1781,7 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2);
}
if (alpha && mat && !mat->isDiffuseAlphaInvalid())
if (alpha && mat)
{
switch (mat->getDiffuseAlphaMode())
{
@ -1802,7 +1802,7 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
{
return LLDrawPool::POOL_ALPHA;
}
else if ((te->getBumpmap() || te->getShiny()) && (!mat || mat->getNormalID().isNull() || mat->isNormalInvalid()))
else if ((te->getBumpmap() || te->getShiny()) && (!mat || mat->getNormalID().isNull()))
{
return LLDrawPool::POOL_BUMP;
}