diff options
Diffstat (limited to 'src/games/minesweeper/Minesweeper.cpp')
| -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); + } } } } |
