51 Common::UString &textureFile,
float &x,
float &y,
float &w,
float &h)
const {
52 std::map<Common::UString, AtlasTexture>::const_iterator iter =
_atlasTextures.find(texture);
70 if(node.
getName() !=
"AtlasData")
74 for (Common::XMLNode::Children::const_iterator a = atlasTextures.begin(); a != atlasTextures.end(); ++a) {
75 if ((*a)->getName() !=
"AtlasTexture")
76 throw Common::Exception(
"Invalid tag, <AtlasTexture> expected, <%s> found", (*a)->getName().c_str());
81 for (Common::XMLNode::Children::const_iterator s = sourceTextures.begin();
82 s != sourceTextures.end(); ++s) {
83 if ((*s)->getName() !=
"SourceTexture")
84 throw Common::Exception(
"Invalid tag, <SourceTexture> expected, <%s> found", (*s)->getName().c_str());
87 const Common::UString offsetAndScale = (*s)->getProperty(
"OffsetAndScale");
88 const Common::UString offsetAndScaleV2 = (*s)->getProperty(
"OffsetAndScale_V2");
90 assert(offsetAndScale == offsetAndScaleV2);
92 std::vector<Common::UString> values;
94 if (values.size() != 4)
A loader class for texture atlas XML files for Dragon Age: Origins and Dragon Age 2...
#define ResMan
Shortcut for accessing the sound manager.
std::map< Common::UString, AtlasTexture > _atlasTextures
void getAtlasTexture(const Common::UString &texture, Common::UString &textureFile, float &x, float &y, float &w, float &h) const
A class holding an UTF-8 string.
Common::UString textureFile
Class to parse a ReadStream into a simple XML tree.
const UString & getName() const
const Children & getChildren() const
Return a list of children.
iterator findFirst(uint32 c) const
Utility templates and functions for working with strings and streams.
Exception that provides a stack of explanations.
Extensible Markup Language.
const char * c_str() const
Return the (utf8 encoded) string data.
XML parsing helpers, using libxml2.
Basic reading stream interfaces.
bool isAtlasTexture(const Common::UString &texture) const
TextureAtlasFile(Common::SeekableReadStream &stream)
Parse tokens out of a stream.
const XMLNode & getRoot() const
Return the XML root node.
void erase(iterator from, iterator to)
Erase the character within this range.
void load(Common::SeekableReadStream &stream)
void split(iterator splitPoint, UString &left, UString &right, bool remove=false) const
Interface for a seekable & readable data stream.
void parseString(const UString &str, T &value, bool allowEmpty)
Parse a string into any POD integer, float/double or bool type.
The global resource manager for Aurora resources.