From be07a6b3aae742c27720aa3b8ef9372c80f6fbc9 Mon Sep 17 00:00:00 2001 From: blankie Date: Wed, 18 Jan 2023 23:37:37 +0700 Subject: [PATCH] Add non-debug checks --- event_loop.cpp | 4 ++++ myimconfig.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/event_loop.cpp b/event_loop.cpp index 00f3b92..a30f0fb 100644 --- a/event_loop.cpp +++ b/event_loop.cpp @@ -108,6 +108,7 @@ static inline void main_window(bool latest_log_entries_read, bool* show_settings ImGui::End(); } +#ifndef NDEBUG static inline void debug_window() { static bool show_demo_window = false; static size_t add_log_entry_presses = 1; @@ -148,6 +149,7 @@ static inline void debug_window() { ImGui::End(); } +#endif void event_loop(ImFont* monospace_font, Config& config, float* config_write_timer, LogcatThread& logcat_thread, bool* run_event_loop) { static bool show_settings_window = false; @@ -156,7 +158,9 @@ void event_loop(ImFont* monospace_font, Config& config, float* config_write_time check_for_logcat_items(logcat_thread); +#ifndef NDEBUG debug_window(); +#endif if (show_settings_window) { settings_window(config, config_write_timer, &show_settings_window); diff --git a/myimconfig.h b/myimconfig.h index fb72193..1e5f525 100644 --- a/myimconfig.h +++ b/myimconfig.h @@ -4,4 +4,6 @@ #define IM_ASSERT_USER_ERROR(expr,msg) do { if (!(expr)) { log(msg); } } while (0); +#ifndef NDEBUG #define IMGUI_DEBUG_PARANOID +#endif