aboutsummaryrefslogtreecommitdiff
path: root/plot.c
diff options
context:
space:
mode:
Diffstat (limited to 'plot.c')
-rw-r--r--plot.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/plot.c b/plot.c
index 6a579d6..419513e 100644
--- a/plot.c
+++ b/plot.c
@@ -36,33 +36,13 @@ void plot_cell(unsigned int x, unsigned int y, struct colour *c)
);
}
-void plot_cell_borders()
+void plot_clear()
{
- int i, j;
-
- struct colour col = {.r = 0, .g = 0, .b = 0};
-
- for (i = 1; i < WIDTH_CELLS; i++)
- {
- j = i*CELL_SIZE + (i-1)*BORDER_THICKNESS;
- plot_rect(
- j, 0,
- BORDER_THICKNESS, HEIGHT_PIXELS,
- &col);
- }
-
- for (i = 1; i < HEIGHT_CELLS; i++)
- {
- j = i*CELL_SIZE + (i-1)*BORDER_THICKNESS;
- plot_rect(
- 0, j,
- WIDTH_PIXELS, BORDER_THICKNESS,
- &col);
- }
-
+ /* blank out the background with black */
+ SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF);
+ SDL_RenderFillRect(renderer, NULL);
}
-
int plot_init()
{
if (SDL_Init(SDL_INIT_VIDEO) < 0)
@@ -93,11 +73,7 @@ int plot_init()
return 1;
}
- /* blank out the background with gray */
- SDL_SetRenderDrawColor(renderer, 0x33, 0x33, 0x33, 0xFF);
- SDL_RenderFillRect(renderer, NULL);
-
- plot_cell_borders();
+ plot_clear();
return 0;
}