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

Remove dependency on mask module #78

Closed
bitcraft opened this issue Mar 16, 2017 · 4 comments
Closed

Remove dependency on mask module #78

bitcraft opened this issue Mar 16, 2017 · 4 comments

Comments

@bitcraft
Copy link
Owner

Removing this dependency will make it easier to support pygame forks without the mask module. Comments?

@mclaughlinconnor
Copy link

I found that by completely replacing the smart_convert function in util_pygame.py with code below:

tile = original.convert_alpha()
return tile

Allows me to remove the mask submodule altogether and even use Pygame_SDL2, though I can't get it to run properly on Android (See the issue renpy/rapt#5)

Correct me if I'm wrong but, is the entire smart_convert function only used to improve efficiency.
I tested this on a few games I found around the internet, and all seemed well.

@bitcraft
Copy link
Owner Author

You are correct, smart convert is only used to improve rendering speed by determining the optimal surface format. The mask module is used to determine if there are transparent pixels and can do that really quickly. A work around may be to use a slower method if mask is not available. Thanks for checking it out and testing.

@mclaughlinconnor
Copy link

No problem, all I did to start was hard code the px, the moved from there.

@bitcraft
Copy link
Owner Author

I've included a small check for the mask module and it should work with pygame_sdl2 now. It will simply convert_alpha the surface if it fails to get a mask.

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

No branches or pull requests

2 participants