Skip to content

Commit

Permalink
Screen.h:
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
razterizer committed Oct 14, 2024
1 parent cb38621 commit 5869cd9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,20 @@ styles::Style restore_terminal_colors()
return orig_style;
}

template<int NR, int NC>
void draw_frame(SpriteHandler<NR, NC>& 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
// # ________ _____ _____ ___________ #
Expand Down

0 comments on commit 5869cd9

Please sign in to comment.