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

Implement SDL_UpperBlit as Surface.upper_blit #102

Merged
merged 6 commits into from
Jun 5, 2014
Merged

Implement SDL_UpperBlit as Surface.upper_blit #102

merged 6 commits into from
Jun 5, 2014

Conversation

gmorenz
Copy link
Contributor

@gmorenz gmorenz commented May 11, 2014

Contributes to #13

@andelf
Copy link
Contributor

andelf commented May 12, 2014

An Option<&Rect> is the same size & layout as a *Rect.
You can use mem::transmute(former cast::trasmute) to convert a Option<&Rect> to a nullable *Rect directly.
Option<Rect> => .as_ref() => Option<&Rect> => transmute() => *Rect

@gmorenz
Copy link
Contributor Author

gmorenz commented May 12, 2014

Thanks, I thought there should be a better way to do this but couldn't find it.

@andelf
Copy link
Contributor

andelf commented May 12, 2014

😄

@AngryLawyer
Copy link
Member

I'm always happiest when contributors on a project I'm maintaining are smarter than me :D

Let me know when you're happy for this to be merged

@gmorenz
Copy link
Contributor Author

gmorenz commented May 12, 2014

This can be merged as soon as #100 is merged, I tested on a branch with andelf's pull request to simplify things on my side.

@gmorenz
Copy link
Contributor Author

gmorenz commented May 14, 2014

I just noticed that SDL_UpperBlit has been replaced with SDL_BlitSurface according to the documentation... despite the fact that SDL_BlitSurface is actually just #defined to SDL_UpperBlit in the implementation, as such I have changed the name of this method from upper_blit to blit_surface, other then that this pull request can be merged any time now that #100 has been merged.

@andelf
Copy link
Contributor

andelf commented May 15, 2014

How about naming it .blit()?
for e.g. UnlockSurface => Surface.unlock()

@AngryLawyer
Copy link
Member

Yeah, I'd like just blit, then I'm happy for the merge :)

@jcmoyer
Copy link
Contributor

jcmoyer commented May 15, 2014

+1 for blit.

@AngryLawyer AngryLawyer merged commit be45cdd into Rust-SDL2:master Jun 5, 2014
@AngryLawyer
Copy link
Member

Cheers for this! Sorry for not merging sooner, I've been on holiday.

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.

4 participants