New: Alpha drawing mode, in 'Translucency'. Drawing AA Text automatically activates it. Fixed a problem in non-AA text that made it pick wrong colors if the current skin wasn't using white and black.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1512 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
16
src/misc.c
16
src/misc.c
@@ -499,6 +499,22 @@ byte Effect_substractive_colorize(word x,word y,byte color)
|
||||
blue<blue_under?blue:blue_under);
|
||||
}
|
||||
|
||||
byte Effect_alpha_colorize (word x,word y,byte color)
|
||||
{
|
||||
byte color_under = Read_pixel_from_feedback_screen(x,y);
|
||||
byte blue_under=Main_palette[color_under].B;
|
||||
byte green_under=Main_palette[color_under].G;
|
||||
byte red_under=Main_palette[color_under].R;
|
||||
int factor=(Main_palette[color].R*76 +
|
||||
Main_palette[color].G*151 +
|
||||
Main_palette[color].B*28)/255;
|
||||
|
||||
return Best_color(
|
||||
(Main_palette[Fore_color].R*factor + red_under*(255-factor))/255,
|
||||
(Main_palette[Fore_color].G*factor + green_under*(255-factor))/255,
|
||||
(Main_palette[Fore_color].B*factor + blue_under*(255-factor))/255);
|
||||
}
|
||||
|
||||
void Check_timer(void)
|
||||
{
|
||||
if((SDL_GetTicks()/55)-Timer_delay>Timer_start) Timer_state=1;
|
||||
|
||||
Reference in New Issue
Block a user