MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetSize

Method GetSize

src/openrct2/object/Object.cpp:326–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324 }
325
326 uint64_t ObjectAsset::GetSize() const
327 {
328 if (_zipPath.empty())
329 {
330 return File::GetSize(_path);
331 }
332
333 auto zipArchive = Zip::TryOpen(_zipPath, ZipAccess::read);
334 if (zipArchive != nullptr)
335 {
336 auto index = zipArchive->GetIndexFromPath(_path);
337 if (index.has_value())
338 {
339 auto size = zipArchive->GetFileSize(index.value());
340 return size;
341 }
342 }
343 return 0;
344 }
345
346 std::vector<uint8_t> ObjectAsset::GetData() const
347 {

Callers 1

LoadMethod · 0.45

Calls 6

GetSizeFunction · 0.85
GetIndexFromPathMethod · 0.80
valueMethod · 0.80
TryOpenFunction · 0.50
emptyMethod · 0.45
GetFileSizeMethod · 0.45

Tested by

no test coverage detected