MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / loadImagePack

Method loadImagePack

game/state/gamestate_serialize.cpp:611–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609}
610
611bool BattleUnitImagePack::loadImagePack(GameState &state, const UString &path)
612{
613
614 auto file = fw().data->fs.open(path);
615 if (!file)
616 {
617 LogError("Failed to open image pack \"%s\"", path);
618 return false;
619 }
620 auto fullPath = file.systemPath();
621
622 auto archive = SerializationArchive::readArchive(fullPath);
623 if (!archive)
624 {
625 LogError("Failed to read \"%s\"", fullPath);
626 return false;
627 }
628
629 return deserialize(*this, state, archive.get());
630}
631
632static bool serialize(const BattleUnitAnimationPack &animationPack, SerializationArchive *archive)
633{

Callers 1

loadImagePacksMethod · 0.80

Calls 3

deserializeFunction · 0.85
openMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected