I don't know what all that code does.
I'll just give a simple example.
There are two methods to have transparent sprites.
1: Use an image editor that supports exporting transparency. I use transparent png's.
2: (Hardly very reasonable but usable) Use sf::Image and two for loops to remove the specified color. Then load that image into the texture. I find this useful for removing a color that image editors can't completely remove correctly.
How to use sf::image for that:
sf::Image image;
image.loadFromFile("image.bmp");
for(int x=0;x<image.getSize().x;x++)
{
for(int y=0;y<image.getSize().y;y++)
{
if(image.getPixel(x,y)==sf::Color::Yellow)
{
image.setPixel(x,y,sf::Color::Transparent);
}
}
}
sf::Texture texture;
texture.loadFromImage(image);
Sprite sprite;
sprite.setTexture(texture);