| 334 | } |
| 335 | |
| 336 | bool 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); |