From a538fb5524fa771a16e8cc291cae6cce46ea546d Mon Sep 17 00:00:00 2001 From: uvok Date: Sun, 11 Jan 2026 11:02:54 +0100 Subject: Move finish into UI --- nandgame/cpp/Vcomputer__main.cpp | 5 +---- nandgame/cpp/simpc_ui.cpp | 7 +++++++ nandgame/cpp/simpc_ui.h | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'nandgame') diff --git a/nandgame/cpp/Vcomputer__main.cpp b/nandgame/cpp/Vcomputer__main.cpp index 50f7c1b..5b7f615 100644 --- a/nandgame/cpp/Vcomputer__main.cpp +++ b/nandgame/cpp/Vcomputer__main.cpp @@ -94,10 +94,7 @@ int main(int argc, char **argv, char **) { // Print statistical summary report // contextp->statsPrintSummary(); -#if NCUR - getch(); - endwin(); -#endif + ui_finish(); return 0; } diff --git a/nandgame/cpp/simpc_ui.cpp b/nandgame/cpp/simpc_ui.cpp index 2fce3b8..5a75121 100644 --- a/nandgame/cpp/simpc_ui.cpp +++ b/nandgame/cpp/simpc_ui.cpp @@ -98,3 +98,10 @@ void draw_init(void) { curs_set(0); #endif } + +void ui_finish(void) { +#if NCUR + getch(); + endwin(); +#endif +} diff --git a/nandgame/cpp/simpc_ui.h b/nandgame/cpp/simpc_ui.h index 4f03d4a..8e07092 100644 --- a/nandgame/cpp/simpc_ui.h +++ b/nandgame/cpp/simpc_ui.h @@ -8,4 +8,5 @@ void draw_init(void); void draw_ui(const std::unique_ptr &topp, int &i, StepPosition_t sp); void draw_finish(const std::unique_ptr &contextp, - const std::unique_ptr &topp); \ No newline at end of file + const std::unique_ptr &topp); +void ui_finish(void); -- cgit v1.2.3