From a76ee9a5af09d5f4dec6bf13d143718b14736e12 Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 22 Jul 2020 13:34:18 -0400 Subject: [PATCH] tetris: refresh on startup in place of erase() --- src/tetris/background.h | 1 - src/tetris/main.h | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tetris/background.h b/src/tetris/background.h index 8154ac883..852c47c49 100644 --- a/src/tetris/background.h +++ b/src/tetris/background.h @@ -8,7 +8,6 @@ void DrawBackground(const std::string& s) { // drawn to the standard plane } void DrawBoard() { // draw all fixed components of the game - stdplane_->erase(); try{ DrawBackground(BackgroundFile); }catch(...){ diff --git a/src/tetris/main.h b/src/tetris/main.h index 0cef53326..d342bcbb8 100644 --- a/src/tetris/main.h +++ b/src/tetris/main.h @@ -32,9 +32,10 @@ int main(void) { srand(time(nullptr)); std::atomic_bool gameover = false; notcurses_options ncopts{}; - ncopts.flags = NCOPTION_INHIBIT_SETLOCALE | NCOPTION_NO_ALTERNATE_SCREEN; + ncopts.flags = NCOPTION_INHIBIT_SETLOCALE; ncpp::NotCurses nc(ncopts); { + nc.refresh(nullptr, nullptr); // clear screen if smcup+background are unavailable Tetris t{nc, gameover}; std::thread tid(&Tetris::Ticker, &t); if(IOLoop(nc, t, gameover)){