| 626 | } |
| 627 | |
| 628 | LoadObjectsResult loadAll(std::span<ObjectHeader> objects) |
| 629 | { |
| 630 | LoadObjectsResult result; |
| 631 | result.success = true; |
| 632 | |
| 633 | unloadAll(); |
| 634 | |
| 635 | LoadedObjectIndex index = 0; |
| 636 | for (const auto& header : objects) |
| 637 | { |
| 638 | auto id = getObjectId(index); |
| 639 | if (!header.isEmpty() && !load(header, id)) |
| 640 | { |
| 641 | result.success = false; |
| 642 | result.problemObjects.push_back(header); |
| 643 | Logging::error("Failed to load: {}", header.getName()); |
| 644 | // Could break early here but we want to list all of the failed objects |
| 645 | } |
| 646 | index++; |
| 647 | } |
| 648 | if (result.success == false) |
| 649 | { |
| 650 | unloadAll(); |
| 651 | } |
| 652 | return result; |
| 653 | } |
| 654 | |
| 655 | static bool partialLoad(const ObjectHeader& header, std::span<std::byte> objectData) |
| 656 | { |
no test coverage detected