Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GPU build] calcFrame() wrong order #232

Open
DigiEggz opened this issue Jun 3, 2016 · 2 comments
Open

[GPU build] calcFrame() wrong order #232

DigiEggz opened this issue Jun 3, 2016 · 2 comments

Comments

@DigiEggz
Copy link

DigiEggz commented Jun 3, 2016

In calcFrame(), the isBlitting() check sets the flashRect dimensions to zero in the incorrect order:

if (FlxG.render.isBlitting())
            {
                calcFramePixels();
                _flashRect.x = _flashRect.y = 0;
            }

In the blitting render this causes some alpha effects to not work correctly depending on a few factors. This can be resolved by moving the flashRect assignment to within the calcFramePixels() function.

protected function calcFramePixels():void
        {
            framePixels.copyPixels(_pixels, _flashRect, _flashPointZero);
            _flashRect.x = _flashRect.y = 0;//Reset rectangle before setting colorTransform

            if (_colorTransform != null)
            {
                framePixels.colorTransform(_flashRect, _colorTransform);
            }
        }
@Dovyski
Copy link
Member

Dovyski commented Jun 8, 2016

Have you tried to run this same fix with the GPU render as well? I remember I had some problems making _flashRect to work properly with both blitting and GPU render.

@DigiEggz
Copy link
Author

DigiEggz commented Jun 8, 2016

I've run this fix with the GPU render as well and luckily no problems have arose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants