diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-29 07:43:28 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-29 07:56:09 +0300 |
commit | 1b68f71348ecf3983b76b40d7940da8377f049b7 (patch) | |
tree | 2974eddaef130a067c26033d60a59fc790365b3d /indra/newview/llfeaturemanager.h | |
parent | af4ea94efc1999f3b19fd8d643d0331f0b77e265 (diff) |
#824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed
Diffstat (limited to 'indra/newview/llfeaturemanager.h')
-rw-r--r-- | indra/newview/llfeaturemanager.h | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 70c6c09e0d..c333e2caeb 100644 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -1,25 +1,25 @@ -/** +/** * @file llfeaturemanager.h * @brief The feature manager is responsible for determining what features are turned on/off in the app. * * $LicenseInfo:firstyear=2003&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -37,151 +37,151 @@ typedef enum EGPUClass { - GPU_CLASS_UNKNOWN = -1, - GPU_CLASS_0 = 0, - GPU_CLASS_1 = 1, - GPU_CLASS_2 = 2, - GPU_CLASS_3 = 3, - GPU_CLASS_4 = 4, - GPU_CLASS_5 = 5 -} EGPUClass; + GPU_CLASS_UNKNOWN = -1, + GPU_CLASS_0 = 0, + GPU_CLASS_1 = 1, + GPU_CLASS_2 = 2, + GPU_CLASS_3 = 3, + GPU_CLASS_4 = 4, + GPU_CLASS_5 = 5 +} EGPUClass; class LLFeatureInfo { public: - LLFeatureInfo() : mValid(FALSE), mAvailable(FALSE), mRecommendedLevel(-1) {} - LLFeatureInfo(const std::string& name, const BOOL available, const F32 level); + LLFeatureInfo() : mValid(FALSE), mAvailable(FALSE), mRecommendedLevel(-1) {} + LLFeatureInfo(const std::string& name, const BOOL available, const F32 level); - BOOL isValid() const { return mValid; }; + BOOL isValid() const { return mValid; }; public: - BOOL mValid; - std::string mName; - BOOL mAvailable; - F32 mRecommendedLevel; + BOOL mValid; + std::string mName; + BOOL mAvailable; + F32 mRecommendedLevel; }; class LLFeatureList { public: - typedef std::map<std::string, LLFeatureInfo> feature_map_t; + typedef std::map<std::string, LLFeatureInfo> feature_map_t; - LLFeatureList(const std::string& name); - virtual ~LLFeatureList(); + LLFeatureList(const std::string& name); + virtual ~LLFeatureList(); - BOOL isFeatureAvailable(const std::string& name); - F32 getRecommendedValue(const std::string& name); + BOOL isFeatureAvailable(const std::string& name); + F32 getRecommendedValue(const std::string& name); - void setFeatureAvailable(const std::string& name, const BOOL available); - void setRecommendedLevel(const std::string& name, const F32 level); + void setFeatureAvailable(const std::string& name, const BOOL available); + void setRecommendedLevel(const std::string& name, const F32 level); - bool loadFeatureList(LLFILE *fp); + bool loadFeatureList(LLFILE *fp); - BOOL maskList(LLFeatureList &mask); + BOOL maskList(LLFeatureList &mask); - void addFeature(const std::string& name, const BOOL available, const F32 level); + void addFeature(const std::string& name, const BOOL available, const F32 level); - feature_map_t& getFeatures() - { - return mFeatures; - } + feature_map_t& getFeatures() + { + return mFeatures; + } - void dump(); + void dump(); protected: - std::string mName; - feature_map_t mFeatures; + std::string mName; + feature_map_t mFeatures; }; class LLFeatureManager : public LLFeatureList, public LLSingleton<LLFeatureManager> { - LLSINGLETON(LLFeatureManager); - ~LLFeatureManager() {cleanupFeatureTables();} + LLSINGLETON(LLFeatureManager); + ~LLFeatureManager() {cleanupFeatureTables();} - // initialize this by loading feature table and gpu table - void initSingleton() override; + // initialize this by loading feature table and gpu table + void initSingleton() override; public: - void maskCurrentList(const std::string& name); // Mask the current feature list with the named list + void maskCurrentList(const std::string& name); // Mask the current feature list with the named list + + bool loadFeatureTables(); - bool loadFeatureTables(); + EGPUClass getGPUClass() { return mGPUClass; } + std::string& getGPUString() { return mGPUString; } - EGPUClass getGPUClass() { return mGPUClass; } - std::string& getGPUString() { return mGPUString; } - // get the measured GPU memory bandwidth in GB/sec // may return 0 of benchmark has not been run or failed to run F32 getGPUMemoryBandwidth() { return mGPUMemoryBandwidth; } - BOOL isGPUSupported() { return mGPUSupported; } - F32 getExpectedGLVersion() { return mExpectedGLVersion; } - - void cleanupFeatureTables(); + BOOL isGPUSupported() { return mGPUSupported; } + F32 getExpectedGLVersion() { return mExpectedGLVersion; } + + void cleanupFeatureTables(); - S32 getVersion() const { return mTableVersion; } - void setSafe(const BOOL safe) { mSafe = safe; } - BOOL isSafe() const { return mSafe; } + S32 getVersion() const { return mTableVersion; } + void setSafe(const BOOL safe) { mSafe = safe; } + BOOL isSafe() const { return mSafe; } - LLFeatureList *findMask(const std::string& name); - BOOL maskFeatures(const std::string& name); + LLFeatureList *findMask(const std::string& name); + BOOL maskFeatures(const std::string& name); - // set the graphics to low, medium, high, or ultra. - // skipFeatures forces skipping of mostly hardware settings - // that we don't want to change when we change graphics - // settings - void setGraphicsLevel(U32 level, bool skipFeatures); + // set the graphics to low, medium, high, or ultra. + // skipFeatures forces skipping of mostly hardware settings + // that we don't want to change when we change graphics + // settings + void setGraphicsLevel(U32 level, bool skipFeatures); - // What 'level' values are valid to pass to setGraphicsLevel()? - // 0 is the low end... - U32 getMaxGraphicsLevel() const; - bool isValidGraphicsLevel(U32 level) const; + // What 'level' values are valid to pass to setGraphicsLevel()? + // 0 is the low end... + U32 getMaxGraphicsLevel() const; + bool isValidGraphicsLevel(U32 level) const; - // setGraphicsLevel() levels have names. - std::string getNameForGraphicsLevel(U32 level) const; - // returns -1 for unrecognized name (hence S32 rather than U32) - S32 getGraphicsLevelForName(const std::string& name) const; + // setGraphicsLevel() levels have names. + std::string getNameForGraphicsLevel(U32 level) const; + // returns -1 for unrecognized name (hence S32 rather than U32) + S32 getGraphicsLevelForName(const std::string& name) const; - void applyBaseMasks(); - void applyRecommendedSettings(); + void applyBaseMasks(); + void applyRecommendedSettings(); - // apply the basic masks. Also, skip one saved - // in the skip list if true - void applyFeatures(bool skipFeatures); + // apply the basic masks. Also, skip one saved + // in the skip list if true + void applyFeatures(bool skipFeatures); - LLSD getRecommendedSettingsMap(); + LLSD getRecommendedSettingsMap(); protected: - bool loadGPUClass(); + bool loadGPUClass(); - bool parseFeatureTable(std::string filename); - ///< @returns TRUE is file parsed correctly, FALSE if not + bool parseFeatureTable(std::string filename); + ///< @returns TRUE is file parsed correctly, FALSE if not - void initBaseMask(); + void initBaseMask(); - std::map<std::string, LLFeatureList *> mMaskList; - std::set<std::string> mSkippedFeatures; - BOOL mInited; - S32 mTableVersion; - BOOL mSafe; // Reinitialize everything to the "safe" mask - EGPUClass mGPUClass; + std::map<std::string, LLFeatureList *> mMaskList; + std::set<std::string> mSkippedFeatures; + BOOL mInited; + S32 mTableVersion; + BOOL mSafe; // Reinitialize everything to the "safe" mask + EGPUClass mGPUClass; F32 mGPUMemoryBandwidth = 0.f; // measured memory bandwidth of GPU in GB/second - F32 mExpectedGLVersion; //expected GL version according to gpu table - std::string mGPUString; - BOOL mGPUSupported; + F32 mExpectedGLVersion; //expected GL version according to gpu table + std::string mGPUString; + BOOL mGPUSupported; }; inline LLFeatureManager::LLFeatureManager() -: LLFeatureList("default"), - - mInited(FALSE), - mTableVersion(0), - mSafe(FALSE), - mGPUClass(GPU_CLASS_UNKNOWN), - mExpectedGLVersion(0.f), - mGPUSupported(FALSE) +: LLFeatureList("default"), + + mInited(FALSE), + mTableVersion(0), + mSafe(FALSE), + mGPUClass(GPU_CLASS_UNKNOWN), + mExpectedGLVersion(0.f), + mGPUSupported(FALSE) { } |