aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfeaturemanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfeaturemanager.h')
-rw-r--r--linden/indra/newview/llfeaturemanager.h57
1 files changed, 43 insertions, 14 deletions
diff --git a/linden/indra/newview/llfeaturemanager.h b/linden/indra/newview/llfeaturemanager.h
index 1ee62b4..c98fb0d 100644
--- a/linden/indra/newview/llfeaturemanager.h
+++ b/linden/indra/newview/llfeaturemanager.h
@@ -35,14 +35,22 @@
35#include "stdtypes.h" 35#include "stdtypes.h"
36 36
37#include "llstring.h" 37#include "llstring.h"
38#include "llskipmap.h"
39#include <map> 38#include <map>
40 39
40typedef enum EGPUClass
41{
42 GPU_CLASS_UNKNOWN = -1,
43 GPU_CLASS_0 = 0,
44 GPU_CLASS_1 = 1,
45 GPU_CLASS_2 = 2,
46 GPU_CLASS_3 = 3
47} EGPUClass;
48
41class LLFeatureInfo 49class LLFeatureInfo
42{ 50{
43public: 51public:
44 LLFeatureInfo() : mValid(FALSE), mAvailable(FALSE), mRecommendedLevel(-1) {} 52 LLFeatureInfo() : mValid(FALSE), mAvailable(FALSE), mRecommendedLevel(-1) {}
45 LLFeatureInfo(const char *name, const BOOL available, const S32 level); 53 LLFeatureInfo(const char *name, const BOOL available, const F32 level);
46 54
47 BOOL isValid() const { return mValid; }; 55 BOOL isValid() const { return mValid; };
48 56
@@ -50,32 +58,38 @@ public:
50 BOOL mValid; 58 BOOL mValid;
51 LLString mName; 59 LLString mName;
52 BOOL mAvailable; 60 BOOL mAvailable;
53 S32 mRecommendedLevel; 61 F32 mRecommendedLevel;
54}; 62};
55 63
56 64
57class LLFeatureList 65class LLFeatureList
58{ 66{
59public: 67public:
68 typedef std::map<LLString, LLFeatureInfo> feature_map_t;
69
60 LLFeatureList(const char *name = "default"); 70 LLFeatureList(const char *name = "default");
61 virtual ~LLFeatureList(); 71 virtual ~LLFeatureList();
62 72
63 BOOL isFeatureAvailable(const char *name); 73 BOOL isFeatureAvailable(const char *name);
64 S32 getRecommendedLevel(const char *name); 74 F32 getRecommendedValue(const char *name);
65 75
66 void setFeatureAvailable(const char *name, const BOOL available); 76 void setFeatureAvailable(const char *name, const BOOL available);
67 void setRecommendedLevel(const char *name, const S32 level); 77 void setRecommendedLevel(const char *name, const F32 level);
68 78
69 BOOL loadFeatureList(FILE *fp); 79 BOOL loadFeatureList(FILE *fp);
70 80
71 BOOL maskList(LLFeatureList &mask); 81 BOOL maskList(LLFeatureList &mask);
72 82
73 void addFeature(const char *name, const BOOL available, const S32 level); 83 void addFeature(const char *name, const BOOL available, const F32 level);
84
85 feature_map_t& getFeatures()
86 {
87 return mFeatures;
88 }
74 89
75 void dump(); 90 void dump();
76protected: 91protected:
77 LLString mName; 92 LLString mName;
78 typedef std::map<LLString, LLFeatureInfo> feature_map_t;
79 feature_map_t mFeatures; 93 feature_map_t mFeatures;
80}; 94};
81 95
@@ -83,14 +97,19 @@ protected:
83class LLFeatureManager : public LLFeatureList 97class LLFeatureManager : public LLFeatureList
84{ 98{
85public: 99public:
86 LLFeatureManager() : mInited(FALSE), mTableVersion(0), mSafe(FALSE), mGPUClass(0) {} 100 LLFeatureManager() : mInited(FALSE), mTableVersion(0), mSafe(FALSE), mGPUClass(GPU_CLASS_UNKNOWN) {}
101 ~LLFeatureManager() {cleanupFeatureTables();}
102
103 // initialize this by loading feature table and gpu table
104 void init();
87 105
88 void maskCurrentList(const char *name); // Mask the current feature list with the named list 106 void maskCurrentList(const char *name); // Mask the current feature list with the named list
89 107
90 BOOL loadFeatureTables(); 108 BOOL loadFeatureTables();
91 109
92 S32 getGPUClass() { return mGPUClass; } 110 EGPUClass getGPUClass() { return mGPUClass; }
93 std::string& getGPUString() { return mGPUString; } 111 std::string& getGPUString() { return mGPUString; }
112 BOOL isGPUSupported() { return mGPUSupported; }
94 113
95 void cleanupFeatureTables(); 114 void cleanupFeatureTables();
96 115
@@ -101,22 +120,32 @@ public:
101 LLFeatureList *findMask(const char *name); 120 LLFeatureList *findMask(const char *name);
102 BOOL maskFeatures(const char *name); 121 BOOL maskFeatures(const char *name);
103 122
104 123 // set the graphics to low, medium, high, or ultra.
105 void initCPUFeatureMasks(); 124 // skipFeatures forces skipping of mostly hardware settings
106 void initGraphicsFeatureMasks(); 125 // that we don't want to change when we change graphics
126 // settings
127 void setGraphicsLevel(S32 level, bool skipFeatures);
107 128
108 void applyRecommendedFeatures(); 129 void applyBaseMasks();
130 void applyRecommendedSettings();
131
132 // apply the basic masks. Also, skip one saved
133 // in the skip list if true
134 void applyFeatures(bool skipFeatures);
109 135
110protected: 136protected:
111 void loadGPUClass(); 137 void loadGPUClass();
112 void initBaseMask(); 138 void initBaseMask();
113 139
140
114 std::map<LLString, LLFeatureList *> mMaskList; 141 std::map<LLString, LLFeatureList *> mMaskList;
142 std::set<LLString> mSkippedFeatures;
115 BOOL mInited; 143 BOOL mInited;
116 S32 mTableVersion; 144 S32 mTableVersion;
117 BOOL mSafe; // Reinitialize everything to the "safe" mask 145 BOOL mSafe; // Reinitialize everything to the "safe" mask
118 S32 mGPUClass; 146 EGPUClass mGPUClass;
119 std::string mGPUString; 147 std::string mGPUString;
148 BOOL mGPUSupported;
120}; 149};
121 150
122extern LLFeatureManager *gFeatureManagerp; 151extern LLFeatureManager *gFeatureManagerp;