std::vector<Frame> developFrame(XMLElement* xml) { Frame tmpf; std::vector<Frame> tmp; // this is the xml elements first child. It will only be the <frame> tag auto framexml = xml->FirstChildElement(); while (framexml) { // this will always be frame. but if it isn't we don't wanna crash the game std::string defframe = framexml->Name(); if (defframe == "frame") { tmpf.clear(); // the xml element to parse each src of the frames auto sxml = framexml->FirstChildElement(); while (sxml) { std::string sname = sxml->Name(); if (sname == "src") { tmpf.push_back(std::make_pair(SpriteData(sxml->GetText(), vec2(0,0)), vec2(0,0))); } sxml = sxml->NextSiblingElement(); } tmp.push_back(tmpf); } // if it's not a frame we don't care // parse next frame framexml = framexml->NextSiblingElement(); } return tmp; }
void DirectXEngine::Render(Position p_position, Position p_textureOffset, Texture2DInterface* p_texture, SpriteEffect p_spriteEffect, float p_width, float p_height, float p_depth) { m_renderData.push_back(SpriteData(p_position, p_textureOffset, (Texture2D*)p_texture, p_spriteEffect, p_width, p_height, p_depth)); }
void DirectXEngine::Render(Position p_position, Position p_origin, Position p_textureOffset, Texture2DInterface* p_texture, SpriteEffect p_spriteEffect, float p_width, float p_height, float p_depth, float p_rotation, bool p_hasTransparent, Position p_textureDelta) { m_renderData.push_back(SpriteData(p_position, p_origin, p_textureOffset, (Texture2D*)p_texture, p_spriteEffect, p_width, p_height, p_depth, p_rotation, p_hasTransparent, p_textureDelta)); }
void SpriteCache::initFile_initNullSpriteParams(sprkey_t index) { // no sprite ... blank it out _sprInfos[index] = SpriteInfo(); _spriteData[index] = SpriteData(); }
void SpriteInfoImpl::SetData(const SpriteData& p_spriteData) { m_datainfo = SpriteData(p_spriteData); }
void SpriteConfig::insert(SpriteType st, int x, int y, int w, int h, int fc, int fd, bool l) { m_configs[st] = SpriteData(x, y, w, h, fc, fd, l); }