summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llagent.cpp17
-rw-r--r--indra/newview/llappviewer.cpp6
-rw-r--r--indra/newview/llavatarlist.cpp2
-rw-r--r--indra/newview/llchatitemscontainerctrl.cpp17
-rw-r--r--indra/newview/lldirpicker.cpp7
-rw-r--r--indra/newview/lldrawable.cpp2
-rw-r--r--indra/newview/lldrawable.h6
-rw-r--r--indra/newview/llface.h6
-rw-r--r--indra/newview/llfilepicker.cpp108
-rw-r--r--indra/newview/llflexibleobject.cpp8
-rw-r--r--indra/newview/llfloater360capture.cpp2
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp2
-rw-r--r--indra/newview/llfloateremojipicker.cpp4
-rw-r--r--indra/newview/llfloatergodtools.cpp22
-rw-r--r--indra/newview/llfloaterimnearbychathandler.cpp34
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp2
-rw-r--r--indra/newview/llfloaterlagmeter.cpp4
-rw-r--r--indra/newview/llfloaterpreference.cpp86
-rw-r--r--indra/newview/llfloaterpreferencesgraphicsadvanced.cpp19
-rw-r--r--indra/newview/llfloaterregioninfo.cpp53
-rw-r--r--indra/newview/llfloaterurlentry.cpp2
-rw-r--r--indra/newview/llfriendcard.cpp2
-rw-r--r--indra/newview/llhudnametag.cpp6
-rw-r--r--indra/newview/llhudobject.cpp8
-rw-r--r--indra/newview/llimprocessing.cpp6
-rw-r--r--indra/newview/llimview.cpp31
-rw-r--r--indra/newview/llinventorybridge.cpp4
-rw-r--r--indra/newview/llinventorymodel.cpp12
-rw-r--r--indra/newview/llmaterialeditor.cpp2
-rw-r--r--indra/newview/llmeshrepository.cpp10
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp6
-rw-r--r--indra/newview/llnotificationofferhandler.cpp9
-rw-r--r--indra/newview/llpaneleditwearable.cpp4
-rw-r--r--indra/newview/llpanelface.cpp2
-rw-r--r--indra/newview/llpanellandmarkinfo.cpp2
-rw-r--r--indra/newview/llpanellogin.cpp2
-rw-r--r--indra/newview/llpanelmediasettingsgeneral.cpp10
-rw-r--r--indra/newview/llpanelobject.cpp17
-rw-r--r--indra/newview/llpanelprofile.cpp10
-rw-r--r--indra/newview/llpanelteleporthistory.cpp4
-rw-r--r--indra/newview/llpanelvolume.cpp5
-rw-r--r--indra/newview/llperfstats.cpp22
-rw-r--r--indra/newview/llphysicsshapebuilderutil.h3
-rw-r--r--indra/newview/llpreviewgesture.cpp3
-rw-r--r--indra/newview/llpreviewscript.cpp31
-rw-r--r--indra/newview/llprogressview.cpp10
-rw-r--r--indra/newview/llselectmgr.cpp22
-rw-r--r--indra/newview/llsetkeybinddialog.cpp2
-rw-r--r--indra/newview/llsidepaneliteminfo.cpp18
-rw-r--r--indra/newview/lltexturectrl.cpp26
-rw-r--r--indra/newview/lltextureview.cpp5
-rw-r--r--indra/newview/lltoastimpanel.cpp2
-rw-r--r--indra/newview/lltooldraganddrop.cpp74
-rw-r--r--indra/newview/lltoolmgr.cpp6
-rw-r--r--indra/newview/llvieweraudio.cpp2
-rw-r--r--indra/newview/llviewercontrol.cpp14
-rw-r--r--indra/newview/llviewerdisplay.cpp4
-rw-r--r--indra/newview/llviewerjoystick.cpp6
-rw-r--r--indra/newview/llviewermenu.cpp8
-rw-r--r--indra/newview/llviewermenufile.cpp4
-rw-r--r--indra/newview/llviewermessage.cpp52
-rw-r--r--indra/newview/llviewerobject.cpp2
-rw-r--r--indra/newview/llvieweroctree.cpp6
-rw-r--r--indra/newview/llvieweroctree.h20
-rw-r--r--indra/newview/llviewerparcelmgr.cpp4
-rw-r--r--indra/newview/llviewertexteditor.cpp2
-rw-r--r--indra/newview/llviewertexture.cpp61
-rw-r--r--indra/newview/llviewertexture.h6
-rw-r--r--indra/newview/llviewertexturelist.cpp8
-rw-r--r--indra/newview/llviewerwindow.cpp34
-rw-r--r--indra/newview/llvoavatar.cpp58
-rw-r--r--indra/newview/llvoicevisualizer.cpp2
-rw-r--r--indra/newview/llvovolume.cpp11
-rwxr-xr-xindra/newview/llworldmapview.cpp2
74 files changed, 515 insertions, 576 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index efa0865b7e..e07375b0bd 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -3304,16 +3304,15 @@ void LLAgent::sendAnimationRequests(const std::vector<LLUUID> &anim_ids, EAnimRe
msg->addUUIDFast(_PREHASH_AgentID, getID());
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
- for (S32 i = 0; i < anim_ids.size(); i++)
+ for (const LLUUID& uuid : anim_ids)
{
- if (anim_ids[i].isNull())
+ if (uuid.notNull())
{
- continue;
+ msg->nextBlockFast(_PREHASH_AnimationList);
+ msg->addUUIDFast(_PREHASH_AnimID, uuid);
+ msg->addBOOLFast(_PREHASH_StartAnim, request == ANIM_REQUEST_START);
+ num_valid_anims++;
}
- msg->nextBlockFast(_PREHASH_AnimationList);
- msg->addUUIDFast(_PREHASH_AnimID, (anim_ids[i]) );
- msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? true : false);
- num_valid_anims++;
}
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
@@ -3338,8 +3337,8 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request)
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
msg->nextBlockFast(_PREHASH_AnimationList);
- msg->addUUIDFast(_PREHASH_AnimID, (anim_id) );
- msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? true : false);
+ msg->addUUIDFast(_PREHASH_AnimID, anim_id);
+ msg->addBOOLFast(_PREHASH_StartAnim, request == ANIM_REQUEST_START);
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index af5b25261d..5585d04c69 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4201,7 +4201,7 @@ U32 LLAppViewer::getObjectCacheVersion()
bool LLAppViewer::initCache()
{
mPurgeCache = false;
- bool read_only = mSecondInstance ? true : false;
+ bool read_only = mSecondInstance;
LLAppViewer::getTextureCache()->setReadOnly(read_only) ;
LLVOCache::initParamSingleton(read_only);
@@ -4226,7 +4226,7 @@ bool LLAppViewer::initCache()
if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion())
{
texture_cache_mismatch = true;
- if(!read_only)
+ if (!read_only)
{
gSavedSettings.setS32("LocalCacheVersion", LLAppViewer::getTextureCacheVersion());
@@ -4235,7 +4235,7 @@ bool LLAppViewer::initCache()
}
}
- if(!read_only)
+ if (!read_only)
{
// Purge cache if user requested it
if (gSavedSettings.getBOOL("PurgeCacheOnStartup") ||
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 1550872d81..087c25bcad 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -502,7 +502,7 @@ bool LLAvatarList::handleHover(S32 x, S32 y, MASK mask)
void LLAvatarList::setVisible(bool visible)
{
- if ( visible == false && mContextMenu )
+ if (!visible && mContextMenu )
{
mContextMenu->hide();
}
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index 57446bb7a0..354a596e46 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -342,20 +342,19 @@ bool LLFloaterIMNearbyChatToastPanel::handleMouseUp (S32 x, S32 y, MASK mask)
S32 local_x = x - mMsgText->getRect().mLeft;
S32 local_y = y - mMsgText->getRect().mBottom;
-
+
//if text_box process mouse up (ussually this is click on url) - we didn't show nearby_chat.
- if (mMsgText->pointInView(local_x, local_y) )
+ if (mMsgText->pointInView(local_x, local_y))
{
- if (mMsgText->handleMouseUp(local_x,local_y,mask) == true)
+ if (mMsgText->handleMouseUp(local_x, local_y, mask))
return true;
- else
- {
- LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat")->showHistory();
- return false;
- }
+
+ LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat")->showHistory();
+ return false;
}
+
LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat")->showHistory();
- return LLPanel::handleMouseUp(x,y,mask);
+ return LLPanel::handleMouseUp(x, y, mask);
}
void LLFloaterIMNearbyChatToastPanel::setHeaderVisibility(EShowItemHeader e)
diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp
index ce7f7eb938..4306185f0a 100644
--- a/indra/newview/lldirpicker.cpp
+++ b/indra/newview/lldirpicker.cpp
@@ -91,20 +91,19 @@ void LLDirPicker::reset()
bool LLDirPicker::getDir(std::string* filename, bool blocking)
{
- if( mLocked )
+ if (mLocked)
{
return false;
}
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
bool success = false;
-
if (blocking)
{
// Modal, so pause agent
@@ -236,7 +235,7 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking)
reset();
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 8189948f55..99494c96b8 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -832,7 +832,7 @@ bool LLDrawable::updateMoveDamped()
mVObjp->updateText();
}
- bool done_moving = (dist_squared == 0.0f) ? true : false;
+ bool done_moving = dist_squared == 0.0f;
if (done_moving)
{
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index a341e934a5..89d4e415f1 100644
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -162,20 +162,20 @@ public:
virtual bool updateMove();
virtual void movePartition();
-
+
void updateTexture();
void updateMaterial();
virtual void updateDistance(LLCamera& camera, bool force_update);
bool updateGeometry();
void updateFaceSize(S32 idx);
-
+
void updateSpecialHoverCursor(bool enabled);
virtual void shiftPos(const LLVector4a &shift_vector);
S32 getGeneration() const { return mGeneration; }
- bool getLit() const { return isState(UNLIT) ? false : true; }
+ bool getLit() const { return !isState(UNLIT); }
void setLit(bool lit) { lit ? clearState(UNLIT) : setState(UNLIT); }
bool isVisible() const;
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index d8476d39c5..b5018abc64 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -117,14 +117,14 @@ public:
U32 getState() const { return mState; }
void setState(U32 state) { mState |= state; }
void clearState(U32 state) { mState &= ~state; }
- bool isState(U32 state) const { return ((mState & state) != 0) ? true : false; }
+ bool isState(U32 state) const { return (mState & state) != 0; }
void setVirtualSize(F32 size) { mVSize = size; }
void setPixelArea(F32 area) { mPixelArea = area; }
F32 getVirtualSize() const { return mVSize; }
F32 getPixelArea() const { return mPixelArea; }
- S32 getIndexInTex(U32 ch) const {llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); return mIndexInTex[ch];}
- void setIndexInTex(U32 ch, S32 index) { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); mIndexInTex[ch] = index ;}
+ S32 getIndexInTex(U32 ch) const { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); return mIndexInTex[ch]; }
+ void setIndexInTex(U32 ch, S32 index) { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); mIndexInTex[ch] = index; }
void setWorldMatrix(const LLMatrix4& mat);
const LLTextureEntry* getTextureEntry() const { return mVObjp->getTE(mTEOffset); }
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 2df32f5b6f..6b19fe60d8 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -250,14 +250,14 @@ bool LLFilePicker::setupFilter(ELoadFilter filter)
bool LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
{
- if( mLocked )
+ if (mLocked)
{
return false;
}
bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
@@ -317,7 +317,7 @@ bool LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
@@ -403,7 +403,7 @@ bool LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename,
bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
@@ -695,18 +695,18 @@ std::unique_ptr<std::vector<std::string>> LLFilePicker::navOpenFilterProc(ELoadF
return allowedv;
}
-bool LLFilePicker::doNavChooseDialog(ELoadFilter filter)
+bool LLFilePicker::doNavChooseDialog(ELoadFilter filter)
{
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
-
+
gViewerWindow->getWindow()->beforeDialog();
-
+
std::unique_ptr<std::vector<std::string>> allowed_types = navOpenFilterProc(filter);
-
+
std::unique_ptr<std::vector<std::string>> filev = doLoadDialog(allowed_types.get(),
mPickOptions);
@@ -718,27 +718,27 @@ bool LLFilePicker::doNavChooseDialog(ELoadFilter filter)
mFiles.insert(mFiles.end(), filev->begin(), filev->end());
return true;
}
-
+
return false;
}
-bool LLFilePicker::doNavChooseDialogModeless(ELoadFilter filter,
+bool LLFilePicker::doNavChooseDialogModeless(ELoadFilter filter,
void (*callback)(bool, std::vector<std::string> &,void*),
void *userdata)
{
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
-
+
std::unique_ptr<std::vector<std::string>> allowed_types=navOpenFilterProc(filter);
-
+
doLoadDialogModeless(allowed_types.get(),
mPickOptions,
callback,
userdata);
-
+
return true;
}
@@ -826,16 +826,16 @@ void set_nav_save_data(LLFilePicker::ESaveFilter filter, std::string &extension,
}
}
-bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filename)
+bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filename)
{
// Setup the type, creator, and extension
std::string extension, type, creator;
-
+
set_nav_save_data(filter, extension, type, creator);
-
+
std::string namestring = filename;
if (namestring.empty()) namestring="Untitled";
-
+
gViewerWindow->getWindow()->beforeDialog();
// Run the dialog
@@ -852,20 +852,20 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena
mFiles.push_back(*filev);
return true;
}
-
+
return false;
}
-bool LLFilePicker::doNavSaveDialogModeless(ESaveFilter filter,
+bool LLFilePicker::doNavSaveDialogModeless(ESaveFilter filter,
const std::string& filename,
void (*callback)(bool, std::string&, void*),
void *userdata)
{
// Setup the type, creator, and extension
std::string extension, type, creator;
-
+
set_nav_save_data(filter, extension, type, creator);
-
+
std::string namestring = filename;
if (namestring.empty()) namestring="Untitled";
@@ -888,19 +888,18 @@ bool LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
reset();
-
+
mPickOptions &= ~F_MULTIPLE;
mPickOptions |= F_FILE;
-
+
if (filter == FFLOAD_DIRECTORY) //This should only be called from lldirpicker.
{
-
mPickOptions |= ( F_NAV_SUPPORT | F_DIRECTORY );
mPickOptions &= ~F_FILE;
}
@@ -940,11 +939,11 @@ bool LLFilePicker::getOpenFileModeless(ELoadFilter filter,
void (*callback)(bool, std::vector<std::string> &, void*),
void *userdata)
{
- if( mLocked )
+ if (mLocked)
return false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
@@ -971,19 +970,19 @@ bool LLFilePicker::getOpenFileModeless(ELoadFilter filter,
bool LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking)
{
- if( mLocked )
+ if (mLocked)
return false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
-
+
bool success = false;
reset();
-
+
mPickOptions |= F_FILE;
mPickOptions |= F_MULTIPLE;
@@ -1019,17 +1018,17 @@ bool LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
void (*callback)(bool, std::vector<std::string> &, void*),
void *userdata )
{
- if( mLocked )
+ if (mLocked)
return false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
reset();
-
+
mPickOptions |= F_FILE;
mPickOptions |= F_MULTIPLE;
@@ -1040,18 +1039,19 @@ bool LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter,
bool LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, bool blocking)
{
- if( mLocked )
+ if (mLocked)
return false;
+
bool success = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
reset();
-
+
mPickOptions &= ~F_MULTIPLE;
if (blocking)
@@ -1083,17 +1083,17 @@ bool LLFilePicker::getSaveFileModeless(ESaveFilter filter,
void (*callback)(bool, std::string&, void*),
void *userdata)
{
- if( mLocked )
+ if (mLocked)
return false;
-
+
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
reset();
-
+
mPickOptions &= ~F_MULTIPLE;
return doNavSaveDialogModeless(filter, filename, callback, userdata);
@@ -1372,7 +1372,7 @@ bool LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename,
bool rtn = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
@@ -1380,7 +1380,7 @@ bool LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename,
gViewerWindow->getWindow()->beforeDialog();
reset();
-
+
GtkWindow* picker = buildFilePicker(true, false, "savefile");
if (picker)
@@ -1448,7 +1448,7 @@ bool LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename,
default:;
break;
}
-
+
gtk_window_set_title(GTK_WINDOW(picker), caption.c_str());
if (filename.empty())
@@ -1489,7 +1489,7 @@ bool LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
bool rtn = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
@@ -1497,7 +1497,7 @@ bool LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
gViewerWindow->getWindow()->beforeDialog();
reset();
-
+
GtkWindow* picker = buildFilePicker(false, false, "openfile");
if (picker)
@@ -1554,7 +1554,7 @@ bool LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
bool rtn = false;
// if local file browsing is turned off, return without opening dialog
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
@@ -1591,13 +1591,13 @@ bool LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename,
{
// if local file browsing is turned off, return without opening dialog
// (Even though this is a stub, I think we still should not return anything at all)
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
reset();
-
+
LL_INFOS() << "getSaveFile suggested filename is [" << filename
<< "]" << LL_ENDL;
if (!filename.empty())
@@ -1621,13 +1621,13 @@ bool LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
{
// if local file browsing is turned off, return without opening dialog
// (Even though this is a stub, I think we still should not return anything at all)
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
reset();
-
+
// HACK: Static filenames for 'open' until we implement filepicker
std::string filename = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + "upload";
switch (filter)
@@ -1654,7 +1654,7 @@ bool LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking)
{
// if local file browsing is turned off, return without opening dialog
// (Even though this is a stub, I think we still should not return anything at all)
- if ( check_local_file_access_enabled() == false )
+ if (!check_local_file_access_enabled())
{
return false;
}
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index c619c19493..74298c2b3d 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -433,7 +433,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
LLPath *path = &volume->getPath();
if ((mSimulateRes == 0 || !mInitialized) && mVO->mDrawable->isVisible())
{
- bool force_update = mSimulateRes == 0 ? true : false;
+ bool force_update = mSimulateRes == 0;
doIdleUpdate();
if (!force_update || !gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
@@ -442,10 +442,10 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
}
}
- if(!mInitialized || !mAttributes)
+ if (!mInitialized || !mAttributes)
{
//the object is not visible
- return ;
+ return;
}
// Fix for MAINT-1894
@@ -456,7 +456,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
{
return;
}
-
+
S32 num_sections = 1 << mSimulateRes;
F32 secondsThisFrame = mTimer.getElapsedTimeAndResetF32();
diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp
index d5efc15e35..527ed62fc7 100644
--- a/indra/newview/llfloater360capture.cpp
+++ b/indra/newview/llfloater360capture.cpp
@@ -811,7 +811,7 @@ void LLFloater360Capture::freezeWorld(bool enable)
{
// restart the clouds moving if they were not paused before
// we starting using the 360 capture floater
- if (clouds_scroll_paused == false)
+ if (!clouds_scroll_paused)
{
LLEnvironment::instance().resumeCloudScroll();
}
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 00e4961f6a..befc765cb0 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -1213,7 +1213,7 @@ void LLFloaterEditExtDayCycle::updateButtons()
mDeleteFrameButton->setEnabled(can_manipulate && isRemovingFrameAllowed());
mLoadFrame->setEnabled(can_manipulate);
- bool enable_play = mEditDay ? true : false;
+ bool enable_play = (bool)mEditDay;
childSetEnabled(BTN_PLAY, enable_play);
childSetEnabled(BTN_SKIP_BACK, enable_play);
childSetEnabled(BTN_SKIP_FORWARD, enable_play);
diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp
index bfde125476..96908df2ab 100644
--- a/indra/newview/llfloateremojipicker.cpp
+++ b/indra/newview/llfloateremojipicker.cpp
@@ -832,8 +832,8 @@ void LLFloaterEmojiPicker::createEmojiIcon(const LLEmojiSearchResult& emoji,
void LLFloaterEmojiPicker::showPreview(bool show)
{
//mPreview->setIcon(nullptr);
- mDummy->setVisible(show ? false : true);
- mPreview->setVisible(show ? true : false);
+ mDummy->setVisible(show);
+ mPreview->setVisible(show);
}
void LLFloaterEmojiPicker::onGroupButtonClick(LLUICtrl* ctrl)
diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp
index 813bde0fac..da4947839f 100644
--- a/indra/newview/llfloatergodtools.cpp
+++ b/indra/newview/llfloatergodtools.cpp
@@ -718,14 +718,14 @@ void LLPanelRegionTools::setParentEstateID(U32 id)
void LLPanelRegionTools::setCheckFlags(U64 flags)
{
- getChild<LLUICtrl>("check prelude")->setValue(is_prelude(flags) ? true : false);
- getChild<LLUICtrl>("check fixed sun")->setValue(flags & REGION_FLAGS_SUN_FIXED ? true : false);
- getChild<LLUICtrl>("check reset home")->setValue(flags & REGION_FLAGS_RESET_HOME_ON_TELEPORT ? true : false);
- getChild<LLUICtrl>("check damage")->setValue(flags & REGION_FLAGS_ALLOW_DAMAGE ? true : false);
- getChild<LLUICtrl>("check visible")->setValue(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? true : false);
- getChild<LLUICtrl>("block terraform")->setValue(flags & REGION_FLAGS_BLOCK_TERRAFORM ? true : false);
- getChild<LLUICtrl>("block dwell")->setValue(flags & REGION_FLAGS_BLOCK_DWELL ? true : false);
- getChild<LLUICtrl>("is sandbox")->setValue(flags & REGION_FLAGS_SANDBOX ? true : false );
+ getChild<LLUICtrl>("check prelude")->setValue(is_prelude(flags));
+ getChild<LLUICtrl>("check fixed sun")->setValue(is_flag_set(flags, REGION_FLAGS_SUN_FIXED));
+ getChild<LLUICtrl>("check reset home")->setValue(is_flag_set(flags, REGION_FLAGS_RESET_HOME_ON_TELEPORT));
+ getChild<LLUICtrl>("check damage")->setValue(is_flag_set(flags, REGION_FLAGS_ALLOW_DAMAGE));
+ getChild<LLUICtrl>("check visible")->setValue(is_flag_set(flags, REGION_FLAGS_EXTERNALLY_VISIBLE));
+ getChild<LLUICtrl>("block terraform")->setValue(is_flag_set(flags, REGION_FLAGS_BLOCK_TERRAFORM));
+ getChild<LLUICtrl>("block dwell")->setValue(is_flag_set(flags, REGION_FLAGS_BLOCK_DWELL));
+ getChild<LLUICtrl>("is sandbox")->setValue(is_flag_set(flags, REGION_FLAGS_SANDBOX));
}
void LLPanelRegionTools::setBillableFactor(F32 billable_factor)
@@ -1004,9 +1004,9 @@ U64 LLPanelObjectTools::computeRegionFlags(U64 flags) const
void LLPanelObjectTools::setCheckFlags(U64 flags)
{
- getChild<LLUICtrl>("disable scripts")->setValue(flags & REGION_FLAGS_SKIP_SCRIPTS ? true : false);
- getChild<LLUICtrl>("disable collisions")->setValue(flags & REGION_FLAGS_SKIP_COLLISIONS ? true : false);
- getChild<LLUICtrl>("disable physics")->setValue(flags & REGION_FLAGS_SKIP_PHYSICS ? true : false);
+ getChild<LLUICtrl>("disable scripts")->setValue(is_flag_set(flags, REGION_FLAGS_SKIP_SCRIPTS));
+ getChild<LLUICtrl>("disable collisions")->setValue(is_flag_set(flags, REGION_FLAGS_SKIP_COLLISIONS));
+ getChild<LLUICtrl>("disable physics")->setValue(is_flag_set(flags, REGION_FLAGS_SKIP_PHYSICS));
}
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index baa274adad..c76c1da8d6 100644
--- a/indra/newview/llfloaterimnearbychathandler.cpp
+++ b/indra/newview/llfloaterimnearbychathandler.cpp
@@ -282,7 +282,7 @@ bool LLFloaterIMNearbyChatScreenChannel::createPoolToast()
void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
{
//look in pool. if there is any message
- if(mStopProcessing)
+ if (mStopProcessing)
return;
if (mFloaterSnapRegion == NULL)
@@ -297,7 +297,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
find last toast and check ID
*/
- if(m_active_toasts.size())
+ if (m_active_toasts.size())
{
LLUUID fromID = chat["from_id"].asUUID(); // agent id or object id
std::string from = chat["from"].asString();
@@ -306,7 +306,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
{
LLFloaterIMNearbyChatToastPanel* panel = dynamic_cast<LLFloaterIMNearbyChatToastPanel*>(toast->getPanel());
- if(panel && panel->messageID() == fromID && panel->getFromName() == from && panel->canAddText())
+ if (panel && panel->messageID() == fromID && panel->getFromName() == from && panel->canAddText())
{
panel->addMessage(chat);
toast->reshapeToPanel();
@@ -320,7 +320,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
- if(m_toast_pool.empty())
+ if (m_toast_pool.empty())
{
//"pool" is empty - create one more panel
LL_DEBUGS("NearbyChat") << "Empty pool" << LL_ENDL;
@@ -331,15 +331,14 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
}
int chat_type = chat["chat_type"].asInteger();
-
- if( ((EChatType)chat_type == CHAT_TYPE_DEBUG_MSG))
+
+ if (chat_type == CHAT_TYPE_DEBUG_MSG)
{
- if(gSavedSettings.getBOOL("ShowScriptErrors") == false)
+ if (!gSavedSettings.getBOOL("ShowScriptErrors"))
return;
- if(gSavedSettings.getS32("ShowScriptErrorsLocation")== 1)
+ if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)
return;
}
-
//take 1st element from pool, (re)initialize it, put it in active toasts
@@ -350,7 +349,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
LLFloaterIMNearbyChatToastPanel* panel = dynamic_cast<LLFloaterIMNearbyChatToastPanel*>(toast->getPanel());
- if(!panel)
+ if (!panel)
return;
panel->init(chat);
@@ -487,11 +486,11 @@ void LLFloaterIMNearbyChatHandler::initChannel()
void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
const LLSD &args)
{
- if(chat_msg.mMuted == true)
+ if (chat_msg.mMuted)
return;
- if(chat_msg.mText.empty())
- return;//don't process empty messages
+ if (chat_msg.mText.empty())
+ return; // don't process empty messages
LLFloaterReg::getInstance("im_container");
LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
@@ -522,9 +521,10 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
// errors in separate window.
if (chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG)
{
- if (LLFloater::isQuitRequested()) return;
+ if (LLFloater::isQuitRequested())
+ return;
- if(gSavedSettings.getBOOL("ShowScriptErrors") == false)
+ if (!gSavedSettings.getBOOL("ShowScriptErrors"))
return;
// don't process debug messages from not owned objects, see EXT-7762
@@ -533,7 +533,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
return;
}
- if (gSavedSettings.getS32("ShowScriptErrorsLocation")== 1)// show error in window //("ScriptErrorsAsChat"))
+ if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)// show error in window //("ScriptErrorsAsChat"))
{
LLColor4 txt_color;
@@ -550,7 +550,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
nearby_chat->addMessage(chat_msg, true, args);
- if(chat_msg.mSourceType == CHAT_SOURCE_AGENT
+ if (chat_msg.mSourceType == CHAT_SOURCE_AGENT
&& chat_msg.mFromID.notNull()
&& chat_msg.mFromID != gAgentID)
{
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 9b1fc96706..9a7737657d 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -473,7 +473,7 @@ void LLFloaterIMSessionTab::onInputEditorClicked()
void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked()
{
- bool show = mEmojiRecentPanel->getVisible() ? false : true;
+ bool show = !mEmojiRecentPanel->getVisible();
if (show)
{
initEmojiRecentPanel();
diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp
index 1cd46cdd44..c258da6640 100644
--- a/indra/newview/llfloaterlagmeter.cpp
+++ b/indra/newview/llfloaterlagmeter.cpp
@@ -179,10 +179,6 @@ void LLFloaterLagMeter::determineClient()
{
mClientCause->setText( getString("client_texture_loading_cause_msg", mStringArgs) );
}
- else if(LLViewerTexture::isMemoryForTextureLow())
- {
- mClientCause->setText( getString("client_texture_memory_cause_msg", mStringArgs) );
- }
else
{
mClientCause->setText( getString("client_complex_objects_cause_msg", mStringArgs) );
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index b1db7bc4f4..b503fc3630 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1244,7 +1244,7 @@ void LLFloaterPreference::refreshEnabledState()
ctrl_pbr->setEnabled(true);
// Cannot have floater active until caps have been received
- getChild<LLButton>("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() < STATE_STARTED ? false : true);
+ getChild<LLButton>("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() >= STATE_STARTED);
getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess());
}
@@ -3281,9 +3281,9 @@ void LLFloaterPreferenceProxy::onChangeSocksSettings()
// Check for invalid states for the other HTTP proxy radio
LLRadioGroup* otherHttpProxy = getChild<LLRadioGroup>("other_http_proxy_type");
if ((otherHttpProxy->getSelectedValue().asString() == "Socks" &&
- getChild<LLCheckBoxCtrl>("socks_proxy_enabled")->get() == false )||(
+ !getChild<LLCheckBoxCtrl>("socks_proxy_enabled")->get())||(
otherHttpProxy->getSelectedValue().asString() == "Web" &&
- getChild<LLCheckBoxCtrl>("web_proxy_enabled")->get() == false ) )
+ !getChild<LLCheckBoxCtrl>("web_proxy_enabled")->get()))
{
otherHttpProxy->selectFirstItem();
}
@@ -3292,10 +3292,10 @@ void LLFloaterPreferenceProxy::onChangeSocksSettings()
void LLFloaterPreference::onUpdateFilterTerm(bool force)
{
- LLWString seachValue = utf8str_to_wstring( mFilterEdit->getValue() );
- LLWStringUtil::toLower( seachValue );
+ LLWString seachValue = utf8str_to_wstring(mFilterEdit->getValue());
+ LLWStringUtil::toLower(seachValue);
- if( !mSearchData || (mSearchData->mLastFilter == seachValue && !force))
+ if (!mSearchData || (mSearchData->mLastFilter == seachValue && !force))
return;
if (mSearchDataDirty)
@@ -3306,14 +3306,13 @@ void LLFloaterPreference::onUpdateFilterTerm(bool force)
mSearchData->mLastFilter = seachValue;
- if( !mSearchData->mRootTab )
+ if (!mSearchData->mRootTab)
return;
mSearchData->mRootTab->hightlightAndHide( seachValue );
filterIgnorableNotifications();
- LLTabContainer *pRoot = getChild< LLTabContainer >( "pref core" );
- if( pRoot )
+ if (LLTabContainer* pRoot = getChild<LLTabContainer>("pref core"))
pRoot->selectFirstTab();
}
@@ -3330,72 +3329,69 @@ void LLFloaterPreference::filterIgnorableNotifications()
void collectChildren( LLView const *aView, ll::prefs::PanelDataPtr aParentPanel, ll::prefs::TabContainerDataPtr aParentTabContainer )
{
- if( !aView )
+ if (!aView)
return;
- llassert_always( aParentPanel || aParentTabContainer );
-
- LLView::child_list_const_iter_t itr = aView->beginChild();
- LLView::child_list_const_iter_t itrEnd = aView->endChild();
+ llassert_always(aParentPanel || aParentTabContainer);
- while( itr != itrEnd )
+ for (LLView* pView : *aView->getChildList())
{
- LLView *pView = *itr;
+ if (!pView)
+ continue;
+
ll::prefs::PanelDataPtr pCurPanelData = aParentPanel;
ll::prefs::TabContainerDataPtr pCurTabContainer = aParentTabContainer;
- if( !pView )
- continue;
- LLPanel const *pPanel = dynamic_cast< LLPanel const *>( pView );
- LLTabContainer const *pTabContainer = dynamic_cast< LLTabContainer const *>( pView );
- ll::ui::SearchableControl const *pSCtrl = dynamic_cast< ll::ui::SearchableControl const *>( pView );
- if( pTabContainer )
+ LLPanel const *pPanel = dynamic_cast<LLPanel const*>(pView);
+ LLTabContainer const *pTabContainer = dynamic_cast<LLTabContainer const*>(pView);
+ ll::ui::SearchableControl const *pSCtrl = dynamic_cast<ll::ui::SearchableControl const*>( pView );
+
+ if (pTabContainer)
{
pCurPanelData.reset();
- pCurTabContainer = ll::prefs::TabContainerDataPtr( new ll::prefs::TabContainerData );
- pCurTabContainer->mTabContainer = const_cast< LLTabContainer *>( pTabContainer );
+ pCurTabContainer = ll::prefs::TabContainerDataPtr(new ll::prefs::TabContainerData);
+ pCurTabContainer->mTabContainer = const_cast< LLTabContainer *>(pTabContainer);
pCurTabContainer->mLabel = pTabContainer->getLabel();
pCurTabContainer->mPanel = 0;
- if( aParentPanel )
- aParentPanel->mChildPanel.push_back( pCurTabContainer );
- if( aParentTabContainer )
- aParentTabContainer->mChildPanel.push_back( pCurTabContainer );
+ if (aParentPanel)
+ aParentPanel->mChildPanel.push_back(pCurTabContainer);
+ if (aParentTabContainer)
+ aParentTabContainer->mChildPanel.push_back(pCurTabContainer);
}
- else if( pPanel )
+ else if (pPanel)
{
pCurTabContainer.reset();
- pCurPanelData = ll::prefs::PanelDataPtr( new ll::prefs::PanelData );
+ pCurPanelData = ll::prefs::PanelDataPtr(new ll::prefs::PanelData);
pCurPanelData->mPanel = pPanel;
pCurPanelData->mLabel = pPanel->getLabel();
llassert_always( aParentPanel || aParentTabContainer );
- if( aParentTabContainer )
- aParentTabContainer->mChildPanel.push_back( pCurPanelData );
- else if( aParentPanel )
- aParentPanel->mChildPanel.push_back( pCurPanelData );
+ if (aParentTabContainer)
+ aParentTabContainer->mChildPanel.push_back(pCurPanelData);
+ else if (aParentPanel)
+ aParentPanel->mChildPanel.push_back(pCurPanelData);
}
- else if( pSCtrl && pSCtrl->getSearchText().size() )
+ else if (pSCtrl && pSCtrl->getSearchText().size())
{
- ll::prefs::SearchableItemPtr item = ll::prefs::SearchableItemPtr( new ll::prefs::SearchableItem() );
+ ll::prefs::SearchableItemPtr item = ll::prefs::SearchableItemPtr(new ll::prefs::SearchableItem());
item->mView = pView;
item->mCtrl = pSCtrl;
- item->mLabel = utf8str_to_wstring( pSCtrl->getSearchText() );
- LLWStringUtil::toLower( item->mLabel );
+ item->mLabel = utf8str_to_wstring(pSCtrl->getSearchText());
+ LLWStringUtil::toLower(item->mLabel);
- llassert_always( aParentPanel || aParentTabContainer );
+ llassert_always(aParentPanel || aParentTabContainer);
- if( aParentPanel )
- aParentPanel->mChildren.push_back( item );
- if( aParentTabContainer )
- aParentTabContainer->mChildren.push_back( item );
+ if (aParentPanel)
+ aParentPanel->mChildren.push_back(item);
+ if (aParentTabContainer)
+ aParentTabContainer->mChildren.push_back(item);
}
- collectChildren( pView, pCurPanelData, pCurTabContainer );
- ++itr;
+ collectChildren(pView, pCurPanelData, pCurTabContainer);
}
}
diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
index 6741dbb7e4..25ee834109 100644
--- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
+++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
@@ -390,7 +390,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()
// Bump & Shiny
LLCheckBoxCtrl* bumpshiny_ctrl = getChild<LLCheckBoxCtrl>("BumpShiny");
bool bumpshiny = LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump");
- bumpshiny_ctrl->setEnabled(bumpshiny ? true : false);
+ bumpshiny_ctrl->setEnabled(bumpshiny);
// Avatar Mode
// Enable Avatar Shaders
@@ -402,19 +402,12 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()
if (LLViewerShaderMgr::sInitialized)
{
S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel;
- avatar_vp_enabled = (max_avatar_shader > 0) ? true : false;
+ avatar_vp_enabled = max_avatar_shader > 0;
}
ctrl_avatar_vp->setEnabled(avatar_vp_enabled);
- if (gSavedSettings.getBOOL("RenderAvatarVP") == false)
- {
- ctrl_avatar_cloth->setEnabled(false);
- }
- else
- {
- ctrl_avatar_cloth->setEnabled(true);
- }
+ ctrl_avatar_cloth->setEnabled(gSavedSettings.getBOOL("RenderAvatarVP"));
// Vertex Shaders, Global Shader Enable
// SL-12594 Basic shaders are always enabled. DJH TODO clean up now-orphaned state handling code
@@ -438,8 +431,8 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
- ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? true : false) &&
- (ctrl_wind_light->get()) ? true : false;
+ bumpshiny_ctrl && bumpshiny_ctrl->get() &&
+ ctrl_wind_light->get();
ctrl_deferred->setEnabled(enabled);
#endif
@@ -455,7 +448,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()
LLTextBox* shadow_text = getChild<LLTextBox>("RenderShadowDetailText");
// note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it
- enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO");// && (ctrl_deferred->get() ? true : false);
+ enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO");// && ctrl_deferred->get();
//ctrl_deferred->set(gSavedSettings.getBOOL("RenderDeferred"));
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 4105cf0d10..780f4451cb 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -497,17 +497,17 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
panel->getChild<LLUICtrl>("region_type")->setValue(LLSD(sim_type));
panel->getChild<LLUICtrl>("version_channel_text")->setValue(gLastVersionChannel);
- panel->getChild<LLUICtrl>("block_terraform_check")->setValue((region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? true : false );
- panel->getChild<LLUICtrl>("block_fly_check")->setValue((region_flags & REGION_FLAGS_BLOCK_FLY) ? true : false );
- panel->getChild<LLUICtrl>("block_fly_over_check")->setValue((region_flags & REGION_FLAGS_BLOCK_FLYOVER) ? true : false );
- panel->getChild<LLUICtrl>("allow_damage_check")->setValue((region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? true : false );
- panel->getChild<LLUICtrl>("restrict_pushobject")->setValue((region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? true : false );
- panel->getChild<LLUICtrl>("allow_land_resell_check")->setValue((region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? false : true );
- panel->getChild<LLUICtrl>("allow_parcel_changes_check")->setValue((region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? true : false );
- panel->getChild<LLUICtrl>("block_parcel_search_check")->setValue((region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? true : false );
- panel->getChild<LLUICtrl>("agent_limit_spin")->setValue(LLSD((F32)agent_limit) );
- panel->getChild<LLUICtrl>("object_bonus_spin")->setValue(LLSD(object_bonus_factor) );
- panel->getChild<LLUICtrl>("access_combo")->setValue(LLSD(sim_access) );
+ panel->getChild<LLUICtrl>("block_terraform_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_TERRAFORM));
+ panel->getChild<LLUICtrl>("block_fly_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_FLY));
+ panel->getChild<LLUICtrl>("block_fly_over_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_FLYOVER));
+ panel->getChild<LLUICtrl>("allow_damage_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_ALLOW_DAMAGE));
+ panel->getChild<LLUICtrl>("restrict_pushobject")->setValue(is_flag_set(region_flags, REGION_FLAGS_RESTRICT_PUSHOBJECT));
+ panel->getChild<LLUICtrl>("allow_land_resell_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_LAND_RESELL));
+ panel->getChild<LLUICtrl>("allow_parcel_changes_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_ALLOW_PARCEL_CHANGES));
+ panel->getChild<LLUICtrl>("block_parcel_search_check")->setValue(is_flag_set(region_flags, REGION_FLAGS_BLOCK_PARCEL_SEARCH));
+ panel->getChild<LLUICtrl>("agent_limit_spin")->setValue(LLSD((F32)agent_limit));
+ panel->getChild<LLUICtrl>("object_bonus_spin")->setValue(LLSD(object_bonus_factor));
+ panel->getChild<LLUICtrl>("access_combo")->setValue(LLSD(sim_access));
panel->getChild<LLSpinCtrl>("agent_limit_spin")->setMaxValue(hard_agent_limit);
@@ -530,9 +530,9 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
panel = tab->getChild<LLPanel>("Debug");
panel->getChild<LLUICtrl>("region_text")->setValue(LLSD(sim_name) );
- panel->getChild<LLUICtrl>("disable_scripts_check")->setValue(LLSD((bool)((region_flags & REGION_FLAGS_SKIP_SCRIPTS) ? true : false )) );
- panel->getChild<LLUICtrl>("disable_collisions_check")->setValue(LLSD((bool)((region_flags & REGION_FLAGS_SKIP_COLLISIONS) ? true : false )) );
- panel->getChild<LLUICtrl>("disable_physics_check")->setValue(LLSD((bool)((region_flags & REGION_FLAGS_SKIP_PHYSICS) ? true : false )) );
+ panel->getChild<LLUICtrl>("disable_scripts_check")->setValue(LLSD((bool)(region_flags & REGION_FLAGS_SKIP_SCRIPTS)));
+ panel->getChild<LLUICtrl>("disable_collisions_check")->setValue(LLSD((bool)(region_flags & REGION_FLAGS_SKIP_COLLISIONS)));
+ panel->getChild<LLUICtrl>("disable_physics_check")->setValue(LLSD((bool)(region_flags & REGION_FLAGS_SKIP_PHYSICS)));
panel->setCtrlsEnabled(allow_modify);
// TERRAIN PANEL
@@ -2194,7 +2194,7 @@ void LLPanelEstateInfo::refresh()
getChildView("limit_bots")->setEnabled(public_access);
// if this is set to false, then the limit fields are meaningless and should be turned off
- if (public_access == false)
+ if (!public_access)
{
getChild<LLUICtrl>("limit_payment")->setValue(false);
getChild<LLUICtrl>("limit_age_verified")->setValue(false);
@@ -3133,19 +3133,24 @@ void LLPanelEstateAccess::updateControls(LLViewerRegion* region)
bool manager = (region && region->isEstateManager());
bool enable_cotrols = god || owner || manager;
setCtrlsEnabled(enable_cotrols);
-
- bool has_allowed_avatar = getChild<LLNameListCtrl>("allowed_avatar_name_list")->getFirstSelected() ? true : false;
- bool has_allowed_group = getChild<LLNameListCtrl>("allowed_group_name_list")->getFirstSelected() ? true : false;
- bool has_banned_agent = getChild<LLNameListCtrl>("banned_avatar_name_list")->getFirstSelected() ? true : false;
- bool has_estate_manager = getChild<LLNameListCtrl>("estate_manager_name_list")->getFirstSelected() ? true : false;
+
+ LLNameListCtrl* allowedAvatars = getChild<LLNameListCtrl>("allowed_avatar_name_list");
+ LLNameListCtrl* allowedGroups = getChild<LLNameListCtrl>("allowed_group_name_list");
+ LLNameListCtrl* bannedAvatars = getChild<LLNameListCtrl>("banned_avatar_name_list");
+ LLNameListCtrl* estateManagers = getChild<LLNameListCtrl>("estate_manager_name_list");
+
+ bool has_allowed_avatar = allowedAvatars->getFirstSelected();
+ bool has_allowed_group = allowedGroups->getFirstSelected();
+ bool has_banned_agent = bannedAvatars->getFirstSelected();
+ bool has_estate_manager = estateManagers->getFirstSelected();
getChildView("add_allowed_avatar_btn")->setEnabled(enable_cotrols);
getChildView("remove_allowed_avatar_btn")->setEnabled(has_allowed_avatar && enable_cotrols);
- getChildView("allowed_avatar_name_list")->setEnabled(enable_cotrols);
+ allowedAvatars->setEnabled(enable_cotrols);
getChildView("add_allowed_group_btn")->setEnabled(enable_cotrols);
getChildView("remove_allowed_group_btn")->setEnabled(has_allowed_group && enable_cotrols);
- getChildView("allowed_group_name_list")->setEnabled(enable_cotrols);
+ allowedGroups->setEnabled(enable_cotrols);
// Can't ban people from mainland, orientation islands, etc. because this
// creates much network traffic and server load.
@@ -3154,12 +3159,12 @@ void LLPanelEstateAccess::updateControls(LLViewerRegion* region)
bool enable_ban = enable_cotrols && !linden_estate;
getChildView("add_banned_avatar_btn")->setEnabled(enable_ban);
getChildView("remove_banned_avatar_btn")->setEnabled(has_banned_agent && enable_ban);
- getChildView("banned_avatar_name_list")->setEnabled(enable_cotrols);
+ bannedAvatars->setEnabled(enable_cotrols);
// estate managers can't add estate managers
getChildView("add_estate_manager_btn")->setEnabled(god || owner);
getChildView("remove_estate_manager_btn")->setEnabled(has_estate_manager && (god || owner));
- getChildView("estate_manager_name_list")->setEnabled(god || owner);
+ estateManagers->setEnabled(god || owner);
if (enable_cotrols != mCtrlsEnabled)
{
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp
index de37c92326..ce9e1b13b6 100644
--- a/indra/newview/llfloaterurlentry.cpp
+++ b/indra/newview/llfloaterurlentry.cpp
@@ -71,7 +71,7 @@ bool LLFloaterURLEntry::postBuild()
childSetAction("clear_btn", onBtnClear, this);
// clear media list button
LLSD parcel_history = LLURLHistory::getURLHistory("parcel");
- bool enable_clear_button = parcel_history.size() > 0 ? true : false;
+ bool enable_clear_button = parcel_history.size() > 0;
getChildView("clear_btn")->setEnabled(enable_clear_button );
// OK button
diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp
index ca3f670518..fc8e1f3d26 100644
--- a/indra/newview/llfriendcard.cpp
+++ b/indra/newview/llfriendcard.cpp
@@ -177,7 +177,7 @@ void LLFriendCardsManager::putAvatarData(const LLUUID& avatarID)
LL_INFOS() << "Store avatar data, avatarID: " << avatarID << LL_ENDL;
std::pair< avatar_uuid_set_t::iterator, bool > pr;
pr = mBuddyIDSet.insert(avatarID);
- if (pr.second == false)
+ if (!pr.second)
{
LL_WARNS() << "Trying to add avatar UUID for the stored avatar: "
<< avatarID
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index 90575ccda6..8224171297 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -247,7 +247,7 @@ void LLHUDNameTag::renderText(bool for_select)
{
return;
}
-
+
if (for_select)
{
gGL.getTexUnit(0)->disable();
@@ -257,8 +257,8 @@ void LLHUDNameTag::renderText(bool for_select)
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
}
- LLGLState gls_blend(GL_BLEND, for_select ? false : true);
-
+ LLGLState gls_blend(GL_BLEND, !for_select);
+
LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f);
F32 alpha_factor = 1.f;
LLColor4 text_color = mColor;
diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp
index 08a763bcec..7fe313e3b0 100644
--- a/indra/newview/llhudobject.cpp
+++ b/indra/newview/llhudobject.cpp
@@ -52,13 +52,13 @@ struct hud_object_further_away
bool hud_object_further_away::operator()(const LLPointer<LLHUDObject>& lhs, const LLPointer<LLHUDObject>& rhs) const
{
- return (lhs->getDistance() > rhs->getDistance()) ? true : false;
+ return lhs->getDistance() > rhs->getDistance();
}
-LLHUDObject::LLHUDObject(const U8 type) :
- mPositionGlobal(),
- mSourceObject(NULL),
+LLHUDObject::LLHUDObject(const U8 type) :
+ mPositionGlobal(),
+ mSourceObject(NULL),
mTargetObject(NULL)
{
mVisible = true;
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index 5516a8fc61..44705acb07 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -278,7 +278,7 @@ void inventory_offer_handler(LLOfferInfo* info)
p.name = info->mFromID == gAgentID ? "OwnObjectGiveItem" : "ObjectGiveItem";
// Pop up inv offer chiclet and let the user accept (keep), or reject (and silently delete) the inventory.
- LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, info->mFromGroup == true);
+ LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, info->mFromGroup);
}
else // Agent -> Agent Inventory Offer
{
@@ -450,7 +450,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
// object IMs contain sender object id in session_id (STORM-1209)
|| (dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id));
bool is_owned_by_me = false;
- bool is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true;
+ bool is_friend = LLAvatarTracker::instance().getBuddyInfo(from_id) != NULL;
bool accept_im_from_only_friend = gSavedPerAccountSettings.getBOOL("VoiceCallsFriendsOnly");
bool is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT &&
LLMuteList::isLinden(name);
@@ -640,7 +640,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
{
// aux_id contains group id, binary bucket contains name and asset type
group_id = aux_id;
- has_inventory = binary_bucket_size > 1 ? true : false;
+ has_inventory = binary_bucket_size > 1;
from_group = true; // inaccurate value correction
if (has_inventory)
{
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 808b9511e0..10fe740138 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -206,26 +206,26 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg)
if (msg["source_type"].asInteger() == CHAT_SOURCE_OBJECT)
{
user_preferences = gSavedSettings.getString("NotificationObjectIMOptions");
- if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundObjectIM") == true))
+ if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundObjectIM")))
{
make_ui_sound("UISndNewIncomingIMSession");
}
}
else
{
- user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions");
- if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNearbyChatIM") == true))
+ user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions");
+ if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNearbyChatIM")))
{
make_ui_sound("UISndNewIncomingIMSession");
- }
+ }
}
}
- else if(session->isP2PSessionType())
+ else if (session->isP2PSessionType())
{
if (LLAvatarTracker::instance().isBuddy(participant_id))
{
user_preferences = gSavedSettings.getString("NotificationFriendIMOptions");
- if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundFriendIM") == true))
+ if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundFriendIM")))
{
make_ui_sound("UISndNewIncomingIMSession");
}
@@ -233,24 +233,24 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg)
else
{
user_preferences = gSavedSettings.getString("NotificationNonFriendIMOptions");
- if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNonFriendIM") == true))
+ if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNonFriendIM")))
{
make_ui_sound("UISndNewIncomingIMSession");
- }
- }
+ }
+ }
}
- else if(session->isAdHocSessionType())
+ else if (session->isAdHocSessionType())
{
user_preferences = gSavedSettings.getString("NotificationConferenceIMOptions");
- if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundConferenceIM") == true))
+ if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundConferenceIM")))
{
make_ui_sound("UISndNewIncomingIMSession");
- }
+ }
}
else if(session->isGroupSessionType())
{
user_preferences = gSavedSettings.getString("NotificationGroupChatOptions");
- if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundGroupChatIM") == true))
+ if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundGroupChatIM")))
{
make_ui_sound("UISndNewIncomingIMSession");
}
@@ -300,8 +300,7 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg)
else
{
store_dnd_message = true;
- }
-
+ }
}
// 2. Flash line item
@@ -3170,7 +3169,7 @@ void LLIMMgr::addMessage(
}
//Play sound for new conversations
- if (!skip_message & !gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation") == true))
+ if (!skip_message & !gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation")))
{
make_ui_sound("UISndNewIncomingIMSession");
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index f865f9e29b..909b7b01ea 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4250,7 +4250,7 @@ bool LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv
item_array,
LLInventoryModel::EXCLUDE_TRASH,
is_type);
- return ((item_array.size() > 0) ? true : false );
+ return !item_array.empty();
}
void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items, menuentry_vec_t& disabled_items)
@@ -6628,7 +6628,7 @@ LLObjectBridge::LLObjectBridge(LLInventoryPanel* inventory,
LLItemBridge(inventory, root, uuid)
{
mAttachPt = (flags & 0xff); // low bye of inventory flags
- mIsMultiObject = ( flags & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) ? true: false;
+ mIsMultiObject = is_flag_set(flags, LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS);
mInvType = type;
}
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 591e8c8dc4..b8bef6361f 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1593,7 +1593,7 @@ LLInventoryModel::cat_array_t* LLInventoryModel::getUnlockedCatArray(const LLUUI
cat_array_t* cat_array = get_ptr_in_map(mParentChildCategoryTree, id);
if (cat_array)
{
- llassert_always(mCategoryLock[id] == false);
+ llassert_always(!mCategoryLock[id]);
}
return cat_array;
}
@@ -1603,7 +1603,7 @@ LLInventoryModel::item_array_t* LLInventoryModel::getUnlockedItemArray(const LLU
item_array_t* item_array = get_ptr_in_map(mParentChildItemTree, id);
if (item_array)
{
- llassert_always(mItemLock[id] == false);
+ llassert_always(!mItemLock[id]);
}
return item_array;
}
@@ -1675,8 +1675,8 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat, U32
}
// make space in the tree for this category's children.
- llassert_always(mCategoryLock[new_cat->getUUID()] == false);
- llassert_always(mItemLock[new_cat->getUUID()] == false);
+ llassert_always(!mCategoryLock[new_cat->getUUID()]);
+ llassert_always(!mItemLock[new_cat->getUUID()]);
cat_array_t* catsp = new cat_array_t;
item_array_t* itemsp = new item_array_t;
mParentChildCategoryTree[new_cat->getUUID()] = catsp;
@@ -2955,13 +2955,13 @@ void LLInventoryModel::buildParentChildMap()
cats.push_back(cat);
if (mParentChildCategoryTree.count(cat->getUUID()) == 0)
{
- llassert_always(mCategoryLock[cat->getUUID()] == false);
+ llassert_always(!mCategoryLock[cat->getUUID()]);
catsp = new cat_array_t;
mParentChildCategoryTree[cat->getUUID()] = catsp;
}
if (mParentChildItemTree.count(cat->getUUID()) == 0)
{
- llassert_always(mItemLock[cat->getUUID()] == false);
+ llassert_always(!mItemLock[cat->getUUID()]);
itemsp = new item_array_t;
mParentChildItemTree[cat->getUUID()] = itemsp;
}
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index 0dbd3e2df2..ea295867cb 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -2656,7 +2656,7 @@ const std::string LLMaterialEditor::getImageNameFromUri(std::string image_uri, c
}
// uri doesn't include the type at all
- if (name_includes_type == false)
+ if (!name_includes_type)
{
// uri doesn't include the type and the uri is not empty
// so we can include everything
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 20274888df..9a2f47cc8d 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1355,7 +1355,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id, bool can_retry)
{
//check cache for mesh skin info
LLFileSystem file(mesh_id, LLAssetType::AT_MESH);
- if (file.getSize() >= offset+size)
+ if (file.getSize() >= offset + size)
{
U8* buffer = new(std::nothrow) U8[size];
if (!buffer)
@@ -1372,7 +1372,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id, bool can_retry)
bool zero = true;
for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
{
- zero = buffer[i] > 0 ? false : true;
+ zero = buffer[i] == 0;
}
if (!zero)
@@ -1486,7 +1486,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
bool zero = true;
for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
{
- zero = buffer[i] > 0 ? false : true;
+ zero = buffer[i] == 0;
}
if (!zero)
@@ -1584,7 +1584,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
bool zero = true;
for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
{
- zero = buffer[i] > 0 ? false : true;
+ zero = buffer[i] == 0;
}
if (!zero)
@@ -1784,7 +1784,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
bool zero = true;
for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
{
- zero = buffer[i] > 0 ? false : true;
+ zero = buffer[i] == 0;
}
if (!zero)
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index 01a1361ceb..739144a377 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -60,11 +60,9 @@ bool LLHandlerUtil::isIMFloaterOpened(const LLNotificationPtr& notification)
LLUUID from_id = notification->getPayload()["from_id"];
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id);
- LLFloaterIMSession* im_floater = LLFloaterReg::findTypedInstance<LLFloaterIMSession>("impanel", session_id);
-
- if (im_floater != NULL)
+ if (LLFloaterIMSession* im_floater = LLFloaterReg::findTypedInstance<LLFloaterIMSession>("impanel", session_id))
{
- res = im_floater->getVisible() == true;
+ res = im_floater->getVisible();
}
return res;
diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp
index 3f22467544..578af50ed8 100644
--- a/indra/newview/llnotificationofferhandler.cpp
+++ b/indra/newview/llnotificationofferhandler.cpp
@@ -70,20 +70,19 @@ void LLOfferHandler::initChannel()
//--------------------------------------------------------------------------
bool LLOfferHandler::processNotification(const LLNotificationPtr& notification, bool should_log)
{
- if(mChannel.isDead())
+ if (mChannel.isDead())
{
return false;
}
// arrange a channel on a screen
- if(!mChannel.get()->getVisible())
+ if (!mChannel.get()->getVisible())
{
initChannel();
}
-
- if( notification->getPayload().has("give_inventory_notification")
- && notification->getPayload()["give_inventory_notification"].asBoolean() == false)
+ if (notification->getPayload().has("give_inventory_notification") &&
+ !notification->getPayload()["give_inventory_notification"].asBoolean())
{
// This is an original inventory offer, so add a script floater
LLScriptFloaterManager::instance().onAddNotification(notification->getID());
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 5a4dfd5458..6890469131 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -1344,7 +1344,7 @@ void LLPanelEditWearable::updateTypeSpecificControls(LLWearableType::EType type)
{
// Update avatar height
F32 new_size = gAgentAvatarp->mBodySize.mV[VZ];
- if (gSavedSettings.getBOOL("HeightUnits") == false)
+ if (!gSavedSettings.getBOOL("HeightUnits"))
{
// convert meters to feet
new_size = new_size / ONE_FOOT;
@@ -1668,7 +1668,7 @@ public:
bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web)
{
// change height units true for meters and false for feet
- bool new_value = (gSavedSettings.getBOOL("HeightUnits") == false) ? true : false;
+ bool new_value = !gSavedSettings.getBOOL("HeightUnits");
gSavedSettings.setBOOL("HeightUnits", new_value);
return true;
}
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index c9db4ae998..c639cfec5d 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -2000,7 +2000,7 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
{
LLSelectedTE::getPbrMaterialId(pbr_id, identical_pbr, has_pbr_material, has_faces_without_pbr);
- pbr_ctrl->setTentative(identical_pbr ? false : true);
+ pbr_ctrl->setTentative(!identical_pbr);
pbr_ctrl->setEnabled(settable);
pbr_ctrl->setImageAssetID(pbr_id);
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index 24b0074bb0..e4022494de 100644
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -353,7 +353,7 @@ void LLPanelLandmarkInfo::toggleLandmarkEditMode(bool enabled)
mLandmarkTitle->setText(mLandmarkTitleEditor->getText());
}
- if (mNotesEditor->getReadOnly() == (enabled == true))
+ if (mNotesEditor->getReadOnly() == enabled)
{
mLandmarkTitle->setVisible(!enabled);
mLandmarkTitleEditor->setVisible(enabled);
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 97c192d87d..06cfd5b23c 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -1117,7 +1117,7 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
{
LLPanelLogin *self = (LLPanelLogin *)user_data;
self->mPasswordModified = true;
- if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == false)
+ if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && !sCapslockDidNotification)
{
// *TODO: use another way to notify user about enabled caps lock, see EXT-6858
sCapslockDidNotification = true;
diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp
index ffbf91b522..db421708ee 100644
--- a/indra/newview/llpanelmediasettingsgeneral.cpp
+++ b/indra/newview/llpanelmediasettingsgeneral.cpp
@@ -121,7 +121,7 @@ void LLPanelMediaSettingsGeneral::draw()
checkHomeUrlPassesWhitelist();
// enable/disable pixel values image entry based on auto scale checkbox
- if ( mAutoScale->getValue().asBoolean() == false )
+ if (!mAutoScale->getValue().asBoolean())
{
getChildView( LLMediaEntry::WIDTH_PIXELS_KEY )->setEnabled( true );
getChildView( LLMediaEntry::HEIGHT_PIXELS_KEY )->setEnabled( true );
@@ -134,10 +134,9 @@ void LLPanelMediaSettingsGeneral::draw()
// enable/disable UI based on type of media
bool reset_button_is_active = true;
- if( mPreviewMedia )
+ if (mPreviewMedia)
{
- LLPluginClassMedia* media_plugin = mPreviewMedia->getMediaPlugin();
- if( media_plugin )
+ if (LLPluginClassMedia* media_plugin = mPreviewMedia->getMediaPlugin())
{
// turn off volume (if we can) for preview. Note: this really only
// works for QuickTime movies right now - no way to control the
@@ -147,8 +146,7 @@ void LLPanelMediaSettingsGeneral::draw()
// some controls are only appropriate for time or browser type plugins
// so we selectively enable/disable them - need to do it in draw
// because the information from plugins arrives assynchronously
- bool show_time_controls = media_plugin->pluginSupportsMediaTime();
- if ( show_time_controls )
+ if (media_plugin->pluginSupportsMediaTime())
{
getChildView( LLMediaEntry::CURRENT_URL_KEY )->setEnabled( false );
reset_button_is_active = false;
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index ac0b5d40a4..b06f41b920 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -1766,30 +1766,39 @@ void LLPanelObject::sendSculpt()
LLUUID sculpt_id = LLUUID::null;
if (mCtrlSculptTexture)
+ {
sculpt_id = mCtrlSculptTexture->getImageAssetID();
+ }
U8 sculpt_type = 0;
if (mCtrlSculptType)
+ {
sculpt_type |= mCtrlSculptType->getValue().asInteger();
+ }
bool enabled = sculpt_type != LL_SCULPT_TYPE_MESH;
if (mCtrlSculptMirror)
{
- mCtrlSculptMirror->setEnabled(enabled ? true : false);
+ mCtrlSculptMirror->setEnabled(enabled);
}
+
if (mCtrlSculptInvert)
{
- mCtrlSculptInvert->setEnabled(enabled ? true : false);
+ mCtrlSculptInvert->setEnabled(enabled);
}
-
+
if ((mCtrlSculptMirror) && (mCtrlSculptMirror->get()))
+ {
sculpt_type |= LL_SCULPT_FLAG_MIRROR;
+ }
if ((mCtrlSculptInvert) && (mCtrlSculptInvert->get()))
+ {
sculpt_type |= LL_SCULPT_FLAG_INVERT;
-
+ }
+
sculpt_params.setSculptTexture(sculpt_id, sculpt_type);
mObject->setParameterEntry(LLNetworkData::PARAMS_SCULPT, sculpt_params, true);
}
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 3a26fb086b..0fc2ad4d6d 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -779,11 +779,11 @@ void LLFloaterProfilePermissions::fillRightsData()
{
S32 rights = relation->getRightsGrantedTo();
- bool see_online = LLRelationship::GRANT_ONLINE_STATUS & rights ? true : false;
+ bool see_online = LLRelationship::GRANT_ONLINE_STATUS & rights;
mOnlineStatus->setValue(see_online);
mMapRights->setEnabled(see_online);
- mMapRights->setValue(LLRelationship::GRANT_MAP_LOCATION & rights ? true : false);
- mEditObjectRights->setValue(LLRelationship::GRANT_MODIFY_OBJECTS & rights ? true : false);
+ mMapRights->setValue(LLRelationship::GRANT_MAP_LOCATION & rights);
+ mEditObjectRights->setValue(LLRelationship::GRANT_MODIFY_OBJECTS & rights);
}
else
{
@@ -798,7 +798,7 @@ void LLFloaterProfilePermissions::rightsConfirmationCallback(const LLSD& notific
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option != 0) // canceled
{
- mEditObjectRights->setValue(mEditObjectRights->getValue().asBoolean() ? false : true);
+ mEditObjectRights->setValue(!mEditObjectRights->getValue().asBoolean());
}
else
{
@@ -824,7 +824,7 @@ void LLFloaterProfilePermissions::onCommitSeeOnlineRights()
if (relation)
{
S32 rights = relation->getRightsGrantedTo();
- mMapRights->setValue(LLRelationship::GRANT_MAP_LOCATION & rights ? true : false);
+ mMapRights->setValue(LLRelationship::GRANT_MAP_LOCATION & rights);
}
else
{
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 1471da2ad1..5e6e61b6b3 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -949,8 +949,8 @@ void LLTeleportHistoryPanel::onAccordionTabRightClick(LLView *view, S32 x, S32 y
mAccordionTabMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
"menu_teleport_history_tab.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
- mAccordionTabMenu->setItemVisible("TabOpen", !tab->isExpanded() ? true : false);
- mAccordionTabMenu->setItemVisible("TabClose", tab->isExpanded() ? true : false);
+ mAccordionTabMenu->setItemVisible("TabOpen", !tab->isExpanded());
+ mAccordionTabMenu->setItemVisible("TabClose", tab->isExpanded());
mAccordionTabMenu->show(x, y);
LLMenuGL::showPopup(tab, mAccordionTabMenu, x, y);
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index 9e8091aac5..ac7bf0c2dc 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -1489,7 +1489,7 @@ void LLPanelVolume::setLightTextureID(const LLUUID &asset_id, const LLUUID &item
if (item && volobjp->isAttachment())
{
const LLPermissions& perm = item->getPermissions();
- bool unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? true : false;
+ bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
if (!unrestricted)
{
// Attachments are in world and in inventory simultaneously,
@@ -1501,7 +1501,8 @@ void LLPanelVolume::setLightTextureID(const LLUUID &asset_id, const LLUUID &item
if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()))
{
LLToolDragAndDrop::handleDropMaterialProtections(volobjp, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null);
- }
+ }
+
volobjp->setLightTextureID(asset_id);
}
}
diff --git a/indra/newview/llperfstats.cpp b/indra/newview/llperfstats.cpp
index 946005b387..93851a4980 100644
--- a/indra/newview/llperfstats.cpp
+++ b/indra/newview/llperfstats.cpp
@@ -411,7 +411,7 @@ namespace LLPerfStats
return;
}
- if(belowTargetFPS == false)
+ if (!belowTargetFPS)
{
// this is the first frame under. hold fire to add a little hysteresis
belowTargetFPS = true;
@@ -488,7 +488,7 @@ namespace LLPerfStats
new_render_limit_ns = std::max((U64)new_render_limit_ns, (U64)LLPerfStats::ART_MINIMUM_NANOS);
// assign the new value
- if(renderAvatarMaxART_ns != new_render_limit_ns)
+ if (renderAvatarMaxART_ns != new_render_limit_ns)
{
renderAvatarMaxART_ns = new_render_limit_ns;
tunables.updateSettingsFromRenderCostLimit();
@@ -497,10 +497,10 @@ namespace LLPerfStats
}
// LL_DEBUGS() << "AUTO_TUNE: Target frame time:"<< LLPerfStats::raw_to_us(target_frame_time_raw) << "usecs (non_avatar is " << LLPerfStats::raw_to_us(non_avatar_time_raw) << "usecs) Max cost limited=" << renderAvatarMaxART_ns << LL_ENDL;
}
- else if(( LLPerfStats::raw_to_ns(target_frame_time_raw) > (LLPerfStats::raw_to_ns(tot_frame_time_raw) + renderAvatarMaxART_ns) ) ||
+ else if ((LLPerfStats::raw_to_ns(target_frame_time_raw) > (LLPerfStats::raw_to_ns(tot_frame_time_raw) + renderAvatarMaxART_ns)) ||
(tunables.vsyncEnabled && (target_fps == LLPerfStats::vsync_max_fps) && (target_frame_time_raw > getMeanTotalFrameTime())))
{
- if(belowTargetFPS == true)
+ if (belowTargetFPS)
{
// we reached target, force a pause
lastGlobalPrefChange = gFrameCount;
@@ -508,15 +508,17 @@ namespace LLPerfStats
}
// once we're over the FPS target we slow down further
- if((gFrameCount - lastGlobalPrefChange) > settingsChangeFrequency*3)
+ if ((gFrameCount - lastGlobalPrefChange) > settingsChangeFrequency * 3)
{
- if(!tunables.userAutoTuneLock)
+ if (!tunables.userAutoTuneLock)
{
// we've reached the target and stayed long enough to consider stable.
// turn off if we are not locked.
tunables.updateUserAutoTuneEnabled(false);
}
- if(renderAvatarMaxART_ns != 0 && LLPerfStats::tunedAvatars > 0 && (tunables.userFPSTuningStrategy != TUNE_SCENE_ONLY) )
+ if (renderAvatarMaxART_ns > 0 &&
+ LLPerfStats::tunedAvatars > 0 &&
+ tunables.userFPSTuningStrategy != TUNE_SCENE_ONLY)
{
// if we have more time to spare let's shift up little in the hope we'll restore an avatar.
U64 up_step = LLPerfStats::tunedAvatars > 2 ? LLPerfStats::ART_MIN_ADJUST_UP_NANOS : LLPerfStats::ART_MIN_ADJUST_UP_NANOS * 2;
@@ -524,15 +526,15 @@ namespace LLPerfStats
tunables.updateSettingsFromRenderCostLimit();
return;
}
- if(tunables.userFPSTuningStrategy != TUNE_AVATARS_ONLY)
+ if (tunables.userFPSTuningStrategy != TUNE_AVATARS_ONLY)
{
- if( LLPipeline::RenderFarClip < tunables.userTargetDrawDistance )
+ if (LLPipeline::RenderFarClip < tunables.userTargetDrawDistance)
{
LLPerfStats::tunables.updateFarClip( std::min(LLPipeline::RenderFarClip + DD_STEP, tunables.userTargetDrawDistance) );
LLPerfStats::lastGlobalPrefChange = gFrameCount;
return;
}
- if( (tot_frame_time_raw * 1.5) < target_frame_time_raw )
+ if ((tot_frame_time_raw * 1.5) < target_frame_time_raw)
{
// if everything else is "max" and we have >50% headroom let's knock the water quality up a notch at a time.
# if 0 // RenderReflectionDetail went away
diff --git a/indra/newview/llphysicsshapebuilderutil.h b/indra/newview/llphysicsshapebuilderutil.h
index b3b100296f..7dbc577562 100644
--- a/indra/newview/llphysicsshapebuilderutil.h
+++ b/indra/newview/llphysicsshapebuilderutil.h
@@ -73,7 +73,8 @@ public:
{
return LLVolumeParams::operator<(params);
}
- return (params.mForceConvex == false) && (mForceConvex == true);
+
+ return !params.mForceConvex && mForceConvex;
}
bool shouldForceConvex() const { return mForceConvex; }
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index 1f66db92d5..05faf17bdc 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -616,10 +616,9 @@ void LLPreviewGesture::refresh()
LLPreview::refresh();
// If previewing or item is incomplete, all controls are disabled
LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem();
- bool is_complete = (item && item->isFinished()) ? true : false;
+ bool is_complete = item && item->isFinished();
if (mPreviewGesture || !is_complete)
{
-
getChildView("desc")->setEnabled(false);
//mDescEditor->setEnabled(false);
mTriggerEditor->setEnabled(false);
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 151252fb2d..4be3f6c742 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -2309,7 +2309,6 @@ LLLiveLSLSaveData::LLLiveLSLSaveData(const LLUUID& id,
mItem = new LLViewerInventoryItem(item);
}
-
/*static*/
void LLLiveLSLEditor::finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, bool isRunning)
{
@@ -2333,15 +2332,13 @@ void LLLiveLSLEditor::finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAs
preview->callbackLSLCompileFailed(response["errors"]);
}
}
-
}
-
// virtual
void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
{
LLViewerObject* object = gObjectList.findObject(mObjectUUID);
- if(!object)
+ if (!object)
{
LLNotificationsUtil::add("SaveScriptFailObjectNotFound");
return;
@@ -2366,7 +2363,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
}
// Don't need to save if we're pristine
- if(!mScriptEd->hasChanged())
+ if (!mScriptEd->hasChanged())
{
return;
}
@@ -2383,6 +2380,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
{
mScriptEd->sync();
}
+
bool isRunning = getChild<LLCheckBoxCtrl>("running")->get();
getWindow()->incBusyCount();
mPendingUploads++;
@@ -2409,14 +2407,14 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
bool LLLiveLSLEditor::canClose()
{
- return (mScriptEd->canClose());
+ return mScriptEd->canClose();
}
void LLLiveLSLEditor::closeIfNeeded()
{
getWindow()->decBusyCount();
mPendingUploads--;
- if (mPendingUploads <= 0 && mCloseAfterSave)
+ if ((mPendingUploads <= 0) && mCloseAfterSave)
{
closeFloater();
}
@@ -2432,8 +2430,7 @@ void LLLiveLSLEditor::onLoad(void* userdata)
// static
void LLLiveLSLEditor::onSave(void* userdata, bool close_after_save)
{
- LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata;
- if(self)
+ if (LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata)
{
self->mCloseAfterSave = close_after_save;
self->mScriptEd->mErrorList->setCommentText("");
@@ -2441,7 +2438,6 @@ void LLLiveLSLEditor::onSave(void* userdata, bool close_after_save)
}
}
-
// static
void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)
{
@@ -2453,8 +2449,7 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)
LLSD floater_key;
floater_key["taskid"] = object_id;
floater_key["itemid"] = item_id;
- LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key);
- if(instance)
+ if (LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key))
{
instance->mHaveRunningInfo = true;
bool running;
@@ -2469,7 +2464,6 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)
}
}
-
void LLLiveLSLEditor::onMonoCheckboxClicked(LLUICtrl*, void* userdata)
{
LLLiveLSLEditor* self = static_cast<LLLiveLSLEditor*>(userdata);
@@ -2479,20 +2473,15 @@ void LLLiveLSLEditor::onMonoCheckboxClicked(LLUICtrl*, void* userdata)
bool LLLiveLSLEditor::monoChecked() const
{
- if(NULL != mMonoCheckbox)
- {
- return mMonoCheckbox->getValue()? true : false;
- }
- return false;
+ return mMonoCheckbox && mMonoCheckbox->getValue();
}
void LLLiveLSLEditor::setAssociatedExperience( LLHandle<LLLiveLSLEditor> editor, const LLSD& experience )
{
- LLLiveLSLEditor* scriptEd = editor.get();
- if(scriptEd)
+ if (LLLiveLSLEditor* scriptEd = editor.get())
{
LLUUID id;
- if(experience.has(LLExperienceCache::EXPERIENCE_ID))
+ if (experience.has(LLExperienceCache::EXPERIENCE_ID))
{
id=experience[LLExperienceCache::EXPERIENCE_ID].asUUID();
}
diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp
index 7c22514264..a46c444eb9 100644
--- a/indra/newview/llprogressview.cpp
+++ b/indra/newview/llprogressview.cpp
@@ -141,7 +141,7 @@ void LLProgressView::revealIntroPanel()
std::string intro_url = gSavedSettings.getString("PostFirstLoginIntroURL");
if ( intro_url.length() > 0 &&
gSavedSettings.getBOOL("BrowserJavascriptEnabled") &&
- gSavedSettings.getBOOL("PostFirstLoginIntroViewed" ) == false )
+ !gSavedSettings.getBOOL("PostFirstLoginIntroViewed"))
{
// hide the progress bar
getChild<LLView>("stack1")->setVisible(false);
@@ -504,8 +504,8 @@ void LLProgressView::initTextures(S32 location_id, bool is_in_production)
initStartTexture(location_id, is_in_production);
initLogos();
- childSetVisible("panel_icons", mLogosList.empty() ? false : true);
- childSetVisible("panel_top_spacer", mLogosList.empty() ? true : false);
+ childSetVisible("panel_icons", !mLogosList.empty());
+ childSetVisible("panel_top_spacer", mLogosList.empty());
}
void LLProgressView::releaseTextures()
@@ -519,8 +519,8 @@ void LLProgressView::releaseTextures()
void LLProgressView::setCancelButtonVisible(bool b, const std::string& label)
{
- mCancelBtn->setVisible( b );
- mCancelBtn->setEnabled( b );
+ mCancelBtn->setVisible(b);
+ mCancelBtn->setEnabled(b);
mCancelBtn->setLabelSelected(label);
mCancelBtn->setLabelUnselected(label);
}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 18dcec5e92..546dd0c6b2 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1871,7 +1871,7 @@ bool LLSelectMgr::selectionSetImage(const LLUUID& imageid)
if (mItem && objectp->isAttachment())
{
const LLPermissions& perm = mItem->getPermissions();
- bool unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? true : false;
+ bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
if (!unrestricted)
{
// Attachments are in world and in inventory simultaneously,
@@ -2299,6 +2299,7 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap, const LLUUID &image_id)
LL_WARNS() << "Attempted to apply no-copy texture to multiple objects" << LL_ENDL;
return;
}
+
if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()))
{
LLViewerObject *object = mSelectedObjects->getFirstRootObject();
@@ -2307,7 +2308,7 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap, const LLUUID &image_id)
return;
}
const LLPermissions& perm = item->getPermissions();
- bool unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? true : false;
+ bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
bool attached = object->isAttachment();
if (attached && !unrestricted)
{
@@ -2318,7 +2319,7 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap, const LLUUID &image_id)
LLToolDragAndDrop::handleDropMaterialProtections(object, item, LLToolDragAndDrop::SOURCE_AGENT, LLUUID::null);
}
getSelection()->applyToTEs(&setfunc);
-
+
LLSelectMgrSendFunctor sendfunc;
getSelection()->applyToObjects(&sendfunc);
}
@@ -2371,6 +2372,7 @@ void LLSelectMgr::selectionSetShiny(U8 shiny, const LLUUID &image_id)
LL_WARNS() << "Attempted to apply no-copy texture to multiple objects" << LL_ENDL;
return;
}
+
if (item && !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()))
{
LLViewerObject *object = mSelectedObjects->getFirstRootObject();
@@ -2379,7 +2381,7 @@ void LLSelectMgr::selectionSetShiny(U8 shiny, const LLUUID &image_id)
return;
}
const LLPermissions& perm = item->getPermissions();
- bool unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? true : false;
+ bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
bool attached = object->isAttachment();
if (attached && !unrestricted)
{
@@ -3883,7 +3885,7 @@ bool LLSelectMgr::selectIsGroupOwned()
LLSelectGetFirstGroupOwner test;
getFirst(&test);
- return test.mFirstValue.notNull() ? true : false;
+ return test.mFirstValue.notNull();
}
//-----------------------------------------------------------------------------
@@ -6970,7 +6972,7 @@ bool LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power)
if (PERM_OWNER == op)
{
// This this was just a check for ownership, we can now return the answer.
- return (proxy_agent_id == object_owner_id ? true : false);
+ return proxy_agent_id == object_owner_id;
}
// check permissions to see if the agent can operate
@@ -8045,7 +8047,7 @@ bool LLObjectSelection::checkAnimatedObjectLinkable()
bool LLObjectSelection::applyToRootObjects(LLSelectedObjectFunctor* func, bool firstonly)
{
- bool result = firstonly ? false : true;
+ bool result = !firstonly;
for (root_iterator iter = root_begin(); iter != root_end(); )
{
root_iterator nextiter = iter++;
@@ -8063,7 +8065,7 @@ bool LLObjectSelection::applyToRootObjects(LLSelectedObjectFunctor* func, bool f
bool LLObjectSelection::applyToTEs(LLSelectedTEFunctor* func, bool firstonly)
{
- bool result = firstonly ? false : true;
+ bool result = !firstonly;
for (iterator iter = begin(); iter != end(); )
{
iterator nextiter = iter++;
@@ -8089,7 +8091,7 @@ bool LLObjectSelection::applyToTEs(LLSelectedTEFunctor* func, bool firstonly)
bool LLObjectSelection::applyToNodes(LLSelectedNodeFunctor *func, bool firstonly)
{
- bool result = firstonly ? false : true;
+ bool result = !firstonly;
for (iterator iter = begin(); iter != end(); )
{
iterator nextiter = iter++;
@@ -8105,7 +8107,7 @@ bool LLObjectSelection::applyToNodes(LLSelectedNodeFunctor *func, bool firstonly
bool LLObjectSelection::applyToRootNodes(LLSelectedNodeFunctor *func, bool firstonly)
{
- bool result = firstonly ? false : true;
+ bool result = !firstonly;
for (root_iterator iter = root_begin(); iter != root_end(); )
{
root_iterator nextiter = iter++;
diff --git a/indra/newview/llsetkeybinddialog.cpp b/indra/newview/llsetkeybinddialog.cpp
index 1e5a67302a..dc3b34b1b9 100644
--- a/indra/newview/llsetkeybinddialog.cpp
+++ b/indra/newview/llsetkeybinddialog.cpp
@@ -217,7 +217,7 @@ bool LLSetKeyBindDialog::recordAndHandleKey(KEY key, MASK mask, bool down)
// Masks by themself are not allowed
return false;
}
- if (down == true)
+ if (down)
{
// Most keys are handled on 'down' event because menu is handled on 'down'
// masks are exceptions to let other keys be handled
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index 0a76a1f48f..54194e5fe6 100644
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -633,16 +633,14 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
}
// Set values.
- bool is_group_copy = (group_mask & PERM_COPY) ? true : false;
- bool is_group_modify = (group_mask & PERM_MODIFY) ? true : false;
- bool is_group_move = (group_mask & PERM_MOVE) ? true : false;
+ bool is_group_copy = group_mask & PERM_COPY;
+ bool is_group_modify = group_mask & PERM_MODIFY;
+ bool is_group_move = group_mask & PERM_MOVE;
if (is_group_copy && is_group_modify && is_group_move)
{
getChild<LLUICtrl>("CheckShareWithGroup")->setValue(LLSD((bool)true));
-
- LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
- if(ctl)
+ if (LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"))
{
ctl->setTentative(false);
}
@@ -650,22 +648,20 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
else if (!is_group_copy && !is_group_modify && !is_group_move)
{
getChild<LLUICtrl>("CheckShareWithGroup")->setValue(LLSD((bool)false));
- LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
- if(ctl)
+ if (LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"))
{
ctl->setTentative(false);
}
}
else
{
- LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup");
- if(ctl)
+ if (LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"))
{
ctl->setTentative(!ctl->getEnabled());
ctl->set(true);
}
}
-
+
getChild<LLUICtrl>("CheckEveryoneCopy")->setValue(LLSD((bool)(everyone_mask & PERM_COPY)));
///////////////
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 32f38de1e4..b35cd882db 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -1372,19 +1372,19 @@ void LLFloaterTexturePicker::changeMode()
{
int index = mModeSelector->getValue().asInteger();
- mDefaultBtn->setVisible(index == PICKER_INVENTORY ? true : false);
- mBlankBtn->setVisible(index == PICKER_INVENTORY ? true : false);
- mNoneBtn->setVisible(index == PICKER_INVENTORY ? true : false);
- mFilterEdit->setVisible(index == PICKER_INVENTORY ? true : false);
- mInventoryPanel->setVisible(index == PICKER_INVENTORY ? true : false);
+ mDefaultBtn->setVisible(index == PICKER_INVENTORY);
+ mBlankBtn->setVisible(index == PICKER_INVENTORY);
+ mNoneBtn->setVisible(index == PICKER_INVENTORY);
+ mFilterEdit->setVisible(index == PICKER_INVENTORY);
+ mInventoryPanel->setVisible(index == PICKER_INVENTORY);
- getChild<LLButton>("l_add_btn")->setVisible(index == PICKER_LOCAL ? true : false);
- getChild<LLButton>("l_rem_btn")->setVisible(index == PICKER_LOCAL ? true : false);
- getChild<LLButton>("l_upl_btn")->setVisible(index == PICKER_LOCAL ? true : false);
- getChild<LLScrollListCtrl>("l_name_list")->setVisible(index == PICKER_LOCAL ? true : false);
+ getChild<LLButton>("l_add_btn")->setVisible(index == PICKER_LOCAL);
+ getChild<LLButton>("l_rem_btn")->setVisible(index == PICKER_LOCAL);
+ getChild<LLButton>("l_upl_btn")->setVisible(index == PICKER_LOCAL);
+ getChild<LLScrollListCtrl>("l_name_list")->setVisible(index == PICKER_LOCAL);
- getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(index == PICKER_BAKE ? true : false);
- getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(false);// index == 2 ? true : false);
+ getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(index == PICKER_BAKE);
+ getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(false);// index == 2);
bool pipette_visible = (index == PICKER_INVENTORY)
&& (mInventoryPickType != PICK_MATERIAL);
@@ -2293,8 +2293,8 @@ void LLTextureCtrl::draw()
// Using the discard level, do not show the string if the texture is almost but not
// fully loaded.
if (mTexturep.notNull() &&
- (!mTexturep->isFullyLoaded()) &&
- (mShowLoadingPlaceholder == true))
+ !mTexturep->isFullyLoaded() &&
+ mShowLoadingPlaceholder)
{
U32 v_offset = 25;
LLFontGL* font = LLFontGL::getFontSansSerif();
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index f410217387..e1779ba976 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -529,12 +529,11 @@ void LLGLTexMemBar::draw()
U32 texFetchLatMed = U32(recording.getMean(LLTextureFetch::sTexFetchLatency).value() * 1000.0f);
U32 texFetchLatMax = U32(recording.getMax(LLTextureFetch::sTexFetchLatency).value() * 1000.0f);
- text = llformat("GL Free: %d MB Sys Free: %d MB FBO: %d MB Bias: %.2f(%d MB) Cache: %.1f/%.1f MB",
- gViewerWindow->getWindow()->getAvailableVRAMMegabytes(),
+ text = llformat("Est. Free: %d MB Sys Free: %d MB FBO: %d MB Bias: %.2f Cache: %.1f/%.1f MB",
+ (S32)LLViewerTexture::sFreeVRAMMegabytes,
LLMemory::getAvailableMemKB()/1024,
LLRenderTarget::sBytesAllocated/(1024*1024),
discard_bias,
- (S32)LLViewerTexture::sFreeVRAMMegabytes,
cache_usage,
cache_max_usage);
//, cache_entries, cache_max_entries
diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp
index e4f4a94bf1..910e42addf 100644
--- a/indra/newview/lltoastimpanel.cpp
+++ b/indra/newview/lltoastimpanel.cpp
@@ -119,7 +119,7 @@ LLToastIMPanel::~LLToastIMPanel()
//virtual
bool LLToastIMPanel::handleMouseUp(S32 x, S32 y, MASK mask)
{
- if (LLPanel::handleMouseUp(x,y,mask) == false)
+ if (!LLPanel::handleMouseUp(x, y, mask))
{
mNotification->respond(mNotification->getResponseTemplate());
}
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 4b9f29bca8..bbf70e55da 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -1692,13 +1692,13 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target,
// currently the ray's end point is an approximation,
// and is sometimes too short (causing failure.) so we
// double the ray's length:
- if (bypass_sim_raycast == false)
+ if (!bypass_sim_raycast)
{
LLVector3 ray_direction = ray_start - ray_end;
ray_end = ray_end - ray_direction;
}
-
-
+
+
// Message packing code should be it's own uninterrupted block
LLMessageSystem* msg = gMessageSystem;
if (mSource == SOURCE_NOTECARD)
@@ -1855,7 +1855,9 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj,
EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LLInventoryItem* item, EDragAndDropType type)
{
// check the basics
- if (!item || !obj) return ACCEPT_NO;
+ if (!item || !obj)
+ return ACCEPT_NO;
+
// HACK: downcast
LLViewerInventoryItem* vitem = (LLViewerInventoryItem*)item;
if (!vitem->isFinished() && (type != DAD_CATEGORY))
@@ -1866,13 +1868,14 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL
// Library or agent inventory only.
return ACCEPT_NO;
}
- if (vitem->getIsLinkType()) return ACCEPT_NO; // No giving away links
+ if (vitem->getIsLinkType())
+ return ACCEPT_NO; // No giving away links
// deny attempts to drop from an object onto itself. This is to
// help make sure that drops that are from an object to an object
// don't have to worry about order of evaluation. Think of this
// like check for self in assignment.
- if(obj->getID() == item->getParentUUID())
+ if (obj->getID() == item->getParentUUID())
{
return ACCEPT_NO;
}
@@ -1882,7 +1885,7 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL
// && (obj->mPermModify || obj->mFlagAllowInventoryAdd));
bool worn = false;
LLVOAvatarSelf* my_avatar = NULL;
- switch(item->getType())
+ switch (item->getType())
{
case LLAssetType::AT_OBJECT:
my_avatar = gAgentAvatarp;
@@ -1893,7 +1896,7 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL
break;
case LLAssetType::AT_BODYPART:
case LLAssetType::AT_CLOTHING:
- if(gAgentWearables.isWearingItem(item->getUUID()))
+ if (gAgentWearables.isWearingItem(item->getUUID()))
{
worn = true;
}
@@ -1903,33 +1906,37 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL
// because of incomplete LSL support. See STORM-1117.
return ACCEPT_NO;
default:
- break;
+ break;
}
const LLPermissions& perm = item->getPermissions();
bool modify = (obj->permModify() || obj->flagAllowInventoryAdd());
bool transfer = false;
- if((obj->permYouOwner() && (perm.getOwner() == gAgent.getID()))
+ if ((obj->permYouOwner() && (perm.getOwner() == gAgent.getID()))
|| perm.allowOperationBy(PERM_TRANSFER, gAgent.getID()))
{
transfer = true;
}
bool volume = (LL_PCODE_VOLUME == obj->getPCode());
bool attached = obj->isAttachment();
- bool unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? true : false;
- if(attached && !unrestricted)
+ bool unrestricted = (perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED;
+
+ if (attached && !unrestricted)
{
// Attachments are in world and in inventory simultaneously,
// at the moment server doesn't support such a situation.
return ACCEPT_NO_LOCKED;
}
- else if(modify && transfer && volume && !worn)
+
+ if (modify && transfer && volume && !worn)
{
return ACCEPT_YES_MULTI;
}
- else if(!modify)
+
+ if (!modify)
{
return ACCEPT_NO_LOCKED;
}
+
return ACCEPT_NO;
}
@@ -2619,41 +2626,41 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
return ACCEPT_NO_CUSTOM;
}
- if(mSource == SOURCE_AGENT)
+ if (mSource == SOURCE_AGENT)
{
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
- if( gInventory.isObjectDescendentOf( category->getUUID(), trash_id ) )
+ if (gInventory.isObjectDescendentOf(category->getUUID(), trash_id))
{
return ACCEPT_NO;
}
const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX);
- if(outbox_id.notNull() && gInventory.isObjectDescendentOf(category->getUUID(), outbox_id))
+ if (outbox_id.notNull() && gInventory.isObjectDescendentOf(category->getUUID(), outbox_id))
{
// Legacy
return ACCEPT_NO;
}
- if(drop)
+ if (drop)
{
- bool append = ( (mask & MASK_SHIFT) ? true : false );
- LLAppearanceMgr::instance().wearInventoryCategory(category, false, append);
+ LLAppearanceMgr::instance().wearInventoryCategory(category, false, mask & MASK_SHIFT);
}
+
return ACCEPT_YES_MULTI;
}
- else if(mSource == SOURCE_LIBRARY)
+
+ if (mSource == SOURCE_LIBRARY)
{
- if(drop)
+ if (drop)
{
LLAppearanceMgr::instance().wearInventoryCategory(category, true, false);
}
+
return ACCEPT_YES_MULTI;
}
- else
- {
- // TODO: copy/move category to avatar's inventory and then wear it.
- return ACCEPT_NO;
- }
+
+ // TODO: copy/move category to avatar's inventory and then wear it.
+ return ACCEPT_NO;
}
@@ -2664,15 +2671,15 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventory(
// *HACK: In order to resolve SL-22177, we need to block drags
// from notecards and objects onto other objects.
- if((SOURCE_WORLD == mSource) || (SOURCE_NOTECARD == mSource))
- {
+ if ((SOURCE_WORLD == mSource) || (SOURCE_NOTECARD == mSource))
return ACCEPT_NO;
- }
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isFinished()) return ACCEPT_NO;
+ if (!item || !item->isFinished())
+ return ACCEPT_NO;
+
LLViewerObject* root_object = obj;
if (obj && obj->getParent())
{
@@ -2684,17 +2691,18 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventory(
}
EAcceptance rv = willObjectAcceptInventory(root_object, item);
- if(root_object && drop && (ACCEPT_YES_COPY_SINGLE <= rv))
+ if (root_object && drop && (ACCEPT_YES_COPY_SINGLE <= rv))
{
dropInventory(root_object, item, mSource, mSourceID);
}
+
return rv;
}
bool LLToolDragAndDrop::dadUpdateInventory(LLViewerObject* obj, bool drop)
{
EAcceptance rv = dad3dUpdateInventory(obj, -1, MASK_NONE, drop);
- return (rv >= ACCEPT_YES_COPY_SINGLE);
+ return rv >= ACCEPT_YES_COPY_SINGLE;
}
EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory(
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index 63545ee5b0..a4f43bde11 100644
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -145,12 +145,13 @@ LLToolMgr::~LLToolMgr()
bool LLToolMgr::usingTransientTool()
{
- return mTransientTool ? true : false;
+ return mTransientTool != nullptr;
}
void LLToolMgr::setCurrentToolset(LLToolset* current)
{
- if (!current) return;
+ if (!current)
+ return;
// switching toolsets?
if (current != mCurrentToolset)
@@ -164,6 +165,7 @@ void LLToolMgr::setCurrentToolset(LLToolset* current)
// select first tool of new toolset only if toolset changed
mCurrentToolset->selectFirstTool();
}
+
// update current tool based on new toolset
setCurrentTool( mCurrentToolset->getSelectedTool() );
}
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index 66184abd37..318cf199c0 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -74,7 +74,7 @@ LLViewerAudio::~LLViewerAudio()
void LLViewerAudio::registerIdleListener()
{
- if(mIdleListnerActive==false)
+ if (!mIdleListnerActive)
{
mIdleListnerActive = true;
doOnIdleRepeating(boost::bind(boost::bind(&LLViewerAudio::onIdleUpdate, this)));
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 5a2c74e86a..4aadc822ab 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -265,7 +265,7 @@ static bool handleVSyncChanged(const LLSD& newvalue)
LLPerfStats::tunables.vsyncEnabled = newvalue.asBoolean();
gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
- if(newvalue.asBoolean() == true)
+ if (newvalue.asBoolean())
{
U32 current_target = gSavedSettings.getU32("TargetFPS");
gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
@@ -295,12 +295,12 @@ static bool handleAvatarPhysicsLODChanged(const LLSD& newvalue)
static bool handleTerrainLODChanged(const LLSD& newvalue)
{
- LLVOSurfacePatch::sLODFactor = (F32)newvalue.asReal();
- //sqaure lod factor to get exponential range of [0,4] and keep
- //a value of 1 in the middle of the detail slider for consistency
- //with other detail sliders (see panel_preferences_graphics1.xml)
- LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor;
- return true;
+ LLVOSurfacePatch::sLODFactor = (F32)newvalue.asReal();
+ //sqaure lod factor to get exponential range of [0,4] and keep
+ //a value of 1 in the middle of the detail slider for consistency
+ //with other detail sliders (see panel_preferences_graphics1.xml)
+ LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor;
+ return true;
}
static bool handleTreeLODChanged(const LLSD& newvalue)
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 0a0bda63ba..f2a5aad565 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -900,7 +900,7 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
// gGL.popMatrix();
//}
- LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? true : false;
+ LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater();
LLGLState::checkStates();
@@ -1107,7 +1107,7 @@ void display_cube_face()
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderStart");
- LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? true : false;
+ LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater();
gGL.setColorMask(true, true);
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index a53b8ebd88..0aba982ba9 100644
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -342,7 +342,7 @@ void LLViewerJoystick::init(bool autoenable)
loadDeviceIdFromSettings();
- if (libinit == false)
+ if (!libinit)
{
// Note: The HotPlug callbacks are not actually getting called on Windows
if (ndof_libinit(HotPlugAddCallback,
@@ -401,10 +401,10 @@ void LLViewerJoystick::init(bool autoenable)
// Autoenable the joystick for recognized devices if nothing was connected previously
if (!autoenable)
{
- autoenable = gSavedSettings.getString("JoystickInitialized").empty() ? true : false;
+ autoenable = gSavedSettings.getString("JoystickInitialized").empty();
}
updateEnabled(autoenable);
-
+
if (mDriverState == JDS_INITIALIZED)
{
// A Joystick device is plugged in
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 33bfbe4134..5f2eafd62e 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -957,7 +957,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
std::string mode = userdata.asString();
if (mode == "none")
{
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == true)
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY))
{
gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY);
}
@@ -965,7 +965,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
}
else if (mode == "current")
{
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == false)
+ if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY))
{
gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY);
}
@@ -973,7 +973,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
}
else if (mode == "desired")
{
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == false)
+ if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY))
{
gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY);
}
@@ -982,7 +982,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
}
else if (mode == "full")
{
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == false)
+ if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY))
{
gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY);
}
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index f322b36226..8325169683 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -451,7 +451,7 @@ const bool check_file_extension(const std::string& filename, LLFilePicker::ELoad
//and compare them to the extension of the file
//to be uploaded
for (token_iter = tokens.begin();
- token_iter != tokens.end() && ext_valid != true;
+ token_iter != tokens.end() && !ext_valid;
++token_iter)
{
const std::string& cur_token = *token_iter;
@@ -464,7 +464,7 @@ const bool check_file_extension(const std::string& filename, LLFilePicker::ELoad
}
}//end for (loop over all tokens)
- if (ext_valid == false)
+ if (!ext_valid)
{
//should only get here if the extension exists
//but is invalid
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 5fc5be1075..348206bd30 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -187,7 +187,7 @@ void accept_friendship_coro(std::string url, LLSD notification)
}
else
{
- if (!result.has("success") || result["success"].asBoolean() == false)
+ if (!result.has("success") || !result["success"].asBoolean())
{
LL_WARNS("Friendship") << "Server failed to process accepted friendship. " << httpResults << LL_ENDL;
}
@@ -230,7 +230,7 @@ void decline_friendship_coro(std::string url, LLSD notification, S32 option)
}
else
{
- if (!result.has("success") || result["success"].asBoolean() == false)
+ if (!result.has("success") || !result["success"].asBoolean())
{
LL_WARNS("Friendship") << "Server failed to process declined friendship. " << httpResults << LL_ENDL;
}
@@ -274,7 +274,7 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
// This will also trigger an onlinenotification if the user is online
std::string url = gAgent.getRegionCapability("AcceptFriendship");
LL_DEBUGS("Friendship") << "Cap string: " << url << LL_ENDL;
- if (!url.empty() && payload.has("online") && payload["online"].asBoolean() == false)
+ if (!url.empty() && payload.has("online") && !payload["online"].asBoolean())
{
LL_DEBUGS("Friendship") << "Accepting friendship via capability" << LL_ENDL;
LLCoros::instance().launch("LLMessageSystem::acceptFriendshipOffer",
@@ -314,7 +314,7 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
// the rejection to the simulator to delete the pending userop.
std::string url = gAgent.getRegionCapability("DeclineFriendship");
LL_DEBUGS("Friendship") << "Cap string: " << url << LL_ENDL;
- if (!url.empty() && payload.has("online") && payload["online"].asBoolean() == false)
+ if (!url.empty() && payload.has("online") && !payload["online"].asBoolean())
{
LL_DEBUGS("Friendship") << "Declining friendship via capability" << LL_ENDL;
LLCoros::instance().launch("LLMessageSystem::declineFriendshipOffer",
@@ -774,7 +774,7 @@ void response_group_invitation_coro(std::string url, LLUUID group_id, bool notif
}
else
{
- if (!result.has("success") || result["success"].asBoolean() == false)
+ if (!result.has("success") || !result["success"].asBoolean())
{
LL_WARNS("GroupInvite") << "Server failed to process group " << group_id << " invitation response. " << httpResults << LL_ENDL;
}
@@ -2041,25 +2041,29 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
std::string from_string; // Used in the pop-up.
std::string chatHistory_string; // Used in chat history.
- if (mFromObject == true)
+ if (mFromObject)
{
+ std::string quot = LLTrans::getString("'");
if (mFromGroup)
{
std::string group_name;
if (gCacheName->getGroupName(mFromID, group_name))
{
- from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'"
- + mFromName + LLTrans::getString("'") +" " + LLTrans::getString("InvOfferOwnedByGroup")
- + " "+ "'" + group_name + "'";
-
- chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByGroup")
- + " " + group_name + "'";
+ from_string = LLTrans::getString("InvOfferAnObjectNamed") + " " +
+ quot + mFromName + quot + " " +
+ LLTrans::getString("InvOfferOwnedByGroup") + " " +
+ quot + group_name + quot;
+ chatHistory_string = mFromName + " " +
+ LLTrans::getString("InvOfferOwnedByGroup") + " " +
+ quot + group_name + quot;
}
else
{
- from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+"'"
- + mFromName +"'"+ " " + LLTrans::getString("InvOfferOwnedByUnknownGroup");
- chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownGroup");
+ from_string = LLTrans::getString("InvOfferAnObjectNamed") + " " +
+ quot + mFromName + quot + " " +
+ LLTrans::getString("InvOfferOwnedByUnknownGroup");
+ chatHistory_string = mFromName + " " +
+ LLTrans::getString("InvOfferOwnedByUnknownGroup");
}
}
else
@@ -2067,15 +2071,19 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
LLAvatarName av_name;
if (LLAvatarNameCache::get(mFromID, &av_name))
{
- from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName
- + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + av_name.getUserName();
- chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + av_name.getUserName();
+ from_string = LLTrans::getString("InvOfferAnObjectNamed") + " " +
+ quot + mFromName + quot + " " +
+ LLTrans::getString("InvOfferOwnedBy") + " " + av_name.getUserName();
+ chatHistory_string = mFromName + " " +
+ LLTrans::getString("InvOfferOwnedBy") + " " + av_name.getUserName();
}
else
{
- from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+LLTrans::getString("'")
- + mFromName + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedByUnknownUser");
- chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedByUnknownUser");
+ from_string = LLTrans::getString("InvOfferAnObjectNamed") + " " +
+ quot + mFromName + quot + " " +
+ LLTrans::getString("InvOfferOwnedByUnknownUser");
+ chatHistory_string = mFromName + " " +
+ LLTrans::getString("InvOfferOwnedByUnknownUser");
}
}
}
@@ -2083,7 +2091,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
{
from_string = chatHistory_string = mFromName;
}
-
+
LLUUID destination;
bool accept = true;
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index d50cb43cb0..d8f522163c 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2714,7 +2714,7 @@ void LLViewerObject::doUpdateInventory(
deleteInventoryItem(item_id);
LLPermissions perm(item->getPermissions());
LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(this);
- bool is_atomic = ((S32)LLAssetType::AT_OBJECT == item->getType()) ? false : true;
+ bool is_atomic = (S32)LLAssetType::AT_OBJECT != item->getType();
if(obj_perm)
{
perm.setOwnerAndGroup(LLUUID::null, obj_perm->getOwner(), obj_perm->getGroup(), is_atomic);
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp
index 420f02d759..079fa82545 100644
--- a/indra/newview/llvieweroctree.cpp
+++ b/indra/newview/llvieweroctree.cpp
@@ -760,7 +760,7 @@ bool LLViewerOctreeGroup::boundObjects(bool empty, LLVector4a& minOut, LLVector4
//virtual
bool LLViewerOctreeGroup::isVisible() const
{
- return mVisible[LLViewerCamera::sCurCameraID] >= LLViewerOctreeEntryData::getCurrentFrame() ? true : false;
+ return mVisible[LLViewerCamera::sCurCameraID] >= LLViewerOctreeEntryData::getCurrentFrame();
}
//virtual
@@ -888,7 +888,7 @@ LLOcclusionCullingGroup::~LLOcclusionCullingGroup()
bool LLOcclusionCullingGroup::needsUpdate()
{
- return (LLDrawable::getCurrentFrame() % mSpatialPartition->mLODPeriod == mLODHash) ? true : false;
+ return LLDrawable::getCurrentFrame() % mSpatialPartition->mLODPeriod == mLODHash;
}
bool LLOcclusionCullingGroup::isRecentlyVisible() const
@@ -906,7 +906,7 @@ bool LLOcclusionCullingGroup::isAnyRecentlyVisible() const
//virtual
void LLOcclusionCullingGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
{
- if (child->getListenerCount() == 0)
+ if (!child->hasListeners())
{
new LLOcclusionCullingGroup(child, mSpatialPartition);
}
diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h
index 7d9dfe7605..e655845077 100644
--- a/indra/newview/llvieweroctree.h
+++ b/indra/newview/llvieweroctree.h
@@ -299,14 +299,14 @@ public:
LLOcclusionCullingGroup(const LLOcclusionCullingGroup& rhs) : LLViewerOctreeGroup(rhs)
{
*this = rhs;
- }
+ }
void setOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE);
void clearOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE);
void checkOcclusion(); //read back last occlusion query (if any)
void doOcclusion(LLCamera* camera, const LLVector4a* shift = NULL); //issue occlusion query
- bool isOcclusionState(U32 state) const { return mOcclusionState[LLViewerCamera::sCurCameraID] & state ? true : false; }
- U32 getOcclusionState() const { return mOcclusionState[LLViewerCamera::sCurCameraID];}
+ bool isOcclusionState(U32 state) const { return mOcclusionState[LLViewerCamera::sCurCameraID] & state; }
+ U32 getOcclusionState() const { return mOcclusionState[LLViewerCamera::sCurCameraID];}
bool needsUpdate();
U32 getLastOcclusionIssuedTime();
@@ -325,7 +325,7 @@ public:
protected:
void releaseOcclusionQueryObjectNames();
-private:
+private:
bool earlyFail(LLCamera* camera, const LLVector4a* bounds);
protected:
@@ -338,7 +338,7 @@ protected:
U32 mOcclusionQuery[LLViewerCamera::NUM_CAMERAS];
U32 mOcclusionCheckCount[LLViewerCamera::NUM_CAMERAS];
-public:
+public:
static std::set<U32> sPendingQueries;
};//LL_ALIGN_POSTFIX(16);
@@ -356,7 +356,7 @@ protected:
// MUST call from destructor of any derived classes (SL-17276)
void cleanup();
-public:
+public:
U32 mPartitionType;
U32 mDrawableType;
OctreeNode* mOctree;
@@ -376,7 +376,7 @@ public:
protected:
virtual bool earlyFail(LLViewerOctreeGroup* group);
-
+
//agent space group cull
S32 AABBInFrustumNoFarClipGroupBounds(const LLViewerOctreeGroup* group);
S32 AABBSphereIntersectGroupExtents(const LLViewerOctreeGroup* group);
@@ -386,7 +386,7 @@ protected:
S32 AABBInFrustumNoFarClipObjectBounds(const LLViewerOctreeGroup* group);
S32 AABBSphereIntersectObjectExtents(const LLViewerOctreeGroup* group);
S32 AABBInFrustumObjectBounds(const LLViewerOctreeGroup* group);
-
+
//local region space group cull
S32 AABBInRegionFrustumNoFarClipGroupBounds(const LLViewerOctreeGroup* group);
S32 AABBInRegionFrustumGroupBounds(const LLViewerOctreeGroup* group);
@@ -396,7 +396,7 @@ protected:
S32 AABBInRegionFrustumNoFarClipObjectBounds(const LLViewerOctreeGroup* group);
S32 AABBInRegionFrustumObjectBounds(const LLViewerOctreeGroup* group);
S32 AABBRegionSphereIntersectObjectExtents(const LLViewerOctreeGroup* group, const LLVector3& shift);
-
+
virtual S32 frustumCheck(const LLViewerOctreeGroup* group) = 0;
virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group) = 0;
@@ -405,7 +405,7 @@ protected:
virtual void preprocess(LLViewerOctreeGroup* group);
virtual void processGroup(LLViewerOctreeGroup* group);
virtual void visit(const OctreeNode* branch);
-
+
protected:
LLCamera *mCamera;
S32 mRes;
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index daeb9de1e3..8ed9d24c69 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -2344,7 +2344,7 @@ bool LLViewerParcelMgr::canAgentBuyParcel(LLParcel* parcel, bool forGroup) const
&& ((parcel->getSalePrice() > 0) || (authorizeBuyer.notNull()));
bool isEmpowered
- = forGroup ? gAgent.hasPowerInActiveGroup(GP_LAND_DEED) == true : true;
+ = forGroup ? gAgent.hasPowerInActiveGroup(GP_LAND_DEED) : true;
bool isOwner
= parcelOwner == (forGroup ? gAgent.getGroupID() : gAgent.getID());
@@ -2361,7 +2361,7 @@ bool LLViewerParcelMgr::canAgentBuyParcel(LLParcel* parcel, bool forGroup) const
void LLViewerParcelMgr::startBuyLand(bool is_for_group)
{
- LLFloaterBuyLand::buyLand(getSelectionRegion(), mCurrentParcelSelection, is_for_group == true);
+ LLFloaterBuyLand::buyLand(getSelectionRegion(), mCurrentParcelSelection, is_for_group);
}
void LLViewerParcelMgr::startSellLand()
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 9109f49945..28e637cc68 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -401,7 +401,7 @@ bool LLEmbeddedItems::insertEmbeddedItem( LLInventoryItem* item, llwchar* ext_ch
}
sEntries[wc_emb].mItemPtr = item;
- sEntries[wc_emb].mSaved = is_new ? false : true;
+ sEntries[wc_emb].mSaved = !is_new;
*ext_char = wc_emb;
mEmbeddedUsedChars.insert(wc_emb);
return true;
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index ff1149e496..9474da5567 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -1,3 +1,4 @@
+
/**
* @file llviewertexture.cpp
* @brief Object which handles a received image (and associated texture(s))
@@ -471,61 +472,10 @@ void LLViewerTexture::initClass()
LLImageGL::sDefaultGLTexture = LLViewerFetchedTexture::sDefaultImagep->getGLTexture();
}
-// tuning params
-const F32 GPU_MEMORY_CHECK_WAIT_TIME = 1.0f;
// non-const (used externally
F32 texmem_lower_bound_scale = 0.85f;
F32 texmem_middle_bound_scale = 0.925f;
-//static
-bool LLViewerTexture::isMemoryForTextureLow()
-{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
- // Note: we need to figure out a better source for 'min' values,
- // what is free for low end at minimal settings is 'nothing left'
- // for higher end gpus at high settings.
- const S32Megabytes MIN_FREE_TEXTURE_MEMORY(20);
- const S32Megabytes MIN_FREE_MAIN_MEMORY(100);
-
- S32Megabytes gpu;
- S32Megabytes physical;
- getGPUMemoryForTextures(gpu, physical);
-
- return (gpu < MIN_FREE_TEXTURE_MEMORY); // || (physical < MIN_FREE_MAIN_MEMORY);
-}
-
-//static
-void LLViewerTexture::getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical)
-{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
- static LLFrameTimer timer;
-
- static S32Megabytes gpu_res = S32Megabytes(S32_MAX);
- static S32Megabytes physical_res = S32Megabytes(S32_MAX);
-
- if (timer.getElapsedTimeF32() < GPU_MEMORY_CHECK_WAIT_TIME) //call this once per second.
- {
- gpu = gpu_res;
- physical = physical_res;
- return;
- }
- timer.reset();
-
- {
- // For purposes of texture memory need to check both, actual free
- // memory and estimated free texture memory from bias calculations
- U32 free_memory = llmin(gViewerWindow->getWindow()->getAvailableVRAMMegabytes(), (U32)sFreeVRAMMegabytes);
- gpu_res = (S32Megabytes)free_memory;
-
- //check main memory, only works for windows and macos.
- LLMemory::updateMemoryInfo();
- physical_res = LLMemory::getAvailableMemKB();
-
- gpu = gpu_res;
- physical = physical_res;
- }
-}
-
//static
void LLViewerTexture::updateClass()
{
@@ -544,10 +494,11 @@ void LLViewerTexture::updateClass()
F64 texture_bytes_alloc = LLImageGL::getTextureBytesAllocated() / 1024.0 / 512.0;
F64 vertex_bytes_alloc = LLVertexBuffer::getBytesAllocated() / 1024.0 / 512.0;
+ F64 render_bytes_alloc = LLRenderTarget::sBytesAllocated / 1024.0 / 512.0;
// get an estimate of how much video memory we're using
// NOTE: our metrics miss about half the vram we use, so this biases high but turns out to typically be within 5% of the real number
- F32 used = (F32)ll_round(texture_bytes_alloc + vertex_bytes_alloc);
+ F32 used = (F32)ll_round(texture_bytes_alloc + vertex_bytes_alloc + render_bytes_alloc);
F32 budget = max_vram_budget == 0 ? gGLManager.mVRAM : max_vram_budget;
@@ -2132,7 +2083,7 @@ bool LLViewerFetchedTexture::updateFetch()
}
}
- return mIsFetching ? true : false;
+ return mIsFetching;
}
void LLViewerFetchedTexture::clearFetchedResults()
@@ -2586,7 +2537,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
{
LL_WARNS() << "Raw Image with no Aux Data for callback" << LL_ENDL;
}
- bool final = mRawDiscardLevel <= entryp->mDesiredDiscard ? true : false;
+ bool final = mRawDiscardLevel <= entryp->mDesiredDiscard;
//LL_INFOS() << "Running callback for " << getID() << LL_ENDL;
//LL_INFOS() << mRawImage->getWidth() << "x" << mRawImage->getHeight() << LL_ENDL;
entryp->mLastUsedDiscard = mRawDiscardLevel;
@@ -2617,7 +2568,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
if (!entryp->mNeedsImageRaw && (entryp->mLastUsedDiscard > gl_discard))
{
mLastCallBackActiveTime = sCurrentTime;
- bool final = gl_discard <= entryp->mDesiredDiscard ? true : false;
+ bool final = gl_discard <= entryp->mDesiredDiscard;
entryp->mLastUsedDiscard = gl_discard;
entryp->mCallback(true, this, NULL, NULL, gl_discard, final, entryp->mUserData);
if (final)
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index 9a8b931901..c7b41038c0 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -185,11 +185,7 @@ private:
friend class LLUIImageList;
virtual void switchToCachedImage();
-
- static void getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical);
-public:
- static bool isMemoryForTextureLow();
protected:
friend class LLViewerTextureList;
LLUUID mID;
@@ -308,7 +304,7 @@ public:
void setLoadedCallback(loaded_callback_func cb,
S32 discard_level, bool keep_imageraw, bool needs_aux,
void* userdata, LLLoadedCallbackEntry::source_callback_list_t* src_callback_list, bool pause = false);
- bool hasCallbacks() { return mLoadedCallbackList.empty() ? false : true; }
+ bool hasCallbacks() { return !mLoadedCallbackList.empty(); }
void pauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list);
void unpauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list);
bool doLoadedCallbacks();
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 6fb85482d1..67ce589142 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -678,12 +678,12 @@ void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image)
}
else
{
- if((mImageList.insert(image)).second != true)
- {
+ if (!(mImageList.insert(image)).second)
+ {
LL_WARNS() << "Error happens when insert image " << image->getID() << " into mImageList!" << LL_ENDL ;
+ }
+ image->setInImageList(true);
}
- image->setInImageList(true) ;
-}
}
void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image)
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f9d5f5ea5d..275164b698 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3980,7 +3980,7 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window)
// start off using whole window to render world
LLRect new_world_rect = mWindowRectRaw;
- if (use_full_window == false && mWorldViewPlaceholder.get())
+ if (!use_full_window && mWorldViewPlaceholder.get())
{
new_world_rect = mWorldViewPlaceholder.get()->calcScreenRect();
// clamp to at least a 1x1 rect so we don't try to allocate zero width gl buffers
@@ -4939,7 +4939,7 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
setCursor(UI_CURSOR_WAIT);
// Hide all the UI widgets first and draw a frame
- bool prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI) ? true : false;
+ bool prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
if ( prev_draw_ui != show_ui)
{
@@ -4965,7 +4965,7 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
// SNAPSHOT
S32 window_width = snapshot_width;
S32 window_height = snapshot_height;
-
+
// Note: Scaling of the UI is currently *not* supported so we limit the output size if UI is requested
if (show_ui)
{
@@ -5021,7 +5021,7 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
scale_factor = llmax(1.0f, 1.0f / ratio) ;
}
}
-
+
if (show_ui && scale_factor > 1.f)
{
// Note: we should never get there...
@@ -5049,11 +5049,12 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
}
else
{
- return false ;
+ return false;
}
+
if (raw->isBufferInvalid())
{
- return false ;
+ return false;
}
bool high_res = scale_factor >= 2.f; // Font scaling is slow, only do so if rez is much higher
@@ -5200,7 +5201,6 @@ bool LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
{
ret = raw->scale( image_width, image_height, false );
}
-
setCursor(UI_CURSOR_ARROW);
@@ -5241,8 +5241,8 @@ bool LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); // stencil buffer is deprecated | GL_STENCIL_BUFFER_BIT);
setCursor(UI_CURSOR_WAIT);
- bool prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI) ? true : false;
- if (prev_draw_ui != false)
+ bool prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
+ if (prev_draw_ui)
{
LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
@@ -5318,7 +5318,7 @@ bool LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
- if (prev_draw_ui != false)
+ if (prev_draw_ui)
{
LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
@@ -5349,7 +5349,7 @@ bool LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
LL_PROFILE_GPU_ZONE("cubeSnapshot");
llassert(LLPipeline::sRenderDeferred);
llassert(!gCubeSnapshot); //assert a snapshot isn't already in progress
-
+
U32 res = gPipeline.mRT->deferredScreen.getWidth();
//llassert(res <= gPipeline.mRT->deferredScreen.getWidth());
@@ -5361,7 +5361,7 @@ bool LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
// set new parameters specific to the 360 requirements
LLPipeline::sUseOcclusion = 0;
LLViewerCamera* camera = LLViewerCamera::getInstance();
-
+
LLViewerCamera saved_camera = LLViewerCamera::instance();
glh::matrix4f saved_proj = get_current_projection();
glh::matrix4f saved_mod = get_current_modelview();
@@ -5391,7 +5391,7 @@ bool LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
constexpr U32 dynamic_render_type_count = sizeof(dynamic_render_types) / sizeof(U32);
bool prev_dynamic_render_type[dynamic_render_type_count];
-
+
if (!dynamic_render)
{
for (int i = 0; i < dynamic_render_type_count; ++i)
@@ -5404,12 +5404,12 @@ bool LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
}
}
- bool prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI) ? true : false;
- if (prev_draw_ui != false)
+ bool prev_draw_ui = gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI);
+ if (prev_draw_ui)
{
LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
-
+
bool hide_hud = LLPipeline::sShowHUDAttachments;
if (hide_hud)
{
@@ -5463,7 +5463,7 @@ bool LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
- if (prev_draw_ui != false)
+ if (prev_draw_ui)
{
LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
}
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 6d6dcf55c6..873622d44e 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6602,15 +6602,15 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL
LL_DEBUGS("AnimatedObjects") << "adding attachment overrides for " << mesh_id
<< " to root object " << root_object->getID() << LL_ENDL;
}
- bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false;
+ bool fullRig = jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG;
if ( fullRig && !mesh_overrides_loaded )
- {
+ {
for ( int i=0; i<jointCnt; ++i )
{
std::string lookingForJoint = pSkinData->mJointNames[i].c_str();
LLJoint* pJoint = getJoint( lookingForJoint );
if (pJoint)
- {
+ {
const LLVector3& jointPos = LLVector3(pSkinData->mAlternateBindMatrix[i].getTranslation());
if (pJoint->aboveJointPosThreshold(jointPos))
{
@@ -6621,9 +6621,9 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL
{
//If joint is a pelvis then handle old/new pelvis to foot values
if ( lookingForJoint == "mPelvis" )
- {
- pelvisGotSet = true;
- }
+ {
+ pelvisGotSet = true;
+ }
}
if (pSkinData->mLockScaleIfJointPosition)
{
@@ -6632,8 +6632,9 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL
pJoint->addAttachmentScaleOverride(pJoint->getDefaultScale(), mesh_id, avString());
}
}
- }
- }
+ }
+ }
+
if (pelvisZOffset != 0.0F)
{
F32 pelvis_fixup_before;
@@ -6643,25 +6644,25 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL
hasPelvisFixup(pelvis_fixup_after); // Don't have to check bool here because we just added it...
if (!has_fixup_before || (pelvis_fixup_before != pelvis_fixup_after))
{
- pelvisGotSet = true;
+ pelvisGotSet = true;
}
}
mActiveOverrideMeshes.insert(mesh_id);
onActiveOverrideMeshesChanged();
- }
+ }
}
}
else
{
LL_DEBUGS("AnimatedObjects") << "failed to add attachment overrides for root object " << root_object->getID() << " not mesh or no pSkinData" << LL_ENDL;
}
-
+
//Rebuild body data if we altered joints/pelvis
if ( pelvisGotSet )
{
postPelvisSetRecalc();
- }
+ }
}
//-----------------------------------------------------------------------------
@@ -6700,7 +6701,6 @@ void LLVOAvatar::getAttachmentOverrideNames(std::set<std::string>& pos_names, st
}
// Attachment points don't have scales.
}
-
}
//-----------------------------------------------------------------------------
@@ -6720,6 +6720,7 @@ void LLVOAvatar::showAttachmentOverrides(bool verbose) const
{
LL_DEBUGS("Avatar") << getFullname() << " no attachment positions defined for any joints" << "\n" << LL_ENDL;
}
+
if (scale_names.size())
{
std::stringstream ss;
@@ -6815,25 +6816,26 @@ void LLVOAvatar::removeAttachmentOverridesForObject(const LLUUID& mesh_id)
for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++)
{
LLJoint *pJoint = getJoint(joint_num);
- if ( pJoint )
- {
+ if (pJoint)
+ {
bool dummy; // unused
pJoint->removeAttachmentPosOverride(mesh_id, av_string, dummy);
pJoint->removeAttachmentScaleOverride(mesh_id, av_string);
- }
- if ( pJoint && pJoint == pJointPelvis)
+ }
+ if (pJoint && pJoint == pJointPelvis)
{
- removePelvisFixup( mesh_id );
+ removePelvisFixup(mesh_id);
// SL-315
- pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) );
- }
- }
-
+ pJoint->setPosition(LLVector3( 0.0f, 0.0f, 0.0f));
+ }
+ }
+
postPelvisSetRecalc();
mActiveOverrideMeshes.erase(mesh_id);
onActiveOverrideMeshesChanged();
}
+
//-----------------------------------------------------------------------------
// getCharacterPosition()
//-----------------------------------------------------------------------------
@@ -6849,7 +6851,6 @@ LLVector3 LLVOAvatar::getCharacterPosition()
}
}
-
//-----------------------------------------------------------------------------
// LLVOAvatar::getCharacterRotation()
//-----------------------------------------------------------------------------
@@ -6858,7 +6859,6 @@ LLQuaternion LLVOAvatar::getCharacterRotation()
return getRotation();
}
-
//-----------------------------------------------------------------------------
// LLVOAvatar::getCharacterVelocity()
//-----------------------------------------------------------------------------
@@ -6867,7 +6867,6 @@ LLVector3 LLVOAvatar::getCharacterVelocity()
return getVelocity() - mStepObjectVelocity;
}
-
//-----------------------------------------------------------------------------
// LLVOAvatar::getCharacterAngularVelocity()
//-----------------------------------------------------------------------------
@@ -6890,7 +6889,7 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age
out_pos_agent = in_pos_agent;
return;
}
-
+
p0_global = gAgent.getPosGlobalFromAgent(in_pos_agent) + z_vec;
p1_global = gAgent.getPosGlobalFromAgent(in_pos_agent) - z_vec;
LLViewerObject *obj;
@@ -6907,7 +6906,6 @@ F32 LLVOAvatar::getTimeDilation()
return mRegionp ? mRegionp->getTimeDilation() : 1.f;
}
-
//-----------------------------------------------------------------------------
// LLVOAvatar::getPixelArea()
//-----------------------------------------------------------------------------
@@ -6920,8 +6918,6 @@ F32 LLVOAvatar::getPixelArea() const
return mPixelArea;
}
-
-
//-----------------------------------------------------------------------------
// LLVOAvatar::getPosGlobalFromAgent()
//-----------------------------------------------------------------------------
@@ -6938,7 +6934,6 @@ LLVector3 LLVOAvatar::getPosAgentFromGlobal(const LLVector3d &position)
return gAgent.getPosAgentFromGlobal(position);
}
-
//-----------------------------------------------------------------------------
// requestStopMotion()
//-----------------------------------------------------------------------------
@@ -6958,7 +6953,7 @@ bool LLVOAvatar::loadSkeletonNode ()
{
return false;
}
-
+
bool ignore_hud_joints = false;
initAttachmentPoints(ignore_hud_joints);
@@ -11715,4 +11710,3 @@ F32 LLVOAvatar::getAverageGPURenderTime()
return ret;
}
-
diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp
index 3d7cedb823..304b7adfb7 100644
--- a/indra/newview/llvoicevisualizer.cpp
+++ b/indra/newview/llvoicevisualizer.cpp
@@ -284,7 +284,7 @@ void LLVoiceVisualizer::lipStringToF32s ( std::string& in_string, F32*& out_F32s
//--------------------------------------------------------------------------
void LLVoiceVisualizer::lipSyncOohAah( F32& ooh, F32& aah )
{
- if( ( sLipSyncEnabled == true ) && mCurrentlySpeaking )
+ if (sLipSyncEnabled && mCurrentlySpeaking)
{
U32 transfer_index = (U32) (sOohPowerTransfersf * mSpeakingAmplitude);
if (transfer_index >= sOohPowerTransfers)
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 2bb543f132..78df9aa9cf 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3586,9 +3586,10 @@ bool LLVOVolume::isVolumeGlobal() const
{
if (mVolumeImpl)
{
- return mVolumeImpl->isVolumeGlobal() ? true : false;
+ return mVolumeImpl->isVolumeGlobal();
}
- else if (mRiggedVolume.notNull())
+
+ if (mRiggedVolume.notNull())
{
return true;
}
@@ -5331,7 +5332,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
if (mat)
{
- bool is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) || (te->getColor().mV[3] < 0.999f) ? true : false;
+ bool is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) || (te->getColor().mV[3] < 0.999f);
if (type == LLRenderPass::PASS_ALPHA)
{
shader_mask = mat->getShaderMask(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND, is_alpha);
@@ -6481,7 +6482,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
tex = facep->getTexture();
- bool is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? true : false;
+ bool is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA;
LLMaterial* mat = nullptr;
bool can_be_shiny = false;
@@ -6507,7 +6508,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
if (!gltf_mat)
{
- is_alpha = (is_alpha || blinn_phong_transparent) ? true : false;
+ is_alpha |= blinn_phong_transparent;
}
if (gltf_mat || (mat && !hud_group))
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index a90839ae7e..129bbef185 100755
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -345,7 +345,7 @@ void LLWorldMapView::setPanWithInterpTime(S32 x, S32 y, bool snap, F32 interp_ti
mMapIterpTime = interp_time;
}
-bool LLWorldMapView::showRegionInfo() { return (LLWorldMipmap::scaleToLevel(mMapScale) <= DRAW_SIMINFO_THRESHOLD ? true : false); }
+bool LLWorldMapView::showRegionInfo() { return LLWorldMipmap::scaleToLevel(mMapScale) <= DRAW_SIMINFO_THRESHOLD; }
///////////////////////////////////////////////////////////////////////////////////
// HELPERS