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);
83 if (
_group < mGroups.size())
113 if (
_group < mGroups.size())
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()
ImageIndexInfo getIndexInfo(const std::string &_group, const std::string &_index) const
EnumeratorGroupImage getEnumerator() const
void AddGroupImage(const GroupImage &_group)
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)