Fix bug with garbled strings (#12083).

The alpha setting of the surface was messed, let's always force it
(not sure about SDL_RLEACCEL though). I can't explain why it resulted
in this garbled display, and more importantly why it only happened
recently; so there may still be another problem lurking somewhere.
This commit is contained in:
Guillaume Melquiond 2005-02-22 10:17:06 +00:00
parent 69c9d4cf17
commit a556922040

View file

@ -367,7 +367,9 @@ surface render_text(TTF_Font* font,const std::string& text, const SDL_Color& col
if (surfaces.empty()) {
return surface();
} else if (surfaces.size() == 1) {
return surfaces.front();
surface surf = surfaces.front();
SDL_SetAlpha(surf, SDL_SRCALPHA | SDL_RLEACCEL, SDL_ALPHA_OPAQUE);
return surf;
} else {
surface res(create_compatible_surface(surfaces.front(),width,height));