mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
view/demo/tetris: NCOPTION_INHIBIT_SETLOCALE
This commit is contained in:
parent
818ec25778
commit
e5b1c2cdea
@ -282,6 +282,7 @@ handle_opts(int argc, char** argv, notcurses_options* opts, bool* ignore_failure
|
|||||||
usage(*argv, EXIT_FAILURE);
|
usage(*argv, EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
opts->flags |= NCOPTION_INHIBIT_SETLOCALE;
|
||||||
const char* spec = argv[optind];
|
const char* spec = argv[optind];
|
||||||
return spec;
|
return spec;
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,9 @@ int main(void){
|
|||||||
if(setlocale(LC_ALL, "") == nullptr){
|
if(setlocale(LC_ALL, "") == nullptr){
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
NotCurses nc;
|
notcurses_options nopts{};
|
||||||
|
nopts.flags = NCOPTION_INHIBIT_SETLOCALE;
|
||||||
|
NotCurses nc(nopts);
|
||||||
if(!nc.mouse_enable()){
|
if(!nc.mouse_enable()){
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ 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;
|
||||||
ncpp::NotCurses nc(ncopts);
|
ncpp::NotCurses nc(ncopts);
|
||||||
Tetris t{nc, gameover};
|
Tetris t{nc, gameover};
|
||||||
std::thread tid(&Tetris::Ticker, &t);
|
std::thread tid(&Tetris::Ticker, &t);
|
||||||
|
@ -191,7 +191,9 @@ auto main(int argc, char** argv) -> int {
|
|||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
float timescale;
|
float timescale;
|
||||||
NCScale stretchmode;
|
NCScale stretchmode;
|
||||||
auto nonopt = handle_opts(argc, argv, NotCurses::default_notcurses_options, ×cale, &stretchmode);
|
notcurses_options nopts{};
|
||||||
|
auto nonopt = handle_opts(argc, argv, nopts, ×cale, &stretchmode);
|
||||||
|
nopts.flags |= NCOPTION_INHIBIT_SETLOCALE;
|
||||||
NotCurses nc;
|
NotCurses nc;
|
||||||
if(!nc.can_open_images()){
|
if(!nc.can_open_images()){
|
||||||
nc.stop();
|
nc.stop();
|
||||||
|
Loading…
Reference in New Issue
Block a user