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

Method load

src/OpenLoco/src/Objects/CurrencyObject.cpp:32–53  ·  view source on GitHub ↗

0x0046DF56

Source from the content-addressed store, hash-verified

30
31 // 0x0046DF56
32 void CurrencyObject::load(const LoadedObjectHandle& handle, std::span<const std::byte> data, ObjectManager::DependentObjects*)
33 {
34 auto remainingData = data.subspan(sizeof(CurrencyObject));
35
36 auto loadString = [&remainingData, &handle](StringId& dst, uint8_t num) {
37 auto strRes = ObjectManager::loadStringTable(remainingData, handle, num);
38 dst = strRes.str;
39 remainingData = remainingData.subspan(strRes.tableLength);
40 };
41
42 // Load object strings
43 loadString(name, 0);
44 loadString(prefixSymbol, 1);
45 loadString(suffixSymbol, 2);
46
47 // Load images
48 auto imageRes = ObjectManager::loadImageTable(remainingData);
49 objectIcon = imageRes.imageOffset;
50
51 // Ensure we've loaded the entire object
52 assert(remainingData.size() == imageRes.tableLength);
53 }
54
55 // 0x0046DF90
56 void CurrencyObject::unload()

Callers

nothing calls this directly

Calls 3

loadStringTableFunction · 0.85
loadImageTableFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected