Making the API simpler, the blend modes are "none, blend, add" and are supported by all renderers.

--HG--
extra : rebase_source : f06ea01caa64c8ad14170c723e5af52dad64d779
This commit is contained in:
Sam Lantinga 2011-01-31 23:23:57 -08:00
parent 372693d86f
commit 825e1da54d
31 changed files with 193 additions and 2686 deletions

View file

@ -83,7 +83,7 @@ sub open_file {
/* DO NOT EDIT! This file is generated by sdlgenblit.pl */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
Copyright (C) 1997-2011 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -238,14 +238,7 @@ __EOF__
${s}B = (${s}B * ${s}A) / 255;
}
}
switch (flags & (SDL_COPY_MASK|SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_MASK:
if (${s}A) {
${d}R = ${s}R;
${d}G = ${s}G;
${d}B = ${s}B;
}
break;
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
case SDL_COPY_BLEND:
${d}R = ${s}R + ((255 - ${s}A) * ${d}R) / 255;
${d}G = ${s}G + ((255 - ${s}A) * ${d}G) / 255;
@ -256,11 +249,6 @@ __EOF__
${d}G = ${s}G + ${d}G; if (${d}G > 255) ${d}G = 255;
${d}B = ${s}B + ${d}B; if (${d}B > 255) ${d}B = 255;
break;
case SDL_COPY_MOD:
${d}R = (${s}R * ${d}R) / 255;
${d}G = (${s}G * ${d}G) / 255;
${d}B = (${s}B * ${d}B) / 255;
break;
}
__EOF__
}
@ -410,7 +398,7 @@ __EOF__
}
}
if ( $blend ) {
$flag = "SDL_COPY_MASK | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD";
$flag = "SDL_COPY_BLEND | SDL_COPY_ADD";
if ( $flags eq "" ) {
$flags = $flag;
} else {