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:
Ali El Gariani 2007-06-15 19:10:01 +00:00
parent 1ac0d31656
commit 5ea108e468

View file

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