Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / tools / client / client_config / database.h
blobb02fc0dedfce28707ed77059f04e569a1043ec16
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef NL_DATABASE_H
20 #define NL_DATABASE_H
22 // ***************************************************************************
23 // Bitmaps
24 // ***************************************************************************
26 enum
28 BitmapDisplay = 0,
29 BitmapDisplayDetails,
30 BitmapDisplayAdvanced,
31 BitmapCard,
32 BitmapGeneral,
33 BitmapNetwork,
34 BitmapSound,
35 BitmapUpdate,
36 BitmapTopRight,
37 BitmapWelcome,
38 BitmapCount,
41 // ***************************************************************************
43 struct CBitmapId
45 public:
46 uint ResId;
49 // ***************************************************************************
51 extern const CBitmapId BitmapId[BitmapCount];
53 // ***************************************************************************
54 // Pages
55 // ***************************************************************************
57 enum
59 PageGeneral=0,
60 PageDisplay,
61 PageDisplayDetails,
62 PageDisplayAdvanced,
63 PageSound,
64 PageDisplaySysInfo,
65 PageDisplayOpenGLInfo,
66 PageDisplayOpenD3DInfo,
67 PageCount
70 // ***************************************************************************
72 /**
73 * Data page
75 * \author Cyril 'Hulud' Corvazier
76 * \author Nevrax France
77 * \date 2003
79 class CPage
81 public:
83 /// Constructor
84 CPage ();
85 void init (uint id, const char *name, bool bold, uint icon, uint resid, CPage *parent);
86 void select ();
88 bool Bold;
89 uint ChildId;
90 uint ResId;
92 uint PageId;
93 std::string Name;
94 uint Icon;
95 CPage *Parent;
96 std::vector<CPage*> Children;
99 // ***************************************************************************
101 extern CPage Pages[PageCount];
103 // ***************************************************************************
105 extern CPage Root;
107 // ***************************************************************************
109 void CreateDataBase ();
111 // ***************************************************************************
112 // Config File default
113 // ***************************************************************************
115 void LoadConfigFileDefault ();
117 extern NLMISC::CConfigFile ConfigFileDefault;
119 // ***************************************************************************
120 // Merge method
121 // ***************************************************************************
123 enum TMergeMethod
125 PreferInferior = 0, // Default
126 PreferSuperior,
127 PreferTrue,
128 PreferFalse,
131 TMergeMethod GetMergeMethod (const char *varName);
133 // ***************************************************************************
134 // Quality
135 // ***************************************************************************
137 #define QUALITY_STEP 4
138 #define QUALITY_TEXTURE_STEP 3
140 extern const float QualityToLandscapeThreshold[QUALITY_STEP];
141 extern const float QualityToZFar[QUALITY_STEP];
142 extern const float QualityToLandscapeTileNear[QUALITY_STEP];
143 extern const int QualityToSkinNbMaxPoly[QUALITY_STEP];
144 extern const int QualityToNbMaxSkeletonNotCLod[QUALITY_STEP];
145 extern const int QualityToFxNbMaxPoly[QUALITY_STEP];
147 // ***************************************************************************
149 template<class T>
150 int GetQuality (const T *table, T value)
152 if (table[0] < table[QUALITY_STEP-1])
154 uint i=0;
155 while ((i<QUALITY_STEP) && (table[i]<value))
156 i++;
157 return i;
159 else
161 uint i=0;
162 while ((i<QUALITY_STEP) && (table[i]>value))
163 i++;
164 return i;
168 // ***************************************************************************
170 #endif // NL_DATABASE_H
172 /* End of database.h */