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:
parent
69c9d4cf17
commit
a556922040
1 changed files with 3 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue