Commit ecb2dceb authored by Luminous Luminos's avatar Luminous Luminos
Browse files

Merge

parents 1cdfda37 5477404d
......@@ -170,7 +170,7 @@ void LLCubeMap::init(const std::vector<LLPointer<LLImageRaw> >& rawimages)
}
}
GLuint LLCubeMap::getGLName()
GLuint LLCubeMap::getGLName() const
{
return mImages[0]->getTexName();
}
......
......@@ -48,7 +48,7 @@ public:
void enableTexture(S32 stage);
void enableTextureCoords(S32 stage);
S32 getStage(void) { return mTextureStage; }
S32 getStage(void) const { return mTextureStage; }
void disable(void);
void disableTexture(void);
......@@ -59,7 +59,7 @@ public:
void finishPaint();
GLuint getGLName();
GLuint getGLName() const;
LLVector3 map(U8 side, U16 v_val, U16 h_val) const;
BOOL project(F32& v_val, F32& h_val, BOOL& outside,
......
......@@ -33,7 +33,6 @@
#include "llimagegl.h"
#include "llpointer.h"
#include "llrect.h"
#include "v2math.h"
class LLColor4;
// Key used to request a font.
......
......@@ -32,14 +32,11 @@
#include <boost/unordered_map.hpp>
#include <list>
#include "llerror.h"
#include "v4color.h"
#include "llstring.h"
#include "stdtypes.h"
#include "v4math.h"
#include "llplane.h"
#include "llgltypes.h"
#include "llinstancetracker.h"
#include "llglheaders.h"
#include <glm/mat4x4.hpp>
......
......@@ -33,7 +33,6 @@
#include "llgltypes.h"
#include "llpointer.h"
#include "llrefcount.h"
#include "v2math.h"
#include "llunits.h"
#include "llrender.h"
......
......@@ -41,7 +41,6 @@ public:
void renderLLTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, const LLColor4U& color ) const;
//Draw the contents of vertex buffer
void renderNavMeshVB( U32 mode, LLVertexBuffer* pVBO, int vertCnt );
private:
};
extern LLRenderNavPrim gRenderNav;
......
......@@ -30,7 +30,6 @@
#include "v4color.h"
#include "llpointer.h"
#include "llrefcount.h"
#include "llrefcount.h"
#include "llrect.h"
#include <boost/signals2.hpp>
#include "llinitparam.h"
......
......@@ -30,12 +30,10 @@
#include "llgl.h"
#include "v2math.h"
#include "v3math.h"
#include "v4math.h"
#include "v4coloru.h"
#include "llstrider.h"
#include "llrender.h"
#include "lltrace.h"
#include <set>
#include <vector>
#include <list>
#include <deque>
......@@ -144,7 +142,6 @@ public:
static void initClass(bool use_vbo, bool no_vbo_mapping);
static void cleanupClass();
static void setupClientArrays(U32 data_mask);
static void pushPositions(U32 mode, const LLVector4a* pos, U32 count);
static void drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm);
static void drawElements(U32 mode, const S32 num_vertices, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp);
......@@ -255,7 +252,6 @@ public:
bool getTangentStrider(LLStrider<LLVector3>& strider, S32 index=0, S32 count = -1, bool map_range = false);
bool getTangentStrider(LLStrider<LLVector4a>& strider, S32 index=0, S32 count = -1, bool map_range = false);
bool getColorStrider(LLStrider<LLColor4U>& strider, S32 index=0, S32 count = -1, bool map_range = false);
bool getTextureIndexStrider(LLStrider<LLColor4U>& strider, S32 index=0, S32 count = -1, bool map_range = false);
bool getEmissiveStrider(LLStrider<LLColor4U>& strider, S32 index=0, S32 count = -1, bool map_range = false);
bool getWeightStrider(LLStrider<F32>& strider, S32 index=0, S32 count = -1, bool map_range = false);
bool getWeight4Strider(LLStrider<LLVector4a>& strider, S32 index=0, S32 count = -1, bool map_range = false);
......
......@@ -76,9 +76,9 @@ void LLAvatarList::toggleIcons()
// Show/hide icons for all existing items.
std::vector<LLPanel*> items;
getItems(items);
for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++)
for (auto item : items)
{
static_cast<LLAvatarListItem*>(*it)->setAvatarIconVisible(mShowIcons);
static_cast<LLAvatarListItem*>(item)->setAvatarIconVisible(mShowIcons);
}
}
......@@ -90,9 +90,9 @@ void LLAvatarList::setSpeakingIndicatorsVisible(bool visible)
// Show/hide icons for all existing items.
std::vector<LLPanel*> items;
getItems(items);
for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++)
for (auto item : items)
{
static_cast<LLAvatarListItem*>(*it)->showSpeakingIndicator(mShowSpeakingIndicator);
static_cast<LLAvatarListItem*>(item)->showSpeakingIndicator(mShowSpeakingIndicator);
}
}
......@@ -104,9 +104,9 @@ void LLAvatarList::showPermissions(bool visible)
// Enable or disable showing permissions icons for all existing items.
std::vector<LLPanel*> items;
getItems(items);
for(std::vector<LLPanel*>::const_iterator it = items.begin(), end_it = items.end(); it != end_it; ++it)
for (auto item : items)
{
static_cast<LLAvatarListItem*>(*it)->setShowPermissions(mShowPermissions);
static_cast<LLAvatarListItem*>(item)->setShowPermissions(mShowPermissions);
}
}
......@@ -294,9 +294,8 @@ void LLAvatarList::refresh()
unsigned nadded = 0;
const std::string waiting_str = LLTrans::getString("AvatarNameWaiting");
for (uuid_vec_t::const_iterator it=added.cbegin(); it != added.cend(); ++it)
for (const auto& buddy_id : added)
{
const LLUUID& buddy_id = *it;
LLAvatarName av_name;
have_names &= LLAvatarNameCache::get(buddy_id, &av_name);
......@@ -331,9 +330,9 @@ void LLAvatarList::refresh()
}
// Handle removed items.
for (uuid_vec_t::const_iterator it = removed.cbegin(); it != removed.cend(); ++it)
for (const auto& item : removed)
{
removeItemByUUID(*it);
removeItemByUUID(item);
modified = true;
}
......@@ -343,9 +342,9 @@ void LLAvatarList::refresh()
std::vector<LLSD> cur_values;
getValues(cur_values);
for (std::vector<LLSD>::const_iterator it = cur_values.cbegin(); it != cur_values.cend(); ++it)
for (const auto& value : cur_values)
{
const LLUUID& buddy_id = it->asUUID();
const LLUUID& buddy_id = value.asUUID();
LLAvatarName av_name;
have_names &= LLAvatarNameCache::get(buddy_id, &av_name);
if (!findInsensitive(getAvatarName(av_name), mNameFilter))
......@@ -380,9 +379,9 @@ void LLAvatarList::refresh()
// Highlight items matching the filter.
std::vector<LLPanel*> items;
getItems(items);
for (std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); ++it)
for (const auto& itemp : items)
{
static_cast<LLAvatarListItem*>(*it)->setHighlight(mNameFilter);
static_cast<LLAvatarListItem*>(itemp)->setHighlight(mNameFilter);
}
// Send refresh_complete signal.
......@@ -399,9 +398,9 @@ void LLAvatarList::updateAvatarNames()
std::vector<LLPanel*> items;
getItems(items);
for (std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); ++it)
for (const auto& itemp : items)
{
LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it);
LLAvatarListItem* item = static_cast<LLAvatarListItem*>(itemp);
item->setShowCompleteName(mShowCompleteName);
item->updateAvatarName();
}
......@@ -413,9 +412,8 @@ bool LLAvatarList::filterHasMatches()
{
uuid_vec_t values = getIDs();
for (uuid_vec_t::const_iterator it = values.cbegin(); it != values.cend(); ++it)
for (const auto& buddy_id : values)
{
const LLUUID& buddy_id = *it;
LLAvatarName av_name;
bool have_name = LLAvatarNameCache::get(buddy_id, &av_name);
......@@ -543,11 +541,10 @@ bool LLAvatarList::isAvalineItemSelected() const
{
std::vector<LLPanel*> selected_items;
getSelectedItems(selected_items);
std::vector<LLPanel*>::iterator it = selected_items.begin();
for(; it != selected_items.end(); ++it)
for (const auto& selected_item : selected_items)
{
if (dynamic_cast<LLAvalineListItem*>(*it))
if (dynamic_cast<LLAvalineListItem*>(selected_item))
return true;
}
......@@ -589,10 +586,10 @@ void LLAvatarList::updateLastInteractionTimes()
std::vector<LLPanel*> items;
getItems(items);
for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++)
for(auto itemp : items)
{
// *TODO: error handling
LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it);
LLAvatarListItem* item = static_cast<LLAvatarListItem*>(itemp);
S32 secs_since = now - (S32) LLRecentPeople::instance().getDate(item->getAvatarId()).secondsSinceEpoch();
if (secs_since >= 0)
item->setLastInteractionTime(secs_since);
......@@ -604,13 +601,15 @@ void LLAvatarList::updateDistances()
std::vector<LLPanel*> items;
getItems(items);
for(std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); ++it)
static LLCachedControl<F32> near_me_range(gSavedSettings, "NearMeRange");
LLWorld::pos_map_t positions;
LLWorld::getInstance()->getAvatars(&positions, gAgent.getPositionGlobal(), near_me_range);
for (auto itemp : items)
{
LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it);
LLAvatarListItem* item = static_cast<LLAvatarListItem*>(itemp);
if (item->getAvatarId() == gAgentID) continue;
LLWorld::pos_map_t positions;
LLWorld::getInstance()->getAvatars(&positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange"));
LLWorld::pos_map_t::iterator iter = positions.find(item->getAvatarId());
if (iter != positions.end())
item->setDistance((iter->second - gAgent.getPositionGlobal()).magVec());
......
......@@ -47,10 +47,10 @@ class LLFloaterProperties : public LLFloater
{
public:
LLFloaterProperties(const LLUUID& item_id);
/*virtual*/ ~LLFloaterProperties();
~LLFloaterProperties();
/*virtual*/ BOOL postBuild() override;
/*virtual*/ void onOpen(const LLSD& key) override;
BOOL postBuild() override;
void onOpen(const LLSD& key) override;
void setObjectID(const LLUUID& object_id) { mObjectID = object_id; }
void dirty() { mDirty = TRUE; }
......
......@@ -1591,9 +1591,9 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
std::vector<std::pair <U64, LLSimInfo*> > sim_info_vec(LLWorldMap::getInstance()->getRegionMap().begin(), LLWorldMap::getInstance()->getRegionMap().end());
std::sort(sim_info_vec.begin(), sim_info_vec.end(), SortRegionNames());
for (std::vector<std::pair <U64, LLSimInfo*> >::const_iterator it = sim_info_vec.begin(); it != sim_info_vec.end(); ++it)
for (const auto& sim_info_pair : sim_info_vec)
{
LLSimInfo* info = it->second;
LLSimInfo* info = sim_info_pair.second;
std::string sim_name_lower = info->getName();
LLStringUtil::toLower(sim_name_lower);
......@@ -1655,10 +1655,9 @@ void LLFloaterWorldMap::onCommitSearchResult()
}
LLStringUtil::toLower(sim_name);
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
for (auto map_pair : LLWorldMap::getInstance()->getRegionMap())
{
LLSimInfo* info = it->second;
LLSimInfo* info = map_pair.second;
if (info->isName(sim_name))
{
......
......@@ -27,20 +27,13 @@
*/
#include "llviewerprecompiledheaders.h"
#include <utility> // for std::pair<>
#include "llinventoryfunctions.h"
// library includes
#include "llagent.h"
#include "llagentwearables.h"
#include "llcallingcard.h"
#include "llfloaterreg.h"
#include "llinventorydefines.h"
#include "llsdserialize.h"
#include "llfiltereditor.h"
#include "llspinctrl.h"
#include "llui.h"
#include "message.h"
......@@ -51,40 +44,24 @@
#include "llclipboard.h"
#include "lldonotdisturbnotificationstorage.h"
#include "llfloatersidepanelcontainer.h"
#include "llfocusmgr.h"
#include "llfolderview.h"
#include "llgesturemgr.h"
#include "lliconctrl.h"
#include "llimview.h"
#include "llinventorybridge.h"
#include "llinventorymodel.h"
#include "llinventorypanel.h"
#include "lllineeditor.h"
#include "llmarketplacenotifications.h"
#include "llmarketplacefunctions.h"
#include "llmenugl.h"
#include "llnotificationsutil.h"
#include "llpanelmaininventory.h"
#include "llpreviewanim.h"
#include "llpreviewgesture.h"
#include "llpreviewnotecard.h"
#include "llpreviewscript.h"
#include "llpreviewsound.h"
#include "llpreviewtexture.h"
#include "llresmgr.h"
#include "llscrollbar.h"
#include "llscrollcontainer.h"
#include "llselectmgr.h"
#include "llsidepanelinventory.h"
#include "lltabcontainer.h"
#include "lltooldraganddrop.h"
#include "lltrans.h"
#include "llviewermessage.h"
#include "llviewerfoldertype.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
#include "llvoavatarself.h"
#include "llwearablelist.h"
BOOL LLInventoryState::sWearNewClothing = FALSE;
LLUUID LLInventoryState::sWearNewClothingTransactionID;
......@@ -153,7 +130,7 @@ S32 count_descendants_items(const LLUUID& cat_id)
S32 count = item_array->size();
LLInventoryModel::cat_array_t cat_array_copy = *cat_array;
for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); ++iter)
{
LLViewerInventoryCategory* category = *iter;
count += count_descendants_items(category->getUUID());
......@@ -175,7 +152,7 @@ bool contains_nocopy_items(const LLUUID& id)
gInventory.getDirectDescendentsOf(id,cat_array,item_array);
// Check all the items: returns true upon encountering a nocopy item
for (LLInventoryModel::item_array_t::iterator iter = item_array->begin(); iter != item_array->end(); iter++)
for (LLInventoryModel::item_array_t::iterator iter = item_array->begin(); iter != item_array->end(); ++iter)
{
LLInventoryItem* item = *iter;
LLViewerInventoryItem * inv_item = (LLViewerInventoryItem *) item;
......@@ -186,7 +163,7 @@ bool contains_nocopy_items(const LLUUID& id)
}
// Check all the sub folders recursively
for (LLInventoryModel::cat_array_t::iterator iter = cat_array->begin(); iter != cat_array->end(); iter++)
for (LLInventoryModel::cat_array_t::iterator iter = cat_array->begin(); iter != cat_array->end(); ++iter)
{
LLViewerInventoryCategory* cat = *iter;
if (contains_nocopy_items(cat->getUUID()))
......@@ -580,7 +557,6 @@ BOOL get_can_item_be_worn(const LLUUID& id)
// Not being worn yet.
return TRUE;
}
break;
}
case LLAssetType::AT_BODYPART:
case LLAssetType::AT_CLOTHING:
......@@ -594,7 +570,6 @@ BOOL get_can_item_be_worn(const LLUUID& id)
// Not being worn yet.
return TRUE;
}
break;
default:
break;
}
......@@ -1254,7 +1229,7 @@ bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol
LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory();
if (linked_category != NULL)
if (linked_category != nullptr)
{
// Move the linked folder directly
return move_folder_to_marketplacelistings(linked_category, dest_folder, copy);
......@@ -1263,7 +1238,7 @@ bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_fol
{
// Grab the linked item if any
LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem();
viewer_inv_item = (linked_item != NULL ? linked_item : viewer_inv_item);
viewer_inv_item = (linked_item != nullptr ? linked_item : viewer_inv_item);
// If we want to copy but the item is no copy, fail silently (this is a common case that doesn't warrant notification)
if (copy && !viewer_inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()))
......@@ -1410,13 +1385,6 @@ void dump_trace(std::string& message, S32 depth, LLError::ELevel log_level)
// The only inventory changes that are done is to move and sort folders containing no-copy items to stock folders.
bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_t cb, bool fix_hierarchy, S32 depth)
{
#if 0
// Used only for debug
if (!cb)
{
cb = boost::bind(&dump_trace, _1, _2, _3);
}
#endif
// Folder is valid unless issue is raised
bool result = true;
......@@ -1691,7 +1659,7 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
}
// Scan each item and report if there's a problem
LLInventoryModel::item_array_t item_array_copy = *item_array;
for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++)
for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); ++iter)
{
LLInventoryItem* item = *iter;
LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) item;
......@@ -1772,7 +1740,6 @@ bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(const LLInventoryIte
break;
default:
return true;
break;
}
return false;
}
......@@ -2199,7 +2166,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
if (user_confirm && (("delete" == action) || ("cut" == action) || ("rename" == action) || ("properties" == action) || ("task_properties" == action) || ("open" == action)))
{
std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin();
LLFolderViewModelItemInventory * viewModel = NULL;
LLFolderViewModelItemInventory * viewModel = nullptr;
for (; set_iter != selected_items.end(); ++set_iter)
{
viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem());
......@@ -2314,8 +2281,8 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
}
LLMultiPreview* multi_previewp = NULL;
LLMultiProperties* multi_propertiesp = NULL;
LLMultiPreview* multi_previewp = nullptr;
LLMultiProperties* multi_propertiesp = nullptr;
if (("task_open" == action || "open" == action) && selected_items.size() > 1)
{
......@@ -2433,7 +2400,7 @@ void LLInventoryAction::buildMarketplaceFolders(LLFolderView* root)
std::set<LLFolderViewItem*> selected_items = root->getSelectionList();
std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin();
LLFolderViewModelItemInventory * viewModel = NULL;
LLFolderViewModelItemInventory * viewModel = nullptr;
for (; set_iter != selected_items.end(); ++set_iter)
{
viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*set_iter)->getViewModelItem());
......
......@@ -105,7 +105,7 @@ public:
LLInventoryObject* object);
void showProperties() override;
void buyItem();
S32 getPrice();
S32 getPrice() const;
static bool commitBuyItem(const LLSD& notification, const LLSD& response);
// LLFolderViewModelItemInventory functionality
......@@ -250,17 +250,12 @@ void LLTaskInvFVBridge::buyItem()
}
}
S32 LLTaskInvFVBridge::getPrice()
S32 LLTaskInvFVBridge::getPrice() const
{
LLInventoryItem* item = findItem();
if(item)
{
return item->getSaleInfo().getSalePrice();
}
else
{
return -1;
}
return item
? item->getSaleInfo().getSalePrice()
: -1;
}
// static
......
......@@ -838,8 +838,8 @@ void LLPanelPeople::updateNearbyList()
return;
std::vector<LLVector3d> positions;
LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange"));
static LLCachedControl<F32> near_me_range(gSavedSettings, "NearMeRange");
LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), near_me_range);
mNearbyList->setDirty();
DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs());
......
......@@ -32,7 +32,6 @@
#include "llpointer.h"
#include "lluuid.h"
#include "llinventoryobserver.h"
#include "llextendedstatus.h"
class LLInventoryItem;
class LLLineEditor;
......@@ -44,9 +43,9 @@ class LLMultiPreview : public LLMultiFloater
public:
LLMultiPreview();
/*virtual*/void onOpen(const LLSD& key) override;
/*virtual*/void tabOpen(LLFloater* opened_floater, bool from_click) override;
/*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false) override;
void onOpen(const LLSD& key) override;
void tabOpen(LLFloater* opened_floater, bool from_click) override;
void handleReshape(const LLRect& new_rect, bool by_user = false) override;
};
......@@ -62,11 +61,11 @@ public:
PREVIEW_ASSET_LOADING,
PREVIEW_ASSET_LOADED
} EAssetStatus;
public:
LLPreview(const LLSD& key );
virtual ~LLPreview();
/*virtual*/ BOOL postBuild() override;
BOOL postBuild() override;
virtual void setObjectID(const LLUUID& object_id);
void setItem( LLInventoryItem* item );
......@@ -86,18 +85,15 @@ public:
static void onBtnCopyToInv(void* userdata);
void addKeepDiscardButtons();
static void onKeepBtn(void* data);
static void onDiscardBtn(void* data);
/*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false) override;
void handleReshape(const LLRect& new_rect, bool by_user = false) override;
void userResized() { mUserResized = TRUE; };
virtual void loadAsset() { mAssetStatus = PREVIEW_ASSET_LOADED; }
virtual EAssetStatus getAssetStatus() { return mAssetStatus;}
static LLPreview* getFirstPreviewForSource(const LLUUID& source_id);
// Why is this at the LLPreview level? JC
void setNotecardInfo(const LLUUID& notecard_inv_id, const LLUUID& object_id);
......@@ -112,8 +108,6 @@ public:
protected:
void onCommit() override;
void addDescriptionUI();
static void onText(LLUICtrl*, void* userdata);
static void onRadio(LLUICtrl*, void* userdata);
......@@ -121,7 +115,6 @@ protected:
void changed(U32 mask) override;
BOOL mDirty;
protected:
LLUUID mItemUUID;
// mObjectUUID will have a value if it is associated with a task in
......
......@@ -35,8 +35,8 @@ class LLPreviewAnim : public LLPreview
public:
LLPreviewAnim(const LLSD& key);
/*virtual*/ BOOL postBuild() override;
/*virtual*/ void onClose(bool app_quitting) override;
BOOL postBuild() override;
void onClose(bool app_quitting) override;
void draw