Okay, this is more a question than a problem.
This one:
sf::Texture & ResourceManager::GetTexture(std::string name) {
return *textures.find(name)->second;
};
returns a reference to an object, but this one:
sf::Texture ResourceManager::GetTexture(std::string name) {
return *textures.find(name)->second;
};
as far as I understand, it returns copy of an object (correct me if I'm wrong).
So, we have a copy of an object that contains a texture. That is good, let him keep this copy. But when I pass this copy as a parameter:
player=(Player*)layers->GetLayer("lyrDynamicOverlay")->CreateObject(2000+100,300-40,indPlayer,ResMan->GetTexture("Texture"));
it loads nothing. Just like there was no texture at all.
So, what happened?