fix: not updating text entirely

This commit is contained in:
2025-02-17 00:41:59 +01:00
parent f30b8182b1
commit 25954afeea

View File

@@ -55,7 +55,7 @@ static void draw_score_text(render_data const* dat) {
SDL_Renderer* const renderer = dat->renderer; SDL_Renderer* const renderer = dat->renderer;
TTF_Font* const font = dat->font; TTF_Font* const font = dat->font;
if (!(cache->prevscore != score && cache->score_texture != NULL)) { if (cache->prevscore != score || cache->score_texture == NULL) {
char score_text[6]; // max digits of a uint16 + \0 terminator char score_text[6]; // max digits of a uint16 + \0 terminator
if (!score) sprintf(score_text, "0"); if (!score) sprintf(score_text, "0");
else sprintf(score_text, "%hu0", score); else sprintf(score_text, "%hu0", score);