From 58ee7accff9219fc831aa7532dc8dc7b2dd57844 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Wed, 4 Feb 2026 17:11:52 +0800 Subject: [PATCH] feat: add lost ironpad and console color enable for BMapInspector. --- Ballance/BMapInspector/BMapInspector.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Ballance/BMapInspector/BMapInspector.cpp b/Ballance/BMapInspector/BMapInspector.cpp index 962e2fb..a5275a3 100644 --- a/Ballance/BMapInspector/BMapInspector.cpp +++ b/Ballance/BMapInspector/BMapInspector.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -139,6 +140,16 @@ static void CheckRules(BMapInspector::Cli::Args& args, BMapInspector::Map::Level int main(int argc, char* argv[]) { + // register exception handler if we are in Windows. +#if defined(LIBCMO_BUILD_RELEASE) && defined(YYCC_OS_WINDOWS) + yycc::carton::ironpad::startup(); +#endif + + // Enable terminal color feature +#if defined(YYCC_OS_WINDOWS) + auto suc = yycc::windows::console::colorful_console(); +#endif + // Startup CK2 engine. LibCmo::CK2::CKERROR err = LibCmo::CK2::CKStartUp(); if (err != LibCmo::CK2::CKERROR::CKERR_OK) throw std::runtime_error("fail to initialize CK2 engine."); @@ -157,5 +168,10 @@ int main(int argc, char* argv[]) { // Shutdown CK2 engine. LibCmo::CK2::CKShutdown(); + // unregister exception handler if we are in Windows +#if defined(LIBCMO_BUILD_RELEASE) && defined(YYCC_OS_WINDOWS) + yycc::carton::ironpad::shutdown(); +#endif + return 0; }