From 4964cb7bc3a4dd8ea3ffc8a66f70085056ad795a Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 15 Feb 2021 18:47:24 -0800 Subject: [PATCH] Add VVV_exit() This is just a function that calls the cleanup() in main.cpp, as well as calls exit(). I would have liked to use SDL_ExitProcess() here, because that function has ifdefs for different runtime environments. But alas, it's an internal function and isn't exported. Ah well; exit() seems to be fine anyway. --- desktop_version/src/Exit.h | 6 ++++++ desktop_version/src/main.cpp | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 desktop_version/src/Exit.h diff --git a/desktop_version/src/Exit.h b/desktop_version/src/Exit.h new file mode 100644 index 00000000..f3b9ff62 --- /dev/null +++ b/desktop_version/src/Exit.h @@ -0,0 +1,6 @@ +#ifndef VVV_EXIT_H +#define VVV_EXIT_H + +void VVV_exit(const int exit_code); + +#endif /* VVV_EXIT_H */ diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 2ff9c8bd..2ec1f24c 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -377,6 +377,12 @@ static void cleanup() FILESYSTEM_deinit(); } +void VVV_exit(const int exit_code) +{ + cleanup(); + exit(exit_code); +} + static void inline deltaloop() { //timestep limit to 30