MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / loadGlobalConfigSeatColors

Method loadGlobalConfigSeatColors

source/utils/ConfigManager.cpp:336–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336bool ConfigManager::loadGlobalConfigSeatColors(std::stringstream& configFile)
337{
338 std::string nextParam;
339 while(configFile.good())
340 {
341 if(!(configFile >> nextParam))
342 break;
343
344 if(nextParam == "[/SeatColors]")
345 break;
346
347 if(nextParam != "[SeatColor]")
348 {
349 OD_LOG_ERR("Wrong parameter read nextParam=" + nextParam);
350 return false;
351 }
352
353 uint32_t paramsOk = 0;
354 std::string id;
355 Ogre::ColourValue colourValue;
356 while(configFile.good())
357 {
358 if(!(configFile >> nextParam))
359 break;
360
361 if(nextParam == "[/SeatColor]")
362 {
363 break;
364 }
365
366 if(nextParam == "ID")
367 {
368 configFile >> id;
369 paramsOk |= 0x01;
370 continue;
371 }
372
373 if(nextParam == "ColorR")
374 {
375 configFile >> nextParam;
376 double v = Helper::toDouble(nextParam);
377 if(v < 0.0 || v > 1.0)
378 {
379 OD_LOG_ERR("Wrong parameter read nextParam=" + nextParam);
380 return false;
381 }
382 colourValue.r = v;
383 paramsOk |= 0x02;
384 continue;
385 }
386
387 if(nextParam == "ColorG")
388 {
389 configFile >> nextParam;
390 double v = Helper::toDouble(nextParam);
391 if(v < 0.0 || v > 1.0)
392 {
393 OD_LOG_ERR("Wrong parameter read nextParam=" + nextParam);

Callers

nothing calls this directly

Calls 2

toDoubleFunction · 0.85
toStringFunction · 0.70

Tested by

no test coverage detected