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

Blit function consistency shuffle #733

Merged
merged 4 commits into from
Jan 6, 2022
Merged

Conversation

Daft-Freak
Copy link
Collaborator

This is hopefully just some cleanup of Surface methods. It replaces (stretch_)blit_sprite with new (stretch_)blit overloads that take a surface/transform and removes the optional hflip param from blit() (the new overloads allow a full transform).

There are deprecated wrappers to avoid breaking old code, though only one of the three functions was used in one example... and there only seems to be one repo on GitHub that uses the sprite blit functions directly (DANG).

Before:

(stretch_)blit_sprite: takes a transform, always uses Surface::sprites
(stretch_)blit: can pass any surface, no transforms (except blit has a hflip)

Now there are transform/non transform overloads for each and both take a surface.

The `sprite` functions all work as before and there are wrappers for compatibility.

(I have no idea if much other than shmup uses "blit with hflip")
Avoids overload ambiguity (SpriteTransform is an int enum).
The one user of one of the three deprecated functions in all the examples.
@Gadgetoid Gadgetoid merged commit a35f7f6 into 32blit:master Jan 6, 2022
@Daft-Freak Daft-Freak deleted the blit-shuffle branch January 6, 2022 15:14
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