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

Method load

src/OpenLoco/src/Objects/TrackExtraObject.cpp:52–68  ·  view source on GitHub ↗

0x004A6CF8

Source from the content-addressed store, hash-verified

50
51 // 0x004A6CF8
52 void TrackExtraObject::load(const LoadedObjectHandle& handle, std::span<const std::byte> data, ObjectManager::DependentObjects*)
53 {
54 auto remainingData = data.subspan(sizeof(TrackExtraObject));
55
56 // Load object name string
57 auto strRes = ObjectManager::loadStringTable(remainingData, handle, 0);
58 name = strRes.str;
59 remainingData = remainingData.subspan(strRes.tableLength);
60
61 // Load images
62 auto imageRes = ObjectManager::loadImageTable(remainingData);
63 var_0E = imageRes.imageOffset;
64 image = imageRes.imageOffset + 8;
65
66 // Ensure we've loaded the entire object
67 assert(remainingData.size() == imageRes.tableLength);
68 }
69
70 // 0x004A6D24
71 void TrackExtraObject::unload()

Callers

nothing calls this directly

Calls 3

loadStringTableFunction · 0.85
loadImageTableFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected