From e49ee14ed0038758dff70486b159da2c3aac53a5 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Sun, 3 Jan 2021 00:38:51 +0100 Subject: [PATCH 1/2] Add option to redirect output to file --- src/core/config.h | 1 + src/skel/glfw/glfw.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/core/config.h b/src/core/config.h index 9f4ccd1f..fcfe980f 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -235,6 +235,7 @@ enum Config { #ifdef DEBUGMENU #define MISSION_SWITCHER // from debug menu #endif +//#define LOG_TO_FILE // Rendering/display //#define EXTRA_MODEL_FLAGS // from mobile to optimize rendering diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index 93bfde5a..dcd2b23f 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -1488,6 +1488,10 @@ WinMain(HINSTANCE instance, int main(int argc, char *argv[]) { +#ifdef LOG_TO_FILE + freopen("re3_log.txt", "w", stdout); + freopen("re3_errors.txt", "w", stderr); +#endif #endif RwV2d pos; RwInt32 i; From 0d581f2f8b794aca872ff80960624b61b70dff1d Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Sat, 30 Jan 2021 23:46:16 +0100 Subject: [PATCH 2/2] Fix --- src/skel/glfw/glfw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index dcd2b23f..99b1e380 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -1488,10 +1488,10 @@ WinMain(HINSTANCE instance, int main(int argc, char *argv[]) { +#endif #ifdef LOG_TO_FILE freopen("re3_log.txt", "w", stdout); freopen("re3_errors.txt", "w", stderr); -#endif #endif RwV2d pos; RwInt32 i;