Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::map<string,Texture> AssetManager::textures;
- sf::Texture AssetManager::manageTextureElement(World& object, string path)
- {
- for (auto it = textures.begin(); it != textures.end(); it++)
- {
- if (it->first == path)
- {
- cout << "Copyed" << endl;
- return it->second;
- }
- }
- textures.insert(std::pair<string, Texture>(path, Texture()));
- auto it = textures.end();
- it->second.loadFromFile(path);
- textures.end() = it;
- cout << "Added" << endl;
- return it->second;
- }
Add Comment
Please, Sign In to add comment