|
|
@ -32,9 +32,10 @@ int main(void) {
|
|
|
|
srand(time(nullptr));
|
|
|
|
srand(time(nullptr));
|
|
|
|
std::atomic_bool gameover = false;
|
|
|
|
std::atomic_bool gameover = false;
|
|
|
|
notcurses_options ncopts{};
|
|
|
|
notcurses_options ncopts{};
|
|
|
|
ncopts.flags = NCOPTION_INHIBIT_SETLOCALE | NCOPTION_NO_ALTERNATE_SCREEN;
|
|
|
|
ncopts.flags = NCOPTION_INHIBIT_SETLOCALE;
|
|
|
|
ncpp::NotCurses nc(ncopts);
|
|
|
|
ncpp::NotCurses nc(ncopts);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
nc.refresh(nullptr, nullptr); // clear screen if smcup+background are unavailable
|
|
|
|
Tetris t{nc, gameover};
|
|
|
|
Tetris t{nc, gameover};
|
|
|
|
std::thread tid(&Tetris::Ticker, &t);
|
|
|
|
std::thread tid(&Tetris::Ticker, &t);
|
|
|
|
if(IOLoop(nc, t, gameover)){
|
|
|
|
if(IOLoop(nc, t, gameover)){
|
|
|
|