16 std::vector<IntPoint> ResourceImageSet::mFramesEmpty;
18 void ResourceImageSet::deserialization(
xml::ElementPtr _node, Version _version)
20 Base::deserialization(_node, _version);
23 xml::ElementEnumerator group_node = _node->getElementEnumerator();
24 while (group_node.next(
"Group"))
27 group.name = group_node->findAttribute(
"name");
29 group.texture = group_node->findAttribute(
"texture");
31 if (_version >= Version(1, 1))
38 xml::ElementEnumerator index_node = group_node->getElementEnumerator();
39 while (index_node.next(
"Index"))
42 index.name = index_node->findAttribute(
"name");
45 xml::ElementEnumerator frame_node = index_node->getElementEnumerator();
46 while (frame_node.next(
"Frame"))
50 if ((count < 1) || (count > 256)) count = 1;
53 index.frames.push_back(point);
58 group.indexes.push_back(index);
67 size_t index_group = getGroupIndex(_group);
70 const GroupImage& group = mGroups[index_group];
71 size_t index_image = getImageIndex(group, _index);
83 if (_group < mGroups.size())
86 size_t index_image = getImageIndex(group, _index);
98 size_t index_group = getGroupIndex(_group);
101 const GroupImage& group = mGroups[index_group];
102 if (_index < group.
indexes.size())
113 if (_group < mGroups.size())
116 if (_index < group.
indexes.size())
127 size_t index_group = getGroupIndex(_group);
130 const GroupImage& group = mGroups[index_group];
131 if (_index < group.
indexes.size())
142 size_t index_group = getGroupIndex(_group);
145 const GroupImage& group = mGroups[index_group];
146 size_t index_image = getImageIndex(group, _index);
156 size_t ResourceImageSet::getGroupIndex(
const std::string& _name)
const
158 for (
size_t index = 0; index < mGroups.size(); ++index)
160 if (mGroups[index].name == _name)
166 size_t ResourceImageSet::getGroupIndex(
const IntSize& _size)
const
168 for (
size_t index = 0; index < mGroups.size(); ++index)
170 if (mGroups[index].size == _size)
176 size_t ResourceImageSet::getImageIndex(
const GroupImage& _group,
const std::string& _name)
const
179 for (
size_t index = 0; index < indices.size(); ++index)
181 if (indices[index].name == _name)
194 mGroups.push_back(_group);
static const std::string & getEmptyString()
static const IntSize & getZeroIntSize()
static LanguageManager & getInstance()
UString replaceTags(const UString &_line)
ImageIndexInfo getIndexInfo(const std::string &_group, const std::string &_index) const
EnumeratorGroupImage getEnumerator() const
void AddGroupImage(const GroupImage &_group)
size_type size() const
Returns the number of code points in the current string.
size_t parseSizeT(const std::string &_value)
float parseFloat(const std::string &_value)
std::vector< IndexImage > VectorIndexImage
Enumerator< VectorGroupImage > EnumeratorGroupImage
types::TSize< int > IntSize
types::TPoint< int > IntPoint
std::vector< IntPoint > frames
static TPoint< int > parse(const std::string &_value)
static TSize< int > parse(const std::string &_value)