From 5e94d7312509be60ff06ac6e0d9a94995dc5df0b Mon Sep 17 00:00:00 2001 From: feiy Date: Thu, 21 Dec 2023 11:34:16 +0800 Subject: [PATCH] Missing files & fix boost_url linking --- QGameDev/CMakeLists.txt | 1 + QGamePlayer/CMakeLists.txt | 1 + Test.Cpp/Test.Cpp.vcxproj | 2 ++ Test.Cpp/packages.config | 1 + Test.V8/Test.V8.vcxproj | 2 ++ Test.V8/packages.config | 1 + Three.V8/Three.V8.vcxproj | 2 ++ Three.V8/packages.config | 1 + ThreeEngine/ThreeEngine.vcxproj | 2 ++ ThreeEngine/network/HttpClient.cpp | 2 +- ThreeEngine/packages.config | 1 + ThreeEngine/utils/Logging.cpp | 39 ++++++++++++++++++++++++++++++ ThreeEngine/utils/Logging.h | 18 ++++++++++++++ 13 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 ThreeEngine/utils/Logging.cpp create mode 100644 ThreeEngine/utils/Logging.h diff --git a/QGameDev/CMakeLists.txt b/QGameDev/CMakeLists.txt index 68caa0c..fd43bfa 100644 --- a/QGameDev/CMakeLists.txt +++ b/QGameDev/CMakeLists.txt @@ -174,6 +174,7 @@ set (LINK_DIR ../thirdparty/portaudio/lib ../thirdparty/webp/lib ../thirdparty/webview2/lib +../packages/boost_url-vc143.1.84.0/lib/native ../packages/zeroc.openssl.v143.1.1.1.3/build/native/lib/x64/Release ../packages/FFmpeg.Nightly.20200831.1.0/build/native/lib/x64 ../packages/v8-v143-x64.11.9.169.4/lib/Release diff --git a/QGamePlayer/CMakeLists.txt b/QGamePlayer/CMakeLists.txt index 0541ef0..ab644f5 100644 --- a/QGamePlayer/CMakeLists.txt +++ b/QGamePlayer/CMakeLists.txt @@ -57,6 +57,7 @@ set (LINK_DIR ../thirdparty/portaudio/lib ../thirdparty/webp/lib ../thirdparty/webview2/lib +../packages/boost_url-vc143.1.84.0/lib/native ../packages/zeroc.openssl.v143.1.1.1.3/build/native/lib/x64/Release ../packages/FFmpeg.Nightly.20200831.1.0/build/native/lib/x64 ../packages/v8-v143-x64.11.9.169.4/lib/Release diff --git a/Test.Cpp/Test.Cpp.vcxproj b/Test.Cpp/Test.Cpp.vcxproj index a404628..2a159b3 100644 --- a/Test.Cpp/Test.Cpp.vcxproj +++ b/Test.Cpp/Test.Cpp.vcxproj @@ -162,11 +162,13 @@ + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + \ No newline at end of file diff --git a/Test.Cpp/packages.config b/Test.Cpp/packages.config index 04f9fc0..4a39e37 100644 --- a/Test.Cpp/packages.config +++ b/Test.Cpp/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/Test.V8/Test.V8.vcxproj b/Test.V8/Test.V8.vcxproj index b959d5a..1c16ff0 100644 --- a/Test.V8/Test.V8.vcxproj +++ b/Test.V8/Test.V8.vcxproj @@ -154,6 +154,7 @@ + @@ -164,5 +165,6 @@ + \ No newline at end of file diff --git a/Test.V8/packages.config b/Test.V8/packages.config index e8f4084..b9aaf78 100644 --- a/Test.V8/packages.config +++ b/Test.V8/packages.config @@ -1,6 +1,7 @@  + diff --git a/Three.V8/Three.V8.vcxproj b/Three.V8/Three.V8.vcxproj index 8bc2581..32b8e87 100644 --- a/Three.V8/Three.V8.vcxproj +++ b/Three.V8/Three.V8.vcxproj @@ -297,6 +297,7 @@ + @@ -306,5 +307,6 @@ + \ No newline at end of file diff --git a/Three.V8/packages.config b/Three.V8/packages.config index cb44329..7247b1a 100644 --- a/Three.V8/packages.config +++ b/Three.V8/packages.config @@ -1,6 +1,7 @@  + diff --git a/ThreeEngine/ThreeEngine.vcxproj b/ThreeEngine/ThreeEngine.vcxproj index 838a5a8..fa6a823 100644 --- a/ThreeEngine/ThreeEngine.vcxproj +++ b/ThreeEngine/ThreeEngine.vcxproj @@ -434,6 +434,7 @@ + @@ -441,5 +442,6 @@ + \ No newline at end of file diff --git a/ThreeEngine/network/HttpClient.cpp b/ThreeEngine/network/HttpClient.cpp index 8ba18a2..ffcf7dc 100644 --- a/ThreeEngine/network/HttpClient.cpp +++ b/ThreeEngine/network/HttpClient.cpp @@ -1,4 +1,4 @@ -#include +#include using namespace boost::urls; #include "utils/AsyncCallbacks.h" diff --git a/ThreeEngine/packages.config b/ThreeEngine/packages.config index c105c11..a822bd1 100644 --- a/ThreeEngine/packages.config +++ b/ThreeEngine/packages.config @@ -1,5 +1,6 @@  + \ No newline at end of file diff --git a/ThreeEngine/utils/Logging.cpp b/ThreeEngine/utils/Logging.cpp new file mode 100644 index 0000000..b09457f --- /dev/null +++ b/ThreeEngine/utils/Logging.cpp @@ -0,0 +1,39 @@ +#include +#include "Logging.h" + +void* Logging::m_print_callback_data = nullptr; +PrintCallback Logging::m_print_callback = nullptr; +PrintCallback Logging::m_error_callback = nullptr; + +void Logging::SetPrintCallbacks(void* ptr, PrintCallback print_callback, PrintCallback error_callback) +{ + m_print_callback_data = ptr; + m_print_callback = print_callback; + m_error_callback = error_callback; +} + +void Logging::print_std(const char* str) +{ + if (m_print_callback != nullptr) + { + m_print_callback(m_print_callback_data, str); + } + else + { + printf("%s\n", str); + } +} + +void Logging::print_err(const char* str) +{ + if (m_error_callback != nullptr) + { + m_error_callback(m_print_callback_data, str); + } + else + { + fprintf(stderr, "%s\n", str); + } +} + + diff --git a/ThreeEngine/utils/Logging.h b/ThreeEngine/utils/Logging.h new file mode 100644 index 0000000..97c13b7 --- /dev/null +++ b/ThreeEngine/utils/Logging.h @@ -0,0 +1,18 @@ +#pragma once + +typedef void (*PrintCallback)(void* ptr, const char* str); + +class Logging +{ +public: + static void SetPrintCallbacks(void* ptr, PrintCallback print_callback, PrintCallback error_callback); + static void print_std(const char* str); + static void print_err(const char* str); + +private: + static void* m_print_callback_data; + static PrintCallback m_print_callback; + static PrintCallback m_error_callback; + + +}; \ No newline at end of file