| 14 | { |
| 15 | |
| 16 | void ResourceImageSet::deserialization(xml::ElementPtr _node, Version _version) |
| 17 | { |
| 18 | Base::deserialization(_node, _version); |
| 19 | |
| 20 | // берем детей и крутимся, основной цикл |
| 21 | xml::ElementEnumerator group_node = _node->getElementEnumerator(); |
| 22 | while (group_node.next("Group")) |
| 23 | { |
| 24 | GroupImage group; |
| 25 | group.name = group_node->findAttribute("name"); |
| 26 | |
| 27 | group.texture = group_node->findAttribute("texture"); |
| 28 | // tags replacement support for Skins |
| 29 | if (_version >= Version(1, 1)) |
| 30 | { |
| 31 | group.texture = LanguageManager::getInstance().replaceTags(group.texture); |
| 32 | } |
| 33 | |
| 34 | group.size = IntSize::parse(group_node->findAttribute("size")); |
| 35 | |
| 36 | xml::ElementEnumerator index_node = group_node->getElementEnumerator(); |
| 37 | while (index_node.next("Index")) |
| 38 | { |
| 39 | IndexImage index; |
| 40 | index.name = index_node->findAttribute("name"); |
| 41 | index.rate = utility::parseFloat(index_node->findAttribute("rate")); |
| 42 | |
| 43 | xml::ElementEnumerator frame_node = index_node->getElementEnumerator(); |
| 44 | while (frame_node.next("Frame")) |
| 45 | { |
| 46 | size_t count = utility::parseSizeT(frame_node->findAttribute("count")); |
| 47 | const IntPoint& point = IntPoint::parse(frame_node->findAttribute("point")); |
| 48 | if ((count < 1) || (count > 256)) |
| 49 | count = 1; |
| 50 | while (count > 0) |
| 51 | { |
| 52 | index.frames.push_back(point); |
| 53 | --count; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | group.indexes.push_back(index); |
| 58 | } |
| 59 | |
| 60 | AddGroupImage(group); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | ImageIndexInfo ResourceImageSet::getIndexInfo(std::string_view _group, std::string_view _index) const |
| 65 | { |
nothing calls this directly
no test coverage detected