* Parse the configuration file. */
| 456 | * Parse the configuration file. |
| 457 | */ |
| 458 | bool ParseConfig( |
| 459 | const char* buffer, |
| 460 | ConfigInfo &config, |
| 461 | LightInfo &lights, |
| 462 | Camera &camera, |
| 463 | std::vector<DDGIVolumeDesc> &descs, |
| 464 | InputInfo &inputInfo, |
| 465 | InputOptions &inputOptions, |
| 466 | RTOptions &rtOptions, |
| 467 | PostProcessOptions &postOptions, |
| 468 | VizOptions &vizOptions, |
| 469 | std::ofstream &log) |
| 470 | { |
| 471 | std::string configString(buffer); |
| 472 | |
| 473 | if (!ParseApplication(configString, config, log)) return false; |
| 474 | if (!ParseLights(configString, lights, log)) return false; |
| 475 | if (!ParseCamera(configString, camera, inputInfo, log)) return false; |
| 476 | if (!ParseVolumes(configString, descs, log)) return false; |
| 477 | if (!ParseInput(configString, inputOptions, log)) return false; |
| 478 | if (!ParseRayTracing(configString, rtOptions, log)) return false; |
| 479 | if (!ParsePostProcess(configString, postOptions, log)) return false; |
| 480 | if (!ParseViz(configString, vizOptions, log)) return false; |
| 481 | |
| 482 | camera.aspect = (float)config.width / (float)config.height; |
| 483 | |
| 484 | return true; |
| 485 | } |
| 486 | |
| 487 | /** |
| 488 | * Load and parse the configuration file. |
no test coverage detected