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:
Yves Rizoud
2010-06-17 18:06:09 +00:00
parent ab657b018e
commit 95665a99df
6 changed files with 70 additions and 29 deletions

View File

@@ -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;