Skip to content

Commit

Permalink
imgui: disable asserts in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiao921 committed Apr 26, 2024
1 parent 4025147 commit 6d4db7a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ add_compile_definitions(Hell2Modding
"_CRT_SECURE_NO_WARNINGS"
"NOMINMAX"
"WIN32_LEAN_AND_MEAN"
"IMGUI_USER_CONFIG=\"${PROJECT_SOURCE_DIR}/src/gui/imgui_config.hpp\""
)

if (MSVC)
Expand Down
2 changes: 0 additions & 2 deletions src/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@
#include "sol/sol.hpp"

#define IMGUI_DEFINE_MATH_OPERATORS
#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
#include <imgui.h>
#define IMGUI_DEFINE_MATH_OPERATORS
#include <imgui_internal.h>
#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts

#include "logger/logger.hpp"

Expand Down
4 changes: 4 additions & 0 deletions src/gui/imgui_config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once

// Disable asserts
#define IM_ASSERT(_EXPR) ((void)(_EXPR))

0 comments on commit 6d4db7a

Please sign in to comment.