From 85ff80cbf7d2bf0946a3a7db67599158cda387cd Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Tue, 27 Aug 2024 17:13:52 +0800 Subject: [PATCH] fix: fix Bmap build issue. add banner for Unvirt --- BMap/BMExports.cpp | 16 +++++++++++----- BMap/BMap.cpp | 1 + CMakeLists.txt | 2 +- Unvirt/UnvirtContext.cpp | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/BMap/BMExports.cpp b/BMap/BMExports.cpp index b7bb704..457461a 100644 --- a/BMap/BMExports.cpp +++ b/BMap/BMExports.cpp @@ -1,5 +1,5 @@ #include "BMExports.hpp" -#include +#include #include #include #include @@ -54,8 +54,11 @@ _Ty CheckGeneralObject(BMap::BMFile* possible_bmfile, LibCmo::CK2::CK_ID possibl bool BMInit() { if (CheckInited()) return false; - // register IronPad - IronPad::IronPadRegister(); + // register exception handler if we are in Windows. +#if YYCC_OS == YYCC_OS_WINDOWS + YYCC::ExceptionHelper::Register(); +#endif + // and startup CK environment LibCmo::CK2::CKStartUp(); @@ -84,8 +87,11 @@ bool BMDispose() { // shutdown CK environment LibCmo::CK2::CKShutdown(); - // unregister iron pad - IronPad::IronPadUnregister(); + + // unregister exception handler if we are in Windows +#if YYCC_OS == YYCC_OS_WINDOWS + YYCC::ExceptionHelper::Unregister(); +#endif return true; } diff --git a/BMap/BMap.cpp b/BMap/BMap.cpp index cfc5158..57764b1 100644 --- a/BMap/BMap.cpp +++ b/BMap/BMap.cpp @@ -255,6 +255,7 @@ namespace BMap { cache.emplace_back(encodings[i]); } m_Context->SetEncoding(cache); + m_IsInitError = m_IsInitError || !m_Context->IsValidEncoding(); // set default texture save mode is external m_Context->SetGlobalImagesSaveOptions(LibCmo::CK2::CK_TEXTURE_SAVEOPTIONS::CKTEXTURE_EXTERNAL); diff --git a/CMakeLists.txt b/CMakeLists.txt index 99d4953..a6fa877 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.23) project(NeMo - VERSION 0.1.0 + VERSION 0.2.0 LANGUAGES CXX ) diff --git a/Unvirt/UnvirtContext.cpp b/Unvirt/UnvirtContext.cpp index 0c54340..f42edd1 100644 --- a/Unvirt/UnvirtContext.cpp +++ b/Unvirt/UnvirtContext.cpp @@ -281,8 +281,8 @@ namespace Unvirt::Context { YYCC::ConsoleHelper::EnableColorfulConsole(); // Show banner - YYCC::ConsoleHelper::WriteLine(YYCC_COLOR_LIGHT_YELLOW(u8"Unvirt")); - YYCC::ConsoleHelper::WriteLine(YYCC_COLOR_LIGHT_YELLOW(u8"Type 'help' for more infomation. Type 'exit' to quit.")); + YYCC::ConsoleHelper::WriteLine(YYCC_COLOR_LIGHT_YELLOW(u8"Unvirt 0.2.0") " build at " __DATE__ " " __TIME__); + YYCC::ConsoleHelper::WriteLine(u8"Type 'help' for more infomation. Type 'exit' to quit."); // start process loop while (true) {