MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / loadAll

Function loadAll

src/OpenLoco/src/Objects/ObjectManager.cpp:628–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

importSaveToGameStateFunction · 0.85

Calls 7

unloadAllFunction · 0.85
getObjectIdFunction · 0.85
errorFunction · 0.85
push_backMethod · 0.80
getNameMethod · 0.80
loadFunction · 0.70
isEmptyMethod · 0.45

Tested by

no test coverage detected