| 609 | } |
| 610 | |
| 611 | bool 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 | |
| 632 | static bool serialize(const BattleUnitAnimationPack &animationPack, SerializationArchive *archive) |
| 633 | { |
no test coverage detected