view/demo/tetris: NCOPTION_INHIBIT_SETLOCALE

pull/632/head
nick black 4 years ago
parent 818ec25778
commit e5b1c2cdea
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -282,6 +282,7 @@ handle_opts(int argc, char** argv, notcurses_options* opts, bool* ignore_failure
usage(*argv, EXIT_FAILURE);
}
}
opts->flags |= NCOPTION_INHIBIT_SETLOCALE;
const char* spec = argv[optind];
return spec;
}

@ -208,7 +208,9 @@ int main(void){
if(setlocale(LC_ALL, "") == nullptr){
return EXIT_FAILURE;
}
NotCurses nc;
notcurses_options nopts{};
nopts.flags = NCOPTION_INHIBIT_SETLOCALE;
NotCurses nc(nopts);
if(!nc.mouse_enable()){
return EXIT_FAILURE;
}

@ -5,6 +5,7 @@ int main(void) {
srand(time(nullptr));
std::atomic_bool gameover = false;
notcurses_options ncopts{};
ncopts.flags = NCOPTION_INHIBIT_SETLOCALE;
ncpp::NotCurses nc(ncopts);
Tetris t{nc, gameover};
std::thread tid(&Tetris::Ticker, &t);

@ -191,7 +191,9 @@ auto main(int argc, char** argv) -> int {
setlocale(LC_ALL, "");
float timescale;
NCScale stretchmode;
auto nonopt = handle_opts(argc, argv, NotCurses::default_notcurses_options, &timescale, &stretchmode);
notcurses_options nopts{};
auto nonopt = handle_opts(argc, argv, nopts, &timescale, &stretchmode);
nopts.flags |= NCOPTION_INHIBIT_SETLOCALE;
NotCurses nc;
if(!nc.can_open_images()){
nc.stop();

Loading…
Cancel
Save