From 5869cd9a9eac421eb8f1084bb96d1fa012132df3 Mon Sep 17 00:00:00 2001 From: Rasmus Anthin Date: Mon, 14 Oct 2024 12:43:44 +0200 Subject: [PATCH] Screen.h: * Oops again. Seems that two or three commits ago, that I thought I pasted over what I thought were the two functions I wanted to replace, but instead I accidentally pasted over the the draw_frame() function and caused a duplication of function save_terminal_colors() instead. Should work now. --- Screen.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Screen.h b/Screen.h index 32212e8..973a5b9 100644 --- a/Screen.h +++ b/Screen.h @@ -223,6 +223,20 @@ styles::Style restore_terminal_colors() return orig_style; } +template +void draw_frame(SpriteHandler& sh, Color fg_color) +{ + const int nc_inset = sh.num_cols_inset(); + const int nr_inset = sh.num_rows_inset(); + sh.write_buffer("+" + str::rep_char('-', nc_inset) + "+", 0, 0, fg_color); + for (int r = 1; r <= nr_inset; ++r) + { + sh.write_buffer("|", r, 0, fg_color); + sh.write_buffer("|", r, nc_inset+1, fg_color); + } + sh.write_buffer("+" + str::rep_char('-', nc_inset) + "+", nr_inset+1, 0, fg_color); +} + // http://www.network-science.de/ascii/ // http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Game%20Over Graffiti // # ________ _____ _____ ___________ #