0x00442AFC
| 813 | |
| 814 | // 0x00442AFC |
| 815 | std::unique_ptr<Scenario::Options> readScenarioOptions(const fs::path& path) |
| 816 | { |
| 817 | FileStream stream(path, StreamMode::read); |
| 818 | SawyerStreamReader fs(stream); |
| 819 | if (!fs.validateChecksum()) |
| 820 | { |
| 821 | return nullptr; |
| 822 | } |
| 823 | |
| 824 | Header s5Header{}; |
| 825 | |
| 826 | // Read header |
| 827 | fs.readChunk(&s5Header, sizeof(s5Header)); |
| 828 | |
| 829 | if (s5Header.version != kCurrentVersion) |
| 830 | { |
| 831 | return nullptr; |
| 832 | } |
| 833 | |
| 834 | if (s5Header.type == S5Type::scenario) |
| 835 | { |
| 836 | // 0x009DA285 = 1 |
| 837 | // 0x009CCA54 _previewOptions |
| 838 | |
| 839 | auto s5Options = std::make_unique<S5::Options>(); |
| 840 | fs.readChunk(s5Options.get(), sizeof(S5::Options)); |
| 841 | return std::make_unique<Scenario::Options>(importOptions(*s5Options)); |
| 842 | } |
| 843 | return nullptr; |
| 844 | } |
| 845 | } |
no test coverage detected