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

Support for blend modes with drawQuads, closes #2196 #2199

Merged
merged 10 commits into from
Dec 7, 2018

Conversation

JoeCreates
Copy link
Member

@JoeCreates JoeCreates commented Dec 7, 2018

The main bulk of the stuff required for this already got merged into openfl, but one of Joshua's tweaks stopped it working again, so this PR will only have the desired effect once openfl/openfl#2093 gets merged into openfl (but it will build fine with the current develop branch).

Something not so clean in this PR right now is the fact that BaseDrawItem already has a blending:Int for tilesheets, but for the new graphics api we need to pass an actual BlendMode. We don't want to be converting this blend mode to an Int just to convert it back again (and I'm not sure the ints are even the same as those from Tilesheet).

I've added another field, blend:BlendMode to FlxBaseDrawItem. I feel like the tilesheet stuff should be updated to use this and only convert to an int before it is needed (if there is a need to keep that stuff at all), but that is a bit beyond the scope of this issue.

@JoeCreates JoeCreates changed the title Support for blend modes with drawQuads Support for blend modes with drawQuads, closes #2196 Dec 7, 2018
@@ -493,6 +493,7 @@ class FlxCamera extends FlxBasic
itemToReturn.colored = colored;
itemToReturn.hasColorOffsets = hasColorOffsets;
itemToReturn.blending = blendInt;
itemToReturn.blend = blend;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we also need to check blend earlier in this function (lines 468-474) to check if two draw items are the same?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Gama11 Gama11 merged commit cf499d6 into HaxeFlixel:dev Dec 7, 2018
davidetan added a commit to davidetan/flixel that referenced this pull request Jul 11, 2024
davidetan added a commit to davidetan/flixel that referenced this pull request Jul 11, 2024
davidetan added a commit to davidetan/flixel that referenced this pull request Jul 11, 2024
richTrash21 pushed a commit to richTrash21/flixel-rich that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants