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 /src/games/minesweeper | |
| parent | abb22cda9a82a323fd8f1d077adefd6970a1abaa (diff) | |
minesweeper: don't draw mine_counter = 0
Diffstat (limited to 'src/games/minesweeper')
| -rw-r--r-- | src/games/minesweeper/Minesweeper.cpp | 15 | 
1 files changed, 8 insertions, 7 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); +                    }                  }              }          }  | 
