MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / LoadCl2ListOrSheet

Function LoadCl2ListOrSheet

Source/engine/load_cl2.cpp:19–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17namespace devilution {
18
19OwnedClxSpriteListOrSheet LoadCl2ListOrSheet(const char *pszName, PointerOrValue<uint16_t> widthOrWidths)
20{
21 char path[MaxMpqPathSize];
22 *BufCopy(path, pszName, DEVILUTIONX_CL2_EXT) = '\0';
23#ifdef UNPACKED_MPQS
24 return LoadClxListOrSheet(path);
25#else
26 size_t size;
27 std::unique_ptr<uint8_t[]> data = LoadFileInMem<uint8_t>(path, &size);
28 return Cl2ToClx(std::move(data), size, widthOrWidths);
29#endif
30}
31
32} // namespace devilution

Callers 2

LoadCl2Function · 0.85
LoadCl2SheetFunction · 0.85

Calls 3

LoadClxListOrSheetFunction · 0.85
BufCopyFunction · 0.50
Cl2ToClxFunction · 0.50

Tested by

no test coverage detected