diff options
author | Dave Parks <davep@lindenlab.com> | 2024-05-07 09:47:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 09:47:37 -0500 |
commit | 155ddf23363f1d5c534c69f50505faf67e51948f (patch) | |
tree | 976912ed4fa3bc2af7b0b68201460f08614748b5 | |
parent | f79548ec68ebcef8f8f83705b65fd59da43c3e26 (diff) | |
parent | f9473e8afcb624cc1b101195bf15943ec372b56f (diff) |
Merge pull request #1421 from secondlife/DRTVWR-600-maint-A
Drtvwr 600 maint a
135 files changed, 781 insertions, 947 deletions
diff --git a/autobuild.xml b/autobuild.xml index 34546501af..fa4f118f8e 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2010,63 +2010,63 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> </map> <key>openal</key> <map> + <key>copyright</key> + <string>Copyright (C) 1999-2007 by authors.</string> + <key>description</key> + <string>OpenAL Soft is a software implementation of the OpenAL 3D audio API.</string> + <key>license</key> + <string>LGPL2</string> + <key>license_file</key> + <string>LICENSES/openal-soft.txt</string> + <key>name</key> + <string>openal</string> <key>platforms</key> <map> - <key>linux64</key> + <key>darwin64</key> <map> <key>archive</key> <map> <key>hash</key> - <string>e0fbc4874acc4167a6e2b6489fbb8258d98fd665</string> + <string>191e4ef07a35f7147708415465191ce7622e3012</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-18e315c/openal-1.23.1-linux64-18e315c.tar.zst</string> + <string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-8668009/openal-1.23.1-darwin64-8979520327.tar.zst</string> </map> <key>name</key> - <string>linux64</string> + <string>darwin64</string> </map> - <key>windows64</key> + <key>linux64</key> <map> <key>archive</key> <map> <key>hash</key> - <string>6ae3b5310eb1988741bc55416681ca9d64f76f85</string> + <string>3bd8c9028ef42bdb43c7422e7d324e213fdb081e</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-18e315c/openal-1.23.1-windows64-18e315c.tar.zst</string> + <string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-8668009/openal-1.23.1-linux64-8979520327.tar.zst</string> </map> <key>name</key> - <string>windows64</string> + <string>linux64</string> </map> - <key>darwin64</key> + <key>windows64</key> <map> <key>archive</key> <map> <key>hash</key> - <string>4edaef5f03a1122eae8467c4a04d9caccaaaf847</string> + <string>4b849609abec790e89be5fad8ddee3717ee301c4</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-18e315c/openal-1.23.1-darwin64-18e315c.tar.zst</string> + <string>https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-8668009/openal-1.23.1-windows64-8979520327.tar.zst</string> </map> <key>name</key> - <string>darwin64</string> + <string>windows64</string> </map> </map> - <key>license</key> - <string>LGPL2</string> - <key>license_file</key> - <string>LICENSES/openal-soft.txt</string> - <key>copyright</key> - <string>Copyright (C) 1999-2007 by authors.</string> <key>version</key> <string>1.23.1</string> - <key>name</key> - <string>openal</string> - <key>description</key> - <string>OpenAL Soft is a software implementation of the OpenAL 3D audio API.</string> </map> <key>openjpeg</key> <map> diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index 42a37c4e16..e4e9e8d550 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -321,7 +321,7 @@ bool LLPolyMeshSharedData::loadMesh( const std::string& fileName ) } if (!isLOD()) { - mHasWeights = (hasWeights==0) ? false : true; + mHasWeights = hasWeights > 0; } //---------------------------------------------------------------- diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 8ad718a506..19eb0c784d 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -294,7 +294,7 @@ bool LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) // Don't load the image file until we actually need it the first time. Like now. mStaticImageTGA = LLTexLayerStaticImageList::getInstance()->getImageTGA(info->mStaticImageFileName); // We now have something in one of our caches - LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull() ? true : false; + LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull(); if (mStaticImageTGA.isNull()) { @@ -319,7 +319,7 @@ bool LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) mCachedProcessedTexture = gTextureManagerBridgep->getLocalTexture(image_tga_width, image_tga_height, 1, false); // We now have something in one of our caches - LLTexLayerSet::sHasCaches |= mCachedProcessedTexture ? true : false; + LLTexLayerSet::sHasCaches |= mCachedProcessedTexture.notNull(); mCachedProcessedTexture->setExplicitFormat(GL_ALPHA8, GL_ALPHA); } diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 44e95c4e7f..a277014ca5 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -1202,7 +1202,7 @@ void LLBVHLoader::optimize() // because it's significantly faster. if (diff_max > 0) { - if (ki_max->mIgnoreRot == true) + if (ki_max->mIgnoreRot) { ki_max->mIgnoreRot = false; joint->mNumRotKeys++; diff --git a/indra/llcommon/StackWalker.cpp b/indra/llcommon/StackWalker.cpp index 4ecff4ee69..2c1bc47d0e 100644 --- a/indra/llcommon/StackWalker.cpp +++ b/indra/llcommon/StackWalker.cpp @@ -1256,7 +1256,7 @@ bool StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con cleanup: if (pSym) free( pSym ); - if (bLastEntryCalled == false) + if (!bLastEntryCalled) this->OnCallstackEntry(lastEntry, csEntry); if (context == NULL) diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 8275f80f75..2f41c039f2 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -474,7 +474,7 @@ void LLApp::disableCrashlogger() // static bool LLApp::isCrashloggerDisabled() { - return (sDisableCrashlogger == true); + return sDisableCrashlogger; } // static diff --git a/indra/llcommon/llmutex.cpp b/indra/llcommon/llmutex.cpp index c90c00b5f4..d5c168a50d 100644 --- a/indra/llcommon/llmutex.cpp +++ b/indra/llcommon/llmutex.cpp @@ -68,7 +68,7 @@ void LLMutex::lock() #if MUTEX_DEBUG // Have to have the lock before we can access the debug info auto id = LLThread::currentID(); - if (mIsLocked[id] != false) + if (mIsLocked[id]) LL_ERRS() << "Already locked in Thread: " << id << LL_ENDL; mIsLocked[id] = true; #endif @@ -89,7 +89,7 @@ void LLMutex::unlock() #if MUTEX_DEBUG // Access the debug info while we have the lock auto id = LLThread::currentID(); - if (mIsLocked[id] != true) + if (!mIsLocked[id]) LL_ERRS() << "Not locked in Thread: " << id << LL_ENDL; mIsLocked[id] = false; #endif @@ -139,7 +139,7 @@ bool LLMutex::trylock() #if MUTEX_DEBUG // Have to have the lock before we can access the debug info auto id = LLThread::currentID(); - if (mIsLocked[id] != false) + if (mIsLocked[id]) LL_ERRS() << "Already locked in Thread: " << id << LL_ENDL; mIsLocked[id] = true; #endif diff --git a/indra/llcommon/llnametable.h b/indra/llcommon/llnametable.h index 4f11c595ed..ca4c56f630 100644 --- a/indra/llcommon/llnametable.h +++ b/indra/llcommon/llnametable.h @@ -64,7 +64,7 @@ public: bool checkName(const char *name) const { char *tablename = gStringTable.addString(name); - return mNameMap.count(tablename) ? true : false; + return mNameMap.find(tablename) != mNameMap.end(); } DATA resolveName(const std::string& name) const diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h index eac4a3e2cb..70d87e7c04 100644 --- a/indra/llcommon/llqueuedthread.h +++ b/indra/llcommon/llqueuedthread.h @@ -144,7 +144,7 @@ public: void printQueueStats(); virtual size_t getPending(); - bool getThreaded() { return mThreaded ? true : false; } + bool getThreaded() { return mThreaded; } // Request accessors status_t getRequestStatus(handle_t handle); diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h index e272d7a9b8..89d56373e1 100644 --- a/indra/llcommon/llregistry.h +++ b/indra/llcommon/llregistry.h @@ -60,7 +60,7 @@ public: bool add(ref_const_key_t key, ref_const_value_t value) { - if (mMap.insert(std::make_pair(key, value)).second == false) + if (!mMap.insert(std::make_pair(key, value)).second) { LL_WARNS() << "Tried to register " << key << " but it was already registered!" << LL_ENDL; return false; diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 76171f2dfd..756fd7c678 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -389,7 +389,7 @@ LLSDParser::~LLSDParser() S32 LLSDParser::parse(std::istream& istr, LLSD& data, llssize max_bytes, S32 max_depth) { - mCheckLimits = (LLSDSerialize::SIZE_UNLIMITED == max_bytes) ? false : true; + mCheckLimits = LLSDSerialize::SIZE_UNLIMITED != max_bytes; mMaxBytesLeft = max_bytes; return doParse(istr, data, max_depth); } diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index 25131291f9..e39769fe9d 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -532,7 +532,7 @@ bool before(const std::type_info* lhs, const std::type_info* rhs) return strcmp(lhs->name(), rhs->name()) < 0; #else // not Linux, or gcc 4.4+ // Just use before(), as we normally would - return lhs->before(*rhs) ? true : false; + return lhs->before(*rhs); #endif } diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 300516c78d..a20a40e205 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -464,7 +464,7 @@ struct LLDictionaryLess public: bool operator()(const std::string& a, const std::string& b) const { - return (LLStringUtil::precedesDict(a, b) ? true : false); + return (LLStringUtil::precedesDict(a, b)); } }; diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 1bcbefe9b2..cf2ae00cd7 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -59,17 +59,17 @@ public: bool isQuitting() const { return (QUITTING == mStatus); } bool isStopped() const { return (STOPPED == mStatus) || (CRASHED == mStatus); } bool isCrashed() const { return (CRASHED == mStatus); } - + static id_t currentID(); // Return ID of current thread static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure. - + public: // PAUSE / RESUME functionality. See source code for important usage notes. // Called from MAIN THREAD. void pause(); void unpause(); - bool isPaused() { return isStopped() || mPaused == true; } - + bool isPaused() { return isStopped() || mPaused; } + // Cause the thread to wake up and check its condition void wake(); diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 42c4911ff1..b1ddfc952c 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -424,7 +424,7 @@ F32SecondsImplicit LLTimer::getElapsedTimeAndResetF32() /////////////////////////////////////////////////////////////////////////////// -void LLTimer::setTimerExpirySec(F32SecondsImplicit expiration) +void LLTimer::setTimerExpirySec(F32SecondsImplicit expiration) { mExpirationTicks = get_clock_count() + (U64)((F32)(expiration * get_timer_info().mClockFrequency.value())); @@ -441,7 +441,7 @@ F32SecondsImplicit LLTimer::getRemainingTimeF32() const } -bool LLTimer::checkExpirationAndReset(F32 expiration) +bool LLTimer::checkExpirationAndReset(F32 expiration) { U64 cur_ticks = get_clock_count(); if (cur_ticks < mExpirationTicks) @@ -455,10 +455,9 @@ bool LLTimer::checkExpirationAndReset(F32 expiration) } -bool LLTimer::hasExpired() const +bool LLTimer::hasExpired() const { - return (get_clock_count() >= mExpirationTicks) - ? true : false; + return get_clock_count() >= mExpirationTicks; } /////////////////////////////////////////////////////////////////////////////// diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index 9c306266e7..54fb5742a2 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -153,7 +153,7 @@ struct lluuid_less { bool operator()(const LLUUID& lhs, const LLUUID& rhs) const { - return (lhs < rhs) ? true : false; + return lhs < rhs; } }; diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp index 06c74bdba0..231dbe4310 100644 --- a/indra/llcommon/llworkerthread.cpp +++ b/indra/llcommon/llworkerthread.cpp @@ -284,7 +284,7 @@ bool LLWorkerClass::yield() mWorkerThread->checkPause(); bool res; mMutex.lock(); - res = (getFlags() & WCF_ABORT_REQUESTED) ? true : false; + res = (getFlags() & WCF_ABORT_REQUESTED) != 0; mMutex.unlock(); return res; } diff --git a/indra/llcommon/llworkerthread.h b/indra/llcommon/llworkerthread.h index eb26c28d3d..a0fe30404d 100644 --- a/indra/llcommon/llworkerthread.h +++ b/indra/llcommon/llworkerthread.h @@ -178,7 +178,7 @@ private: void clearFlags(U32 flags) { mWorkFlags = mWorkFlags & ~flags; } U32 getFlags() { return mWorkFlags; } public: - bool getFlags(U32 flags) { return mWorkFlags & flags ? true : false; } + bool getFlags(U32 flags) { return (mWorkFlags & flags) != 0; } private: // pure virtuals diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index c448ab1bfe..e02894c271 100644 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -187,27 +187,27 @@ bool LLCrashLogger::readMinidump(std::string minidump_path) size_t length=0; llifstream minidump_stream(minidump_path.c_str(), std::ios_base::in | std::ios_base::binary); - if(minidump_stream.is_open()) + if (minidump_stream.is_open()) { minidump_stream.seekg(0, std::ios::end); length = (size_t)minidump_stream.tellg(); LL_WARNS("CRASHREPORT") << "minidump length "<< length <<LL_ENDL; minidump_stream.seekg(0, std::ios::beg); - + LLSD::Binary data; data.resize(length); - + minidump_stream.read(reinterpret_cast<char *>(&(data[0])),length); minidump_stream.close(); - + mCrashInfo["Minidump"] = data; } else { LL_WARNS("CRASHREPORT") << "failed to open minidump "<<minidump_path<<LL_ENDL; } - - return (length>0?true:false); + + return length > 0; } void LLCrashLogger::gatherFiles() diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 598e28921d..36d9e1c900 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -949,7 +949,7 @@ const std::string& LLParcel::getActionString(LLParcel::EAction action) bool LLParcel::isSaleTimerExpired(const U64& time) { - if (mSaleTimerExpires.getStarted() == false) + if (!mSaleTimerExpires.getStarted()) { return false; } @@ -963,7 +963,7 @@ bool LLParcel::isSaleTimerExpired(const U64& time) bool LLParcel::isMediaResetTimerExpired(const U64& time) { - if (mMediaResetTimer.getStarted() == false) + if (!mMediaResetTimer.getStarted()) { return false; } diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 0311a5bbd5..70522d3682 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -444,82 +444,50 @@ public: // more accessors - U32 getParcelFlags() const { return mParcelFlags; } + U32 getParcelFlags() const { return mParcelFlags; } - bool getParcelFlag(U32 flag) const - { return (mParcelFlags & flag) ? true : false; } + bool getParcelFlag(U32 flag) const { return (mParcelFlags & flag) != 0; } // objects can be added or modified by anyone (only parcel owner if disabled) - bool getAllowModify() const - { return (mParcelFlags & PF_CREATE_OBJECTS) ? true : false; } + bool getAllowModify() const { return getParcelFlag(PF_CREATE_OBJECTS); } // objects can be added or modified by group members - bool getAllowGroupModify() const - { return (mParcelFlags & PF_CREATE_GROUP_OBJECTS) ? true : false; } + bool getAllowGroupModify() const { return getParcelFlag(PF_CREATE_GROUP_OBJECTS); } // the parcel can be deeded to the group - bool getAllowDeedToGroup() const - { return (mParcelFlags & PF_ALLOW_DEED_TO_GROUP) ? true : false; } + bool getAllowDeedToGroup() const { return getParcelFlag(PF_ALLOW_DEED_TO_GROUP); } // Does the owner want to make a contribution along with the deed. - bool getContributeWithDeed() const - { return (mParcelFlags & PF_CONTRIBUTE_WITH_DEED) ? true : false; } + bool getContributeWithDeed() const { return getParcelFlag(PF_CONTRIBUTE_WITH_DEED); } // heightfield can be modified - bool getAllowTerraform() const - { return (mParcelFlags & PF_ALLOW_TERRAFORM) ? true : false; } + bool getAllowTerraform() const { return getParcelFlag(PF_ALLOW_TERRAFORM); } // avatars can be hurt here - bool getAllowDamage() const - { return (mParcelFlags & PF_ALLOW_DAMAGE) ? true : false; } - - bool getAllowFly() const - { return (mParcelFlags & PF_ALLOW_FLY) ? true : false; } - - bool getAllowGroupScripts() const - { return (mParcelFlags & PF_ALLOW_GROUP_SCRIPTS) ? true : false; } - - bool getAllowOtherScripts() const - { return (mParcelFlags & PF_ALLOW_OTHER_SCRIPTS) ? true : false; } - - bool getAllowAllObjectEntry() const - { return (mParcelFlags & PF_ALLOW_ALL_OBJECT_ENTRY) ? true : false; } - - bool getAllowGroupObjectEntry() const - { return (mParcelFlags & PF_ALLOW_GROUP_OBJECT_ENTRY) ? true : false; } - - bool getForSale() const - { return (mParcelFlags & PF_FOR_SALE) ? true : false; } - bool getSoundLocal() const - { return (mParcelFlags & PF_SOUND_LOCAL) ? true : false; } - bool getParcelFlagAllowVoice() const - { return (mParcelFlags & PF_ALLOW_VOICE_CHAT) ? true : false; } - bool getParcelFlagUseEstateVoiceChannel() const - { return (mParcelFlags & PF_USE_ESTATE_VOICE_CHAN) ? true : false; } - bool getAllowPublish() const - { return (mParcelFlags & PF_ALLOW_PUBLISH) ? true : false; } - bool getMaturePublish() const - { return (mParcelFlags & PF_MATURE_PUBLISH) ? true : false; } - bool getRestrictPushObject() const - { return (mParcelFlags & PF_RESTRICT_PUSHOBJECT) ? true : false; } - bool getRegionPushOverride() const - { return mRegionPushOverride; } - bool getRegionDenyAnonymousOverride() const - { return mRegionDenyAnonymousOverride; } - bool getRegionDenyAgeUnverifiedOverride() const - { return mRegionDenyAgeUnverifiedOverride; } - bool getRegionAllowAccessOverride() const - { return mRegionAllowAccessoverride; } - bool getRegionAllowEnvironmentOverride() const - { return mRegionAllowEnvironmentOverride; } - S32 getParcelEnvironmentVersion() const - { return mCurrentEnvironmentVersion; } - - - bool getAllowGroupAVSounds() const { return mAllowGroupAVSounds; } - bool getAllowAnyAVSounds() const { return mAllowAnyAVSounds; } - - bool getObscureMOAP() const { return mObscureMOAP; } + bool getAllowDamage() const { return getParcelFlag(PF_ALLOW_DAMAGE); } + + bool getAllowFly() const { return getParcelFlag(PF_ALLOW_FLY); } + bool getAllowGroupScripts() const { return getParcelFlag(PF_ALLOW_GROUP_SCRIPTS); } + bool getAllowOtherScripts() const { return getParcelFlag(PF_ALLOW_OTHER_SCRIPTS); } + bool getAllowAllObjectEntry() const { return getParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY); } + bool getAllowGroupObjectEntry() const { return getParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY); } + bool getForSale() const { return getParcelFlag(PF_FOR_SALE); } + bool getSoundLocal() const { return getParcelFlag(PF_SOUND_LOCAL); } + bool getParcelFlagAllowVoice() const { return getParcelFlag(PF_ALLOW_VOICE_CHAT); } + bool getParcelFlagUseEstateVoiceChannel() const { return getParcelFlag(PF_USE_ESTATE_VOICE_CHAN); } + bool getAllowPublish() const { return getParcelFlag(PF_ALLOW_PUBLISH); } + bool getMaturePublish() const { return getParcelFlag(PF_MATURE_PUBLISH); } + bool getRestrictPushObject() const { return getParcelFlag(PF_RESTRICT_PUSHOBJECT); } + + bool getRegionPushOverride() const { return mRegionPushOverride; } + bool getRegionDenyAnonymousOverride() const { return mRegionDenyAnonymousOverride; } + bool getRegionDenyAgeUnverifiedOverride() const { return mRegionDenyAgeUnverifiedOverride; } + bool getRegionAllowAccessOverride() const { return mRegionAllowAccessoverride; } + bool getRegionAllowEnvironmentOverride() const { return mRegionAllowEnvironmentOverride; } + S32 getParcelEnvironmentVersion() const { return mCurrentEnvironmentVersion; } + bool getAllowGroupAVSounds() const { return mAllowGroupAVSounds; } + bool getAllowAnyAVSounds() const { return mAllowAnyAVSounds; } + bool getObscureMOAP() const { return mObscureMOAP; } F32 getDrawDistance() const { return mDrawDistance; } S32 getSalePrice() const { return mSalePrice; } @@ -597,7 +565,7 @@ public: LLUUID getPreviousOwnerID() const { return mPreviousOwnerID; } bool getPreviouslyGroupOwned() const { return mPreviouslyGroupOwned; } - bool getSellWithObjects() const { return (mParcelFlags & PF_SELL_PARCEL_OBJECTS) ? true : false; } + bool getSellWithObjects() const { return getParcelFlag(PF_SELL_PARCEL_OBJECTS); } protected: LLUUID mID; diff --git a/indra/llmath/llsphere.cpp b/indra/llmath/llsphere.cpp index 7292e3c0de..3f04ca704c 100644 --- a/indra/llmath/llsphere.cpp +++ b/indra/llmath/llsphere.cpp @@ -73,14 +73,14 @@ F32 LLSphere::getRadius() const bool LLSphere::contains(const LLSphere& other_sphere) const { F32 separation = (mCenter - other_sphere.mCenter).length(); - return (mRadius >= separation + other_sphere.mRadius) ? true : false; + return mRadius >= separation + other_sphere.mRadius; } // returns 'true' if this sphere completely contains other_sphere bool LLSphere::overlaps(const LLSphere& other_sphere) const { F32 separation = (mCenter - other_sphere.mCenter).length(); - return (separation <= mRadius + other_sphere.mRadius) ? true : false; + return mRadius >= separation - other_sphere.mRadius; } // returns overlap @@ -93,9 +93,8 @@ F32 LLSphere::getOverlap(const LLSphere& other_sphere) const bool LLSphere::operator==(const LLSphere& rhs) const { - // TODO? -- use approximate equality for centers? - return (mRadius == rhs.mRadius - && mCenter == rhs.mCenter); + return fabs(mRadius - rhs.mRadius) <= FLT_EPSILON && + (mCenter - rhs.mCenter).length() <= FLT_EPSILON; } std::ostream& operator<<( std::ostream& output_stream, const LLSphere& sphere) diff --git a/indra/llmath/lltreenode.h b/indra/llmath/lltreenode.h index 0b479c4564..ce104b88a0 100644 --- a/indra/llmath/lltreenode.h +++ b/indra/llmath/lltreenode.h @@ -56,10 +56,11 @@ public: virtual bool insert(T* data); virtual bool remove(T* data); virtual void notifyRemoval(T* data); - virtual U32 getListenerCount() { return mListeners.size(); } + virtual U32 hasListeners() const { return !mListeners.empty(); } + virtual U32 getListenerCount() const { return mListeners.size(); } virtual LLTreeListener<T>* getListener(U32 index) const { - if(index < mListeners.size()) + if (index < mListeners.size()) { return mListeners[index]; } diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index d38d88eb0e..fa69699436 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -6802,45 +6802,63 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) mIndices[cur_index++] = s+1 + mNumS*t; //bottom right mIndices[cur_index++] = s+1 + mNumS*(t+1); //top right - mEdge[cur_edge++] = (mNumS-1)*2*t+s*2+1; //bottom left/top right neighbor face - if (t < mNumT-2) { //top right/top left neighbor face + // bottom left/top right neighbor face + mEdge[cur_edge++] = (mNumS-1)*2*t+s*2+1; + + if (t < mNumT-2) + { // top right/top left neighbor face mEdge[cur_edge++] = (mNumS-1)*2*(t+1)+s*2+1; } - else if (mNumT <= 3 || volume->getPath().isOpen() == true) { //no neighbor + else if (mNumT <= 3 || volume->getPath().isOpen()) + { // no neighbor mEdge[cur_edge++] = -1; } - else { //wrap on T + else + { // wrap on T mEdge[cur_edge++] = s*2+1; } - if (s > 0) { //top left/bottom left neighbor face + + if (s > 0) + { // top left/bottom left neighbor face mEdge[cur_edge++] = (mNumS-1)*2*t+s*2-1; } - else if (flat_face || volume->getProfile().isOpen() == true) { //no neighbor + else if (flat_face || volume->getProfile().isOpen()) + { // no neighbor mEdge[cur_edge++] = -1; } - else { //wrap on S + else + { // wrap on S mEdge[cur_edge++] = (mNumS-1)*2*t+(mNumS-2)*2+1; } - - if (t > 0) { //bottom left/bottom right neighbor face + + if (t > 0) + { // bottom left/bottom right neighbor face mEdge[cur_edge++] = (mNumS-1)*2*(t-1)+s*2; } - else if (mNumT <= 3 || volume->getPath().isOpen() == true) { //no neighbor + else if (mNumT <= 3 || volume->getPath().isOpen()) + { // no neighbor mEdge[cur_edge++] = -1; } - else { //wrap on T + else + { // wrap on T mEdge[cur_edge++] = (mNumS-1)*2*(mNumT-2)+s*2; } - if (s < mNumS-2) { //bottom right/top right neighbor face + + if (s < mNumS-2) + { // bottom right/top right neighbor face mEdge[cur_edge++] = (mNumS-1)*2*t+(s+1)*2; } - else if (flat_face || volume->getProfile().isOpen() == true) { //no neighbor + else if (flat_face || volume->getProfile().isOpen()) + { // no neighbor mEdge[cur_edge++] = -1; } - else { //wrap on S + else + { // wrap on S mEdge[cur_edge++] = (mNumS-1)*2*t; } - mEdge[cur_edge++] = (mNumS-1)*2*t+s*2; //top right/bottom left neighbor face + + // top right/bottom left neighbor face + mEdge[cur_edge++] = (mNumS-1)*2*t+s*2; } } } @@ -6977,7 +6995,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) if (sculpt_stitching == LL_SCULPT_TYPE_NONE) // logic for non-sculpt volumes { - if (volume->getPath().isOpen() == false) + if (!volume->getPath().isOpen()) { //wrap normals on T for (S32 i = 0; i < mNumS; i++) { @@ -6988,7 +7006,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build) } } - if ((volume->getProfile().isOpen() == false) && !(s_bottom_converges)) + if (!volume->getProfile().isOpen() && !s_bottom_converges) { //wrap normals on S for (S32 i = 0; i < mNumT; i++) { diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp index d1e145cff1..06794fd23f 100644 --- a/indra/llmath/llvolumemgr.cpp +++ b/indra/llmath/llvolumemgr.cpp @@ -71,7 +71,7 @@ bool LLVolumeMgr::cleanup() iter != end; iter++) { LLVolumeLODGroup *volgroupp = iter->second; - if (volgroupp->cleanupRefs() == false) + if (!volgroupp->cleanupRefs()) { no_refs = false; } diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp index f97b11a94d..aa35b4cdd2 100644 --- a/indra/llmath/llvolumeoctree.cpp +++ b/indra/llmath/llvolumeoctree.cpp @@ -71,10 +71,9 @@ bool LLLineSegmentBoxIntersect(const LLVector4a& start, const LLVector4a& end, c grt = f.greaterThan(rhs).getGatheredBits(); - return (grt & 0x7) ? false : true; + return (grt & 0x7) == 0; } - LLVolumeOctreeListener::LLVolumeOctreeListener(LLOctreeNode<LLVolumeTriangle, LLVolumeTriangle*>* node) { node->addListener(this); @@ -84,7 +83,7 @@ LLVolumeOctreeListener::~LLVolumeOctreeListener() { } - + void LLVolumeOctreeListener::handleChildAddition(const LLOctreeNode<LLVolumeTriangle, LLVolumeTriangle*>* parent, LLOctreeNode<LLVolumeTriangle, LLVolumeTriangle*>* child) { diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index c90b6d86ad..5b4f9aded7 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -87,19 +87,19 @@ public: LLUUID mID; LLCacheNameSignal mSignal; LLHost mHost; - + PendingReply(const LLUUID& id, const LLHost& host) : mID(id), mHost(host) { } - + boost::signals2::connection setCallback(const LLCacheNameCallback& cb) { return mSignal.connect(cb); } - + void done() { mID.setNull(); } - bool isDone() const { return mID.isNull() != false; } + bool isDone() const { return mID.isNull(); } }; class ReplySender diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 44720f0015..52e6be6f98 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -113,7 +113,7 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll) { LL_DEBUGS() << "Poll -- " << (msg?msg:"") << ": no descriptor." << LL_ENDL; } -#endif +#endif } /** @@ -181,12 +181,13 @@ bool LLPumpIO::prime(apr_pool_t* pool) { cleanup(); initialize(pool); - return ((pool == NULL) ? false : true); + return pool != nullptr; } bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request) { - if(chain.empty()) return false; + if (chain.empty()) + return false; LLChainInfo info; info.mHasCurlRequest = has_curl_request; @@ -218,12 +219,13 @@ bool LLPumpIO::addChain( LLSD context, F32 timeout) { - // remember that if the caller is providing a full link // description, we need to have that description matched to a // particular buffer. - if(!data) return false; - if(links.empty()) return false; + if (!data) + return false; + if (links.empty()) + return false; #if LL_DEBUG_PIPE_TYPE_IN_PUMP LL_DEBUGS() << "LLPumpIO::addChain() " << links[0].mPipe << " '" @@ -243,10 +245,11 @@ bool LLPumpIO::addChain( bool LLPumpIO::setTimeoutSeconds(F32 timeout) { // If no chain is running, return failure. - if(mRunningChains.end() == mCurrentChain) + if (mRunningChains.end() == mCurrentChain) { return false; } + (*mCurrentChain).setTimeoutSeconds(timeout); return true; } @@ -254,7 +257,7 @@ bool LLPumpIO::setTimeoutSeconds(F32 timeout) void LLPumpIO::adjustTimeoutSeconds(F32 delta) { // Ensure a chain is running - if(mRunningChains.end() != mCurrentChain) + if (mRunningChains.end() != mCurrentChain) { (*mCurrentChain).adjustTimeoutSeconds(delta); } @@ -263,27 +266,27 @@ void LLPumpIO::adjustTimeoutSeconds(F32 delta) static std::string events_2_string(apr_int16_t events) { std::ostringstream ostr; - if(events & APR_POLLIN) + if (events & APR_POLLIN) { ostr << "read,"; } - if(events & APR_POLLPRI) + if (events & APR_POLLPRI) { ostr << "priority,"; } - if(events & APR_POLLOUT) + if (events & APR_POLLOUT) { ostr << "write,"; } - if(events & APR_POLLERR) + if (events & APR_POLLERR) { ostr << "error,"; } - if(events & APR_POLLHUP) + if (events & APR_POLLHUP) { ostr << "hangup,"; } - if(events & APR_POLLNVAL) + if (events & APR_POLLNVAL) { ostr << "invalid,"; } @@ -292,7 +295,8 @@ static std::string events_2_string(apr_int16_t events) bool LLPumpIO::setConditional(LLIOPipe* pipe, const apr_pollfd_t* poll) { - if(!pipe) return false; + if (!pipe) + return false; ll_debug_poll_fd("Set conditional", poll); LL_DEBUGS() << "Setting conditionals (" << (poll ? events_2_string(poll->reqevents) :"null") diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h index 489765e0ac..ab2d127f6e 100644 --- a/indra/llmessage/llregionflags.h +++ b/indra/llmessage/llregionflags.h @@ -106,11 +106,16 @@ const U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE | REGION_FLAGS_DENY_ANONYMOUS | REGION_FLAGS_DENY_AGEUNVERIFIED; +inline bool is_flag_set(U64 flags, U64 flag) +{ + return (flags & flag) != 0; +} + inline bool is_prelude( U64 flags ) { // definition of prelude does not depend on fixed-sun - return 0 == (flags & REGION_FLAGS_PRELUDE_UNSET) - && 0 != (flags & REGION_FLAGS_PRELUDE_SET); + return !is_flag_set(flags, REGION_FLAGS_PRELUDE_UNSET) && + is_flag_set(flags, REGION_FLAGS_PRELUDE_SET); } inline U64 set_prelude_flags(U64 flags) diff --git a/indra/llmessage/lluseroperation.cpp b/indra/llmessage/lluseroperation.cpp index 3e387d3d5e..6b0cc63686 100644 --- a/indra/llmessage/lluseroperation.cpp +++ b/indra/llmessage/lluseroperation.cpp @@ -138,7 +138,7 @@ bool LLUserOperationMgr::deleteOperation(LLUserOperation* op) delete op; op = NULL; } - return rv ? true : false; + return rv != 0; } void LLUserOperationMgr::deleteExpiredOperations() diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 0d7810a659..272bf9b672 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -1947,7 +1947,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, // passed the circuit code and session id check, so we will go // ahead and persist the ID associated. LLCircuitData *cdp = msg->mCircuitInfo.findCircuit(msg->getSender()); - bool had_circuit_already = cdp ? true : false; + bool had_circuit_already = cdp != nullptr; msg->enableCircuit(msg->getSender(), false); cdp = msg->mCircuitInfo.findCircuit(msg->getSender()); diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 1242646a8a..bcd33ba2db 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -256,17 +256,18 @@ public: } }; - //Are the doubles the same w/in epsilon specified tolerance bool areEqual( double a, double b ) { const float epsilon = 1e-5f; - return (fabs((a - b)) < epsilon) ? true : false ; + return fabs(a - b) < epsilon; } + //Make sure that we return false for any values that are within the tolerance for equivalence bool jointPositionalLookup( const LLVector3& a, const LLVector3& b ) { - return ( areEqual( a[0],b[0]) && areEqual( a[1],b[1] ) && areEqual( a[2],b[2]) ) ? true : false; + const float epsilon = 1e-5f; + return (a - b).length() < epsilon; } //copy of position array for this model -- mPosition[idx].mV[X,Y,Z] diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index c4fe4fdf62..2b15adb162 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -566,6 +566,7 @@ public: void addFlags(U32 flags) { mMiscFlags |= flags; } void removeFlags(U32 flags) { mMiscFlags &= ~flags; } U32 getFlags() const { return mMiscFlags; } + bool checkFlags(U32 flags) const { return (mMiscFlags & flags) != 0; } static std::string pCodeToString(const LLPCode pcode); static LLPCode legacyToPCode(const U8 legacy); @@ -603,21 +604,19 @@ public: inline bool LLPrimitive::isAvatar() const { - return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode ) ? true : false; + return LL_PCODE_LEGACY_AVATAR == mPrimitiveCode; } inline bool LLPrimitive::isSittingAvatar() const { // this is only used server-side - return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode - && ((getFlags() & (PRIM_FLAG_SITTING | PRIM_FLAG_SITTING_ON_GROUND)) != 0) ) ? true : false; + return isAvatar() && checkFlags(PRIM_FLAG_SITTING | PRIM_FLAG_SITTING_ON_GROUND); } inline bool LLPrimitive::isSittingAvatarOnGround() const { // this is only used server-side - return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode - && ((getFlags() & PRIM_FLAG_SITTING_ON_GROUND) != 0) ) ? true : false; + return isAvatar() && checkFlags(PRIM_FLAG_SITTING_ON_GROUND); } // static diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp index 8d47a7147f..1b3422ab6d 100644 --- a/indra/llprimitive/llvolumemessage.cpp +++ b/indra/llprimitive/llvolumemessage.cpp @@ -478,13 +478,15 @@ bool LLVolumeMessage::constrainVolumeParams(LLVolumeParams& params) bad |= params.setRevolutions(params.getPathParams().getRevolutions()) ? 0 : 0x200; bad |= params.setRadiusOffset(params.getPathParams().getRadiusOffset()) ? 0 : 0x400; bad |= params.setSkew(params.getPathParams().getSkew()) ? 0 : 0x800; - if(bad) + + if (bad) { LL_WARNS() << "LLVolumeMessage::constrainVolumeParams() - " << "forced to constrain incoming volume params: " - << llformat("0x%04x",bad) << LL_ENDL; + << llformat("0x%04x", bad) << LL_ENDL; } - return bad ? false : true; + + return bad == 0; } bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSystem *mesgsys) diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp index ed0ad07dc0..4f8d4015b6 100644 --- a/indra/llrender/llcubemaparray.cpp +++ b/indra/llrender/llcubemaparray.cpp @@ -42,6 +42,8 @@ //#pragma optimize("", off) +using namespace LLImageGLMemory; + // MUST match order of OpenGL face-layers GLenum LLCubeMapArray::sTargets[6] = { @@ -128,6 +130,8 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us U32 mip = 0; + free_cur_tex_image(); + while (resolution >= 1) { glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, format, resolution, resolution, count * 6, 0, @@ -141,6 +145,8 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us ++mip; } + alloc_tex_image(resolution * 6, resolution, format); + mImage->setAddressMode(LLTexUnit::TAM_CLAMP); if (use_mips) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index ed729f64e3..39345929b3 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -63,7 +63,7 @@ static U64 sTextureBytes = 0; // track a texture alloc on the currently bound texture. // asserts that no currently tracked alloc exists -static void alloc_tex_image(U32 width, U32 height, U32 pixformat) +void LLImageGLMemory::alloc_tex_image(U32 width, U32 height, U32 pixformat) { U32 texUnit = gGL.getCurrentTexUnitIndex(); U32 texName = gGL.getTexUnit(texUnit)->getCurrTexture(); @@ -81,7 +81,7 @@ static void alloc_tex_image(U32 width, U32 height, U32 pixformat) } // track texture free on given texName -static void free_tex_image(U32 texName) +void LLImageGLMemory::free_tex_image(U32 texName) { sTexMemMutex.lock(); auto iter = sTextureAllocs.find(texName); @@ -98,7 +98,7 @@ static void free_tex_image(U32 texName) } // track texture free on given texNames -static void free_tex_images(U32 count, const U32* texNames) +void LLImageGLMemory::free_tex_images(U32 count, const U32* texNames) { for (int i = 0; i < count; ++i) { @@ -107,13 +107,15 @@ static void free_tex_images(U32 count, const U32* texNames) } // track texture free on currently bound texture -static void free_cur_tex_image() +void LLImageGLMemory::free_cur_tex_image() { U32 texUnit = gGL.getCurrentTexUnitIndex(); U32 texName = gGL.getTexUnit(texUnit)->getCurrTexture(); free_tex_image(texName); } +using namespace LLImageGLMemory; + // static U64 LLImageGL::getTextureBytesAllocated() { @@ -289,6 +291,8 @@ S32 LLImageGL::dataFormatBits(S32 dataformat) case GL_SRGB_ALPHA: return 32; case GL_BGRA: return 32; // Used for QuickTime media textures on the Mac case GL_DEPTH_COMPONENT: return 24; + case GL_RGB16F: return 48; + case GL_RGBA16F: return 64; default: LL_ERRS() << "LLImageGL::Unknown format: " << dataformat << LL_ENDL; return 0; @@ -2432,7 +2436,7 @@ bool LLImageGL::getMask(const LLVector2 &tc) S32 idx = y*mPickMaskWidth+x; S32 offset = idx%8; - res = mPickMask[idx/8] & (1 << offset) ? true : false; + res = (mPickMask[idx/8] & (1 << offset)) != 0; } return res; diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 60fa1258b6..18187734f1 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -47,6 +47,14 @@ class LLWindow; #define BYTES_TO_MEGA_BYTES(x) ((x) >> 20) #define MEGA_BYTES_TO_BYTES(x) ((x) << 20) +namespace LLImageGLMemory +{ + void alloc_tex_image(U32 width, U32 height, U32 pixformat); + void free_tex_image(U32 texName); + void free_tex_images(U32 count, const U32* texNames); + void free_cur_tex_image(); +} + //============================================================================ class LLImageGL : public LLRefCount { diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 9cd7527d3e..098e23435d 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -545,7 +545,7 @@ void LLRenderTarget::flush() bool LLRenderTarget::isComplete() const { - return (!mTex.empty() || mDepth) ? true : false; + return !mTex.empty() || mDepth; } void LLRenderTarget::getViewport(S32* viewport) diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index d88e1a1f11..f075aa564e 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -265,7 +265,7 @@ void LLAccordionCtrl::showScrollbar(S32 width, S32 height) void LLAccordionCtrl::hideScrollbar(S32 width, S32 height) { - if (mScrollbar->getVisible() == false) + if (!mScrollbar->getVisible()) return; mScrollbar->setVisible(false); @@ -391,7 +391,7 @@ void LLAccordionCtrl::updateNoTabsHelpTextVisibility() } } - mNoVisibleTabsHelpText->setVisible(visible_exists ? false : true); + mNoVisibleTabsHelpText->setVisible(!visible_exists); } void LLAccordionCtrl::arrangeSingle() @@ -407,7 +407,7 @@ void LLAccordionCtrl::arrangeSingle() { LLAccordionCtrlTab* accordion_tab = dynamic_cast<LLAccordionCtrlTab*>(mAccordionTabs[i]); - if (accordion_tab->getVisible() == false) // Skip hidden accordion tabs + if (!accordion_tab->getVisible()) // Skip hidden accordion tabs continue; if (!accordion_tab->isExpanded() ) { @@ -421,7 +421,7 @@ void LLAccordionCtrl::arrangeSingle() { LLAccordionCtrlTab* accordion_tab = dynamic_cast<LLAccordionCtrlTab*>(mAccordionTabs[i]); - if (accordion_tab->getVisible() == false) // Skip hidden accordion tabs + if (!accordion_tab->getVisible()) // Skip hidden accordion tabs continue; if (!accordion_tab->isExpanded() ) { @@ -469,7 +469,7 @@ void LLAccordionCtrl::arrangeMultiple() { LLAccordionCtrlTab* accordion_tab = dynamic_cast<LLAccordionCtrlTab*>(mAccordionTabs[i]); - if (accordion_tab->getVisible() == false) // Skip hidden accordion tabs + if (!accordion_tab->getVisible()) // Skip hidden accordion tabs continue; if (!accordion_tab->isExpanded() ) @@ -624,7 +624,7 @@ bool LLAccordionCtrl::autoScroll(S32 x, S32 y) } } - return scrolling ? true : false; + return scrolling; } void LLAccordionCtrl::updateLayout(S32 width, S32 height) diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index c8f75a1af2..5945c31407 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -643,7 +643,7 @@ void LLAccordionCtrlTab::setHeaderVisible(bool value) if (mHeader) { - mHeader->setVisible(value ? true : false); + mHeader->setVisible(value); } reshape(getRect().getWidth(), getRect().getHeight(), false); @@ -992,7 +992,7 @@ void LLAccordionCtrlTab::hideScrollbar(const LLRect& child_rect) if (!mContainerPanel || !mScrollbar) return; - if (mScrollbar->getVisible() == false) + if (!mScrollbar->getVisible()) return; mScrollbar->setVisible(false); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index d87e4ce70f..1c3efaa9cf 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -281,15 +281,15 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key) { LLFloater* instance = findInstance(name, key); - if (LLFloater::isShown(instance)) + if (instance && instance->isShown()) { instance->closeHostedFloater(); return false; } - else - { - return showInstance(name, key, true) ? true : false; - } + + instance = showInstance(name, key, true); + + return instance != nullptr; } //static diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index bcbc0f9970..311056f541 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -484,7 +484,7 @@ void LLFolderViewItem::deselectItem(void) void LLFolderViewItem::selectItem(void) { - if (mIsSelected == false) + if (!mIsSelected) { mIsSelected = true; getViewModelItem()->selectItem(); @@ -1582,7 +1582,8 @@ void LLFolderViewFolder::gatherChildRangeExclusive(LLFolderViewItem* start, LLFo void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) { - if (getRoot()->getAllowMultiSelect() == false) return; + if (!getRoot()->getAllowMultiSelect()) + return; LLFolderViewItem* cur_selected_item = getRoot()->getCurSelectedItem(); if (cur_selected_item == NULL) @@ -1593,14 +1594,15 @@ void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) bool reverse = false; LLFolderViewFolder* common_ancestor = getCommonAncestor(cur_selected_item, new_selection, reverse); - if (!common_ancestor) return; + if (!common_ancestor) + return; LLFolderViewItem* last_selected_item_from_cur = cur_selected_item; LLFolderViewFolder* cur_folder = cur_selected_item->getParentFolder(); std::vector<LLFolderViewItem*> items_to_select_forward; - while(cur_folder != common_ancestor) + while (cur_folder != common_ancestor) { cur_folder->gatherChildRangeExclusive(last_selected_item_from_cur, NULL, reverse, items_to_select_forward); @@ -1612,7 +1614,7 @@ void LLFolderViewFolder::extendSelectionTo(LLFolderViewItem* new_selection) LLFolderViewItem* last_selected_item_from_new = new_selection; cur_folder = new_selection->getParentFolder(); - while(cur_folder != common_ancestor) + while (cur_folder != common_ancestor) { cur_folder->gatherChildRangeExclusive(last_selected_item_from_new, NULL, !reverse, items_to_select_reverse); diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 7c834e0127..cf8cfa6ea6 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -136,7 +136,7 @@ S32 LLLayoutPanel::getVisibleDim() const * (min_dim + (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt)))); } - + void LLLayoutPanel::setOrientation( LLView::EOrientation orientation ) { mOrientation = orientation; @@ -144,9 +144,7 @@ void LLLayoutPanel::setOrientation( LLView::EOrientation orientation ) ? getRect().getWidth() : getRect().getHeight())); - if (mAutoResize == false - && mUserResize == true - && mMinDim == -1 ) + if (!mAutoResize && mUserResize && mMinDim == -1) { setMinDim(layout_dim); } @@ -170,7 +168,7 @@ void LLLayoutPanel::reshape( S32 width, S32 height, bool called_from_parent /*= { if (width == getRect().getWidth() && height == getRect().getHeight() && !LLView::sForceReshape) return; - if (!mIgnoreReshape && mAutoResize == false) + if (!mIgnoreReshape && !mAutoResize) { mTargetDim = (mOrientation == LLLayoutStack::HORIZONTAL) ? width : height; LLLayoutStack* stackp = dynamic_cast<LLLayoutStack*>(getParent()); diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 505216d0ff..8a04342af0 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1473,11 +1473,11 @@ bool LLLineEditor::handleSpecialKey(KEY key, MASK mask) // handle ctrl-uparrow if we have a history enabled line editor. case KEY_UP: - if( mHaveHistory && ((mIgnoreArrowKeys == false) || ( MASK_CONTROL == mask )) ) + if (mHaveHistory && (!mIgnoreArrowKeys || (MASK_CONTROL == mask))) { - if( mCurrentHistoryLine > mLineHistory.begin() ) + if (mCurrentHistoryLine > mLineHistory.begin()) { - mText.assign( *(--mCurrentHistoryLine) ); + mText.assign(*(--mCurrentHistoryLine)); setCursorToEnd(); } else @@ -1490,9 +1490,9 @@ bool LLLineEditor::handleSpecialKey(KEY key, MASK mask) // handle [ctrl]-downarrow if we have a history enabled line editor case KEY_DOWN: - if( mHaveHistory && ((mIgnoreArrowKeys == false) || ( MASK_CONTROL == mask )) ) + if (mHaveHistory && (!mIgnoreArrowKeys || (MASK_CONTROL == mask))) { - if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.end() - 1 ) + if (!mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.end() - 1) { mText.assign( *(++mCurrentHistoryLine) ); setCursorToEnd(); @@ -2684,7 +2684,7 @@ void LLLineEditor::showContextMenu(S32 x, S32 y) // If the cursor is on a misspelled word, retrieve suggestions for it std::string misspelled_word = getMisspelledWord(mCursorPos); - if ((is_misspelled = !misspelled_word.empty()) == true) + if ((is_misspelled = !misspelled_word.empty())) { LLSpellChecker::instance().getSuggestions(misspelled_word, mSuggestionList); } diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 25f32d9671..5dc92e555a 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1188,16 +1188,16 @@ void LLMenuItemBranchGL::updateBranchParent(LLView* parentp) } } -void LLMenuItemBranchGL::onVisibilityChange( bool new_visibility ) +void LLMenuItemBranchGL::onVisibilityChange(bool new_visibility) { - if (new_visibility == false && getBranch() && !getBranch()->getTornOff()) + if (!new_visibility && getBranch() && !getBranch()->getTornOff()) { getBranch()->setVisible(false); } LLMenuItemGL::onVisibilityChange(new_visibility); } -bool LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) +bool LLMenuItemBranchGL::handleKeyHere(KEY key, MASK mask) { LLMenuGL* branch = getBranch(); if (!branch) diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 04553e1f9f..2a45a8118e 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -138,7 +138,7 @@ void LLRadioGroup::setIndexEnabled(S32 index, bool enabled) if (count == index) { child->setEnabled(enabled); - if (index == mSelectedIndex && enabled == false) + if (index == mSelectedIndex && !enabled) { setSelectedIndex(-1); } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index dbfacafd00..535a880120 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1527,12 +1527,12 @@ bool LLScrollListCtrl::setSelectedByValue(const LLSD& value, bool selected) { LLSD::Binary data1 = value.asBinary(); LLSD::Binary data2 = item->getValue().asBinary(); - found = std::equal(data1.begin(), data1.end(), data2.begin()) ? true : false; + found = std::equal(data1.begin(), data1.end(), data2.begin()); } } else { - found = item->getValue().asString() == value.asString() ? true : false; + found = item->getValue().asString() == value.asString(); } if (found) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 81eaec620c..438b3d96b1 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2202,7 +2202,7 @@ void LLTextEditor::showContextMenu(S32 x, S32 y) // If the cursor is on a misspelled word, retrieve suggestions for it std::string misspelled_word = getMisspelledWord(mCursorPos); - if ((is_misspelled = !misspelled_word.empty()) == true) + if ((is_misspelled = !misspelled_word.empty())) { LLSpellChecker::instance().getSuggestions(misspelled_word, mSuggestionList); } diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 4e961a0a18..1c1414dd74 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -1049,20 +1049,20 @@ bool LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, std::string& tooltip_msg) { // If we have a drop callback, that means that we can handle the drop - bool handled = (mHandleDropCallback ? true : false); - + bool handled = mHandleDropCallback != nullptr; + // if drop is set, it's time to call the callback to get the operation done if (handled && drop) { - handled = mHandleDropCallback(cargo_data, x, y ,this); + handled = mHandleDropCallback(cargo_data, x, y, this); } - + // We accept only single tool drop on toolbars - *accept = (handled ? ACCEPT_YES_SINGLE : ACCEPT_NO); - + *accept = handled ? ACCEPT_YES_SINGLE : ACCEPT_NO; + // We'll use that flag to change the visual aspect of the toolbar target on draw() mDragAndDropTarget = false; - + // Convert drag position into insert position and rank if (!isReadOnly() && handled && !drop) { @@ -1073,7 +1073,7 @@ bool LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, int orig_rank = getRankFromPosition(dragged_command); mDragRank = getRankFromPosition(x, y); // Don't DaD if we're dragging a command on itself - mDragAndDropTarget = ((orig_rank != RANK_NONE) && ((mDragRank == orig_rank) || ((mDragRank-1) == orig_rank)) ? false : true); + mDragAndDropTarget = ((orig_rank != RANK_NONE) && ((mDragRank == orig_rank) || ((mDragRank - 1) == orig_rank))); //LL_INFOS() << "Merov debug : DaD, rank = " << mDragRank << ", dragged uui = " << inv_item->getUUID() << LL_ENDL; /* Do the following if you want to animate the button itself LLCommandId dragged_command(inv_item->getUUID()); @@ -1086,7 +1086,7 @@ bool LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, handled = false; } } - + return handled; } diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index aa9272f782..45668e4a87 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -229,7 +229,7 @@ bool LLUrlEntryBase::isWikiLinkCorrect(const std::string &labeled_url) const label = "http://" + label; } - return (LLUrlRegistry::instance().hasUrl(label)) ? false : true; + return !LLUrlRegistry::instance().hasUrl(label); } std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 57c635b019..30cc5cd10a 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -342,11 +342,11 @@ void LLView::removeChild(LLView* child) if (child->mParentView == this) { // if we are removing an item we are currently iterating over, that would be bad - llassert(child->mInDraw == false); + llassert(!child->mInDraw); mChildList.remove( child ); child->mParentView = NULL; child_tab_order_t::iterator found = mTabOrder.find(child); - if(found != mTabOrder.end()) + if (found != mTabOrder.end()) { mTabOrder.erase(found); } diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 84507a58b6..6209058875 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -935,7 +935,7 @@ bool LLXUIParser::readBoolValue(Parser& parser, void* val_ptr) bool value; LLXUIParser& self = static_cast<LLXUIParser&>(parser); bool success = self.mCurReadNode->getBoolValue(1, &value); - *((bool*)val_ptr) = (value != false); + *((bool*)val_ptr) = value; return success; } diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index d951f7f676..f1e6114f85 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -336,7 +336,7 @@ void LLWindow::handleUnicodeUTF16(U16 utf16, MASK mask) // static bool LLSplashScreen::isVisible() { - return gSplashScreenp ? true: false; + return gSplashScreenp; } // static diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 1c41c1f627..396daec527 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -164,8 +164,6 @@ public: virtual F32 getPixelAspectRatio() = 0; virtual void setNativeAspectRatio(F32 aspect) = 0; - // query VRAM usage - virtual U32 getAvailableVRAMMegabytes() = 0; virtual void setMaxVRAMMegabytes(U32 max_vram) = 0; virtual void beforeDialog() {}; // prepare to put up an OS dialog (if special measures are required, such as in fullscreen mode) diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 06e6b2783d..f422152ab2 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -101,7 +101,6 @@ public: /*virtual*/ F32 getPixelAspectRatio() override { return 1.0f; } /*virtual*/ void setNativeAspectRatio(F32 ratio) override {} - U32 getAvailableVRAMMegabytes() override { return 4096; } void setMaxVRAMMegabytes(U32 max_vram) override {} /*virtual*/ void *getPlatformWindow() override { return 0; } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index bfa893fff8..73230805b4 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -118,7 +118,6 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, U32 fsaa_samples, U32 max_vram) : LLWindow(NULL, fullscreen, flags) - , mMaxVRAM(max_vram) { // *HACK: During window construction we get lots of OS events for window // reshape, activate, etc. that the viewer isn't ready to handle. @@ -1255,21 +1254,6 @@ F32 LLWindowMacOSX::getPixelAspectRatio() return 1.f; } -U32 LLWindowMacOSX::getAvailableVRAMMegabytes() { - // MTL (and MoltenVK) has some additional gpu data, such as recommendedMaxWorkingSetSize and currentAllocatedSize. - // But these are not available for OpenGL and/or our current mimimum OS version. - // So we will estimate. - static const U32 mb = 1024*1024; - // We're asked for total available gpu memory, but we only have allocation info on texture usage. So estimate by doubling that. - static const U32 total_factor = 2; // estimated total/textures - U32 total_vram = gGLManager.mVRAM; - if (mMaxVRAM) - { - total_vram = llmin(mMaxVRAM, total_vram); - } - return total_vram - (LLImageGL::getTextureBytesAllocated() * total_factor/mb); -} - //static SInt32 oldWindowLevel; // MBW -- XXX -- There's got to be a better way than this. Find it, please... diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 7b0695bc79..0d675671a9 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -100,9 +100,7 @@ public: F32 getPixelAspectRatio() override; void setNativeAspectRatio(F32 ratio) override { mOverrideAspectRatio = ratio; } - // query VRAM usage - /*virtual*/ U32 getAvailableVRAMMegabytes() override; - virtual void setMaxVRAMMegabytes(U32 max_vram) override { mMaxVRAM = max_vram; } + virtual void setMaxVRAMMegabytes(U32 max_vram) override {} void beforeDialog() override; void afterDialog() override; @@ -226,7 +224,6 @@ protected: bool mMinimized; U32 mFSAASamples; bool mForceRebuild; - U32 mMaxVRAM; S32 mDragOverrideCursor; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 1ed801a85a..eb9ece6ea9 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -370,14 +370,6 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool //clean up DXGI/D3D resources void cleanupDX(); - // call periodically to update available VRAM - void updateVRAMUsage(); - - U32 getAvailableVRAMMegabytes() - { - return mAvailableVRAM; - } - /// called by main thread to post work to this window thread template <typename CALLABLE> void post(CALLABLE&& func) @@ -425,8 +417,6 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool // *HACK: Attempt to prevent startup crashes by deferring memory accounting // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18 bool mGLReady = false; - // best guess at available video memory in MB - std::atomic<U32> mAvailableVRAM; U32 mMaxVRAM = 0; // maximum amount of vram to allow in the "budget", or 0 for no maximum (see updateVRAMUsage) @@ -3378,7 +3368,7 @@ F32 LLWindowWin32::getGamma() bool LLWindowWin32::restoreGamma() { ASSERT_MAIN_THREAD(); - if (mCustomGammaSet != false) + if (mCustomGammaSet) { LL_DEBUGS("Window") << "Restoring gamma" << LL_ENDL; mCustomGammaSet = false; @@ -3393,12 +3383,12 @@ bool LLWindowWin32::setGamma(const F32 gamma) mCurrentGamma = gamma; //Get the previous gamma ramp to restore later. - if (mCustomGammaSet == false) + if (!mCustomGammaSet) { if (!gGLManager.mIsIntel) // skip for Intel GPUs (see SL-11341) { LL_DEBUGS("Window") << "Getting the previous gamma ramp to restore later" << LL_ENDL; - if(GetDeviceGammaRamp(mhDC, mPrevGammaRamp) == FALSE) + if (!GetDeviceGammaRamp(mhDC, mPrevGammaRamp)) { LL_WARNS("Window") << "Failed to get the previous gamma ramp" << LL_ENDL; return false; @@ -4556,11 +4546,6 @@ std::vector<std::string> LLWindowWin32::getDynamicFallbackFontList() return std::vector<std::string>(); } -U32 LLWindowWin32::getAvailableVRAMMegabytes() -{ - return mWindowThread ? mWindowThread->getAvailableVRAMMegabytes() : 0; -} - void LLWindowWin32::setMaxVRAMMegabytes(U32 max_vram) { if (mWindowThread) @@ -4787,79 +4772,6 @@ void LLWindowWin32::LLWindowWin32Thread::cleanupDX() } } -void LLWindowWin32::LLWindowWin32Thread::updateVRAMUsage() -{ - LL_PROFILE_ZONE_SCOPED; - if (!mGLReady) { return; } - - if (mDXGIAdapter != nullptr) - { - // NOTE: what lies below is hand wavy math based on compatibility testing and observation against a variety of hardware - // It doesn't make sense, but please don't refactor it to make sense. -- davep - - DXGI_QUERY_VIDEO_MEMORY_INFO info; - mDXGIAdapter->QueryVideoMemoryInfo(0, DXGI_MEMORY_SEGMENT_GROUP_LOCAL, &info); -#if 0 // debug 0 budget and 0 CU - info.Budget = 0; - info.CurrentUsage = 0; -#endif - - U32 budget_mb = info.Budget / 1024 / 1024; - gGLManager.mVRAM = llmax(gGLManager.mVRAM, (S32) budget_mb); - - U32 afr_mb = info.AvailableForReservation / 1024 / 1024; - // correct for systems that misreport budget - if (budget_mb == 0) - { - // fall back to available for reservation clamped between 512MB and 2GB - budget_mb = llclamp(afr_mb, (U32) 512, (U32) 2048); - } - - if ( mMaxVRAM != 0) - { - budget_mb = llmin(budget_mb, mMaxVRAM); - } - - U32 cu_mb = info.CurrentUsage / 1024 / 1024; - - // get an estimated usage based on texture bytes allocated - U32 eu_mb = LLImageGL::getTextureBytesAllocated() * 2 / 1024 / 1024; - - if (cu_mb == 0) - { // current usage is sometimes unreliable on Intel GPUs, fall back to estimated usage - cu_mb = llmax((U32)1, eu_mb); - } - U32 target_mb = budget_mb; - - if (target_mb > 4096) // if 4GB are installed, try to leave 2GB free - { - target_mb -= 2048; - } - else // if less than 4GB are installed, try not to use more than half of it - { - target_mb /= 2; - } - - mAvailableVRAM = cu_mb < target_mb ? target_mb - cu_mb : 0; - -#if 0 - - F32 eu_error = (F32)((S32)eu_mb - (S32)cu_mb) / (F32)cu_mb; - LL_INFOS("Window") << "\nLocal\nAFR: " << info.AvailableForReservation / 1024 / 1024 - << "\nBudget: " << info.Budget / 1024 / 1024 - << "\nCR: " << info.CurrentReservation / 1024 / 1024 - << "\nCU: " << info.CurrentUsage / 1024 / 1024 - << "\nEU: " << eu_mb << llformat(" (%.2f)", eu_error) - << "\nTU: " << target_mb - << "\nAM: " << mAvailableVRAM << LL_ENDL; -#endif - } - else if (mD3DDevice != NULL) - { // fallback to D3D9 - mAvailableVRAM = mD3DDevice->GetAvailableTextureMem() / 1024 / 1024; - } -} - void LLWindowWin32::LLWindowWin32Thread::run() { sWindowThreadId = std::this_thread::get_id(); @@ -4917,14 +4829,7 @@ void LLWindowWin32::LLWindowWin32Thread::run() //process any pending functions getQueue().runPending(); } - - // update available vram once every 3 seconds - static LLFrameTimer vramTimer; - if (vramTimer.getElapsedTimeF32() > 3.f) - { - updateVRAMUsage(); - vramTimer.reset(); - } + #if 0 { LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("w32t - Sleep"); diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 8b82ad92d5..7e320053a6 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -108,7 +108,6 @@ public: /*virtual*/ F32 getPixelAspectRatio(); /*virtual*/ void setNativeAspectRatio(F32 ratio) { mOverrideAspectRatio = ratio; } - U32 getAvailableVRAMMegabytes() override; /*virtual*/ void setMaxVRAMMegabytes(U32 max_vram) override; /*virtual*/ bool dialogColorPicker(F32 *r, F32 *g, F32 *b ); diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 6b7f63c192..952ad3e8cd 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -210,7 +210,7 @@ LLSD LLControlVariable::getComparableValue(const LLSD& value) void LLControlVariable::setValue(const LLSD& new_value, bool saved_value) { - if (mValidateSignal(this, new_value) == false) + if (!mValidateSignal(this, new_value)) { // can not set new value, exit return; @@ -218,12 +218,12 @@ void LLControlVariable::setValue(const LLSD& new_value, bool saved_value) LLSD storable_value = getComparableValue(new_value); LLSD original_value = getValue(); - bool value_changed = llsd_compare(original_value, storable_value) == false; + bool value_changed = !llsd_compare(original_value, storable_value); if(saved_value) { // If we're going to save this value, return to default but don't fire resetToDefault(false); - if (llsd_compare(mValues.back(), storable_value) == false) + if (!llsd_compare(mValues.back(), storable_value)) { mValues.push_back(storable_value); } @@ -233,7 +233,7 @@ void LLControlVariable::setValue(const LLSD& new_value, bool saved_value) // This is an unsaved value. Its needs to reside at // mValues[2] (or greater). It must not affect // the result of getSaveValue() - if (llsd_compare(mValues.back(), storable_value) == false) + if (!llsd_compare(mValues.back(), storable_value)) { while(mValues.size() > 2) { @@ -267,10 +267,10 @@ void LLControlVariable::setDefaultValue(const LLSD& value) LLSD comparable_value = getComparableValue(value); LLSD original_value = getValue(); - bool value_changed = (llsd_compare(original_value, comparable_value) == false); + bool value_changed = !llsd_compare(original_value, comparable_value); resetToDefault(false); mValues[0] = comparable_value; - if(value_changed) + if (value_changed) { firePropertyChanged(original_value); } diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp index 38321847c3..0c1615f486 100644 --- a/indra/llxml/llxmltree.cpp +++ b/indra/llxml/llxmltree.cpp @@ -155,14 +155,14 @@ void LLXmlTreeNode::dump( const std::string& prefix ) bool LLXmlTreeNode::hasAttribute(const std::string& name) { - LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); + LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString(name); attribute_map_t::iterator iter = mAttributes.find(canonical_name); - return (iter == mAttributes.end()) ? false : true; + return iter != mAttributes.end(); } void LLXmlTreeNode::addAttribute(const std::string& name, const std::string& value) { - LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); + LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString(name); const std::string *newstr = new std::string(value); mAttributes[canonical_name] = newstr; // insert + copy } 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 |