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

Add Alpha Blitter #420

Closed
clintbellanger opened this issue Jun 14, 2012 · 2 comments
Closed

Add Alpha Blitter #420

clintbellanger opened this issue Jun 14, 2012 · 2 comments
Labels

Comments

@clintbellanger
Copy link
Owner

@clintbellanger clintbellanger commented Jun 14, 2012

There are only a couple places we want to merge two fully Alpha-transparent surfaces before drawing the result to screen. SDL doesn't handle this by default (it uses the alpha channel of the source or destination, not both).

We mainly use this when we composite the hero sprite layers (during gameplay and on the loading screen).

So currently we use color key transparency (magic pink), which makes the character outline aliased. It's not pretty.

SDL_gfx has a custom (not hardware accelerated) method to combine alpha surfaces the way we want.

Instead of adding the entire SDL_gfx library as a dependency, I'm thinking we can just grab the SDL_gfxBlitFunc.c (and matching .h) and add it to Flare.

http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_blit_func_8c.html#ac51ff40d39f3dd0bd08116e8953960f8

It's slow, but it's something we only use rarely -- during a single frame's logic() update after the hero is loaded or changes equipment.

@Premislaus
Copy link

@Premislaus Premislaus commented Jul 3, 2012

I do not know much about making games. But I know that you can draw a 2D game using OpenGL. Then you have hardware acceleration for everything.

I really like your game!

http://translate.google.pl/translate?sl=auto&tl=en&js=n&prev=_t&hl=pl&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fforum.warsztat.gd%2Findex.php%3Ftopic%3D24572.0

@clintbellanger
Copy link
Owner Author

@clintbellanger clintbellanger commented Jul 8, 2012

SDL_gfxBlitFunc.h and .c added.

This is from SDL_gfx, written by Andreas Schiffler and released under the ZLIB license (GPL compatible).

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.