summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-10-28 19:15:07 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-10-28 19:15:07 +0200
commit875675406a927acf23a26b3e74ef84d6543eec6e (patch)
treef170f62b81209994dd9992c7b5b82813d33d6f72 /src/ui
parenta1f6143d5e461f20b4b513ea3a76b766d1f09734 (diff)
Fixed: Blend TextBuf only once when drawing
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/text.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui/text.c b/src/ui/text.c
index a592a97a..7c39089d 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -1020,11 +1020,13 @@ void init_TextBuf(iTextBuf *d, int font, const char *text) {
1020 SDL_TEXTUREACCESS_STATIC | SDL_TEXTUREACCESS_TARGET, 1020 SDL_TEXTUREACCESS_STATIC | SDL_TEXTUREACCESS_TARGET,
1021 d->size.x, 1021 d->size.x,
1022 d->size.y); 1022 d->size.y);
1023 SDL_SetTextureBlendMode(d->texture, SDL_BLENDMODE_BLEND);
1024 SDL_Texture *oldTarget = SDL_GetRenderTarget(render); 1023 SDL_Texture *oldTarget = SDL_GetRenderTarget(render);
1025 SDL_SetRenderTarget(render, d->texture); 1024 SDL_SetRenderTarget(render, d->texture);
1025 SDL_SetTextureBlendMode(text_.cache, SDL_BLENDMODE_NONE); /* blended when TextBuf is drawn */
1026 draw_Text_(font, zero_I2(), white_ColorId, range_CStr(text)); 1026 draw_Text_(font, zero_I2(), white_ColorId, range_CStr(text));
1027 SDL_SetTextureBlendMode(text_.cache, SDL_BLENDMODE_BLEND);
1027 SDL_SetRenderTarget(render, oldTarget); 1028 SDL_SetRenderTarget(render, oldTarget);
1029 SDL_SetTextureBlendMode(d->texture, SDL_BLENDMODE_BLEND);
1028} 1030}
1029 1031
1030void deinit_TextBuf(iTextBuf *d) { 1032void deinit_TextBuf(iTextBuf *d) {