Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - netdragon

Pages: [1]
1
Graphics / Grey box displaying around sprite's loaded image.
« on: April 01, 2011, 01:26:58 am »
I'm a teammate of the OP and have new information. I just found a solution of calling SetSmooth(false) but not sure why that prevented the artifact. It'd be great if we still had the option of smoothing. Any ideas?

Code: [Select]

void ViewBase::drawImage(sf::RenderWindow & target, const std::string & filename, const Point & origin)
{
    sf::Image sfi;
    sfi.SetSmooth(false);
    sf::Sprite sprite;
    if (!sfi.LoadFromFile(filename))
    {
        Log::debug("Failed to load file");
        return;
    }
    sprite.SetImage(sfi);
    sprite.SetPosition(origin.x,origin.y);
    target.Draw(sprite);
}


The image in question (as on disk, without the artifact created when displayed in SFML):

Pages: [1]
anything