0x00442403
| 778 | |
| 779 | // 0x00442403 |
| 780 | std::unique_ptr<SaveDetails> readSaveDetails(const fs::path& path) |
| 781 | { |
| 782 | FileStream stream(path, StreamMode::read); |
| 783 | SawyerStreamReader fs(stream); |
| 784 | if (!fs.validateChecksum()) |
| 785 | { |
| 786 | return nullptr; |
| 787 | } |
| 788 | |
| 789 | Header s5Header{}; |
| 790 | |
| 791 | // Read header |
| 792 | fs.readChunk(&s5Header, sizeof(s5Header)); |
| 793 | |
| 794 | if (s5Header.version != kCurrentVersion) |
| 795 | { |
| 796 | return nullptr; |
| 797 | } |
| 798 | |
| 799 | if (s5Header.hasFlags(HeaderFlags::isTitleSequence | HeaderFlags::isDump | HeaderFlags::isRaw)) |
| 800 | { |
| 801 | return nullptr; |
| 802 | } |
| 803 | |
| 804 | if (s5Header.hasFlags(HeaderFlags::hasSaveDetails)) |
| 805 | { |
| 806 | // 0x0050AEA8 |
| 807 | auto ret = std::make_unique<SaveDetails>(); |
| 808 | fs.readChunk(ret.get(), sizeof(*ret)); |
| 809 | return ret; |
| 810 | } |
| 811 | return nullptr; |
| 812 | } |
| 813 | |
| 814 | // 0x00442AFC |
| 815 | std::unique_ptr<Scenario::Options> readScenarioOptions(const fs::path& path) |
no test coverage detected