optimization for drawing of floating labels with transparent background
(like tooltips) fix the alpha channel when filling the rectangle, instead of adjusting each pixels after creation
This commit is contained in:
parent
1ac0d31656
commit
5ea108e468
1 changed files with 1 additions and 7 deletions
|
@ -860,13 +860,7 @@ surface floating_label::create_surface()
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SDL_FillRect(tmp,NULL,SDL_MapRGB(tmp->format,bgcolour_.r,bgcolour_.g,bgcolour_.b));
|
||||
if(bgalpha_ != 255) {
|
||||
tmp.assign(adjust_surface_alpha_add(tmp,bgalpha_ - 255));
|
||||
if(tmp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
SDL_FillRect(tmp,NULL,SDL_MapRGBA(tmp->format,bgcolour_.r,bgcolour_.g,bgcolour_.b, bgalpha_));
|
||||
|
||||
surf_.assign(tmp);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue