diff --git a/engine/app.h b/engine/app.h index 0c1cfd3..fe9f8f0 100644 --- a/engine/app.h +++ b/engine/app.h @@ -1,5 +1,6 @@ #pragma once +#include "log.h" #include "shader.h" #include "shape.h" #include "texture.h" diff --git a/engine/log.cpp b/engine/log.cpp index 8f0cd83..cd1cb23 100644 --- a/engine/log.cpp +++ b/engine/log.cpp @@ -73,13 +73,19 @@ void LogRemote::log(const wchar_t* format, ...) std::wstring string_to_convert(buffer, n); //setup converter - using convert_type = std::codecvt_utf8; - std::wstring_convert converter; +// using convert_type = std::codecvt_utf8; +// std::wstring_convert converter; + + mbstate_t st = {}; + std::string converted; + converted.reserve(string_to_convert.size()); + const wchar_t * wptr = string_to_convert.c_str(); + std::wcsrtombs((char*)converted.data(), &wptr, converted.capacity(), &st); //use converter (.to_bytes: wstr->str, .from_bytes: str->wstr) //std::string converted_str = converter.to_bytes(string_to_convert); - m_mq.Post(converter.to_bytes(string_to_convert)); + m_mq.Post(std::move(converted)); } LogRemote::~LogRemote() { diff --git a/engine/pch.h b/engine/pch.h index a63751f..c690b9a 100644 --- a/engine/pch.h +++ b/engine/pch.h @@ -47,8 +47,6 @@ #include #include #include -#include -#include #include #include #include