MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / updateConfigFile

Function updateConfigFile

src/clientbase/clientConfig.cpp:148–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void updateConfigFile(void) {
149 int configVersion = BZ_CONFIG_FILE_VERSION;
150 if (BZDB.isSet("config_vers")) {
151 configVersion = BZDB.evalInt("config_vers");
152 }
153
154 switch (configVersion) {
155 case 0: // 2.1.0
156 case 1:// 2.1.6
157 BZDB.unset("maxTextureSize");
158 break;
159
160 case 2: // 2.1.13
161 BZDB.set("stencilShadows", "1");
162 break;
163
164 case 3: // 2.99.1 current
165 break;
166
167 default: // hm, we don't know about this one...
168 printError(TextUtils::format("Config file is tagged version \"%d\", "
169 "which was not expected (too new perhaps). "
170 "Trying to load anyhow.", configVersion));
171 break;
172 }
173
174 // set us as the updated version
175 configVersion = BZ_CONFIG_FILE_VERSION;
176 BZDB.setInt("config_vers", configVersion);
177 BZDB.unset("config_version");// pull the old version, we are updated
178}
179
180// Local Variables: ***
181// mode: C++ ***

Callers 2

setupConfigsFunction · 0.85
setupConfigsFunction · 0.85

Calls 7

isSetMethod · 0.80
evalIntMethod · 0.80
unsetMethod · 0.80
setIntMethod · 0.80
printErrorFunction · 0.50
formatFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected