void SpriteManager::loadSpriteManager(const std::string & name, SpritesLoader & sp) { this->_name = name; this->_sp = sp.getSpriteByName(name); for (std::map<std::string, Animation* >::const_iterator it = this->_sp->getAnimations().begin();it != this->_sp->getAnimations().end();++it) { if (this->_defaultAnim.empty()) this->_defaultAnim = it->first; this->_framesPos[it->first] = 0; this->_loopEnd[it->first] = false; } }
SpriteManager::SpriteManager(const std::string & name, SpritesLoader & sp) : _name(name), _sp(sp.getSpriteByName(name)), _posWindowX(0), _posWindowY(0), _scaleX(1.0), _scaleY(1.0), _isAnimEnd(false) { for (std::map<std::string, Animation* >::const_iterator it = this->_sp->getAnimations().begin();it != this->_sp->getAnimations().end();++it) { if (this->_defaultAnim.empty()) this->_defaultAnim = it->first; this->_framesPos[it->first] = 0; this->_loopEnd[it->first] = false; } this->_color.push_back(255); this->_color.push_back(255); this->_color.push_back(255); this->_color.push_back(255); }