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.


Topics - billarhos

Pages: [1]
1
General / sfeMovie + SFML 2.5.1
« on: February 25, 2019, 07:31:29 pm »
Hi, i 'm posting here because there is no more an active forum for sfemovie library.

Has anyone a working sfemovie lib with 2.5.1 version of SFML?

I built it from source but video (ogv) can not be played. Working just fine with 2.4.2 version of SFML.

thank you

2
Hi

i try to figure out how to rotate a square texture (512x512) around a center of a given rectangle (not square).
here is a my code.

void cSprite::render(sf::FloatRect _dstRect, float _angle, sf::Color color)
{
        if (visible)
        {
                float angle =  _angle / 180.f * (float)M_PI;
                float cos = cosf(angle);
                float sin = sinf(angle);
               
                sf::Sprite              sprite;
                sprite.setTexture(*texture);

                float x = _dstRect.width / size.x;
                float y = _dstRect.height / size.y;
               
                sf::FloatRect rect = sprite.getGlobalBounds();
               
                sprite.setPosition(sf::Vector2f(_dstRect.left + _dstRect.width / 2, _dstRect.top + _dstRect.height / 2));
                sprite.setOrigin(sf::Vector2f(rect.width / 2, rect.height / 2));
                sprite.setRotation(_angle);

                sprite.setScale(sf::Vector2f(x, y));

                GAME_MANAGER->getWindow()->draw(sprite);
        }
}
 

i am trying to make a roulette.
the problem is shown in the attached image
thank you for any suggestions

http://www.mediafire.com/file/bg66i027erqv1na/test%282%29.jpg

3
Graphics / Potential bug
« on: October 11, 2017, 09:14:09 pm »
Hi, i am facing a strange issue with timelinefx library. Everything is working just fine in debug until i compiled for release. All effects i used are renderred correct in debug but stretched in release. It may has to do with alpha channel.

I am using the latest sfml version with visual studio 2015.

The guy who port the c++ sfml port for timelinefx library (fradakilla) gave me a solution that is working for release and debug. But the previous code should worked out of the box.

I have create a repro project for everyone who is interested to invastigate this issue.

To work with the fixed code (that is working for both debug and release) uncomment #define FIXED_BY_FRADAKILA

http://www.mediafire.com/file/5v4mx4dgwwgw8k2/TimeLineFx.rar

//working correct both in debug  and release
bool SfmlImage::Load(const char *filename)
{
        _texture = new sf::Texture();

        std::string path = filename;

        sf::Image tmpImage;
        tmpImage.loadFromFile(path.c_str());
        tmpImage.createMaskFromColor(sf::Color::White);

        _texture->loadFromImage(tmpImage);
        _texture->setSmooth(true);

        return true;
}

//working correct only in debug
bool SfmlImage::Load( const char *filename )
{
    _texture = new sf::Texture();

    std::string path = filename;
        assert(_texture->loadFromFile(path.c_str()));

    _texture->setSmooth(true);

    return true;
}
 

thanks in advance


Pages: [1]