aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/games/minesweeper/Minesweeper.cpp15
-rw-r--r--src/renderer/RSoftwareBackend.cpp1
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>