diff options
| author | fschildt <florian.schildt@protonmail.com> | 2025-10-13 14:30:26 +0200 |
|---|---|---|
| committer | fschildt <florian.schildt@protonmail.com> | 2025-10-13 14:30:26 +0200 |
| commit | 9f2845b12135c32dde91e58afc1193d54333ec9f (patch) | |
| tree | a76c2277fcc73d86ea00e48695692b33cf806c1a | |
| parent | abb22cda9a82a323fd8f1d077adefd6970a1abaa (diff) | |
minesweeper: don't draw mine_counter = 0
| -rw-r--r-- | src/games/minesweeper/Minesweeper.cpp | 15 | ||||
| -rw-r--r-- | src/renderer/RSoftwareBackend.cpp | 1 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/games/minesweeper/Minesweeper.cpp b/src/games/minesweeper/Minesweeper.cpp index 9b07362..2a69e4d 100644 --- a/src/games/minesweeper/Minesweeper.cpp +++ b/src/games/minesweeper/Minesweeper.cpp @@ -414,13 +414,14 @@ Minesweeper::DrawBoard() 256.0f }; int32_t mine_count = m_adjacent_mine_counts[y*m_grid_width + x]; - - Color color = s_mine_count_colors[mine_count-1]; - Glyph& glyph = m_font.GetGlyph('0' + (char32_t)mine_count); - g_renderer.PushAlphaBitmap( - glyph.bitmap, - mine_count_pos, - color); + if (mine_count > 0) { + Color color = s_mine_count_colors[mine_count-1]; + Glyph& glyph = m_font.GetGlyph('0' + (char32_t)mine_count); + g_renderer.PushAlphaBitmap( + glyph.bitmap, + mine_count_pos, + color); + } } } } diff --git a/src/renderer/RSoftwareBackend.cpp b/src/renderer/RSoftwareBackend.cpp index 7bcdd8f..4d78ec7 100644 --- a/src/renderer/RSoftwareBackend.cpp +++ b/src/renderer/RSoftwareBackend.cpp @@ -1,4 +1,3 @@ -#include "renderer/Renderer.hpp" #include <renderer/RSoftwareBackend.hpp> #include <SDL3/SDL_video.h> |
