survivor

graphical action game for the linux terminal
git clone https://git.ce9e.org/survivor.git

commit
38a04ba92a5518aa479d6aa206d286f77d1f437e
parent
b8790d66679c69ab2ce177672d989eb2638db641
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-02-19 12:43
tweak terminal setup and teardown

Diffstat

M src/term.rs 3 ++-

1 files changed, 2 insertions, 1 deletions


diff --git a/src/term.rs b/src/term.rs

@@ -93,6 +93,7 @@ pub struct Screen {
   93    93 impl Drop for Screen {
   94    94     fn drop(&mut self) {
   95    95         ti::cnorm();
   -1    96         ti::sgr0();
   96    97     }
   97    98 }
   98    99 
@@ -101,6 +102,7 @@ impl Screen {
  101   102         let (w, h) = get_terminal_size();
  102   103         let width = w * 2;
  103   104         let height = (h - 1) * 3;
   -1   105         ti::civis();
  104   106         return Screen {
  105   107             width: width,
  106   108             height: height,
@@ -117,7 +119,6 @@ impl Screen {
  117   119         let mut prev_fg = [0xff, 0xff, 0xff];
  118   120 
  119   121         ti::cup(0, 0);
  120    -1         ti::civis();
  121   122         for y in 0..(self.height / 3) {
  122   123             for x in 0..(self.width / 2) {
  123   124                 let (block, bg, fg) = get_block([