From 0010de9d309cb6dbdc159848eb735f2572881a8f Mon Sep 17 00:00:00 2001 From: Dario Date: Tue, 17 Dec 2024 19:07:37 -0300 Subject: [PATCH] Add Env Var detection for VCPKG_ROOT, add DLC detection. --- CMakeLists.txt | 4 ++++ UnleashedRecomp/main.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a7f85b7..652f3acd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required (VERSION 3.20) +if(NOT DEFINED ENV{VCPKG_ROOT}) + message(FATAL_ERROR "VCPKG_ROOT is not defined!") +endif() + include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake) set(SWA_THIRDPARTY_ROOT ${CMAKE_SOURCE_DIR}/thirdparty) set(SWA_TOOLS_ROOT ${CMAKE_SOURCE_DIR}/tools) diff --git a/UnleashedRecomp/main.cpp b/UnleashedRecomp/main.cpp index 214b1c64..5f61c3df 100644 --- a/UnleashedRecomp/main.cpp +++ b/UnleashedRecomp/main.cpp @@ -69,6 +69,16 @@ void KiSystemStartup() // OS mounts game data to D: XamContentCreateEx(0, "D", &gameContent, OPEN_EXISTING, nullptr, nullptr, 0, 0, nullptr); + for (auto& file : std::filesystem::directory_iterator("./dlc")) + { + if (file.is_directory()) + { + std::u8string fileNameU8 = file.path().filename().u8string(); + std::u8string filePathU8 = file.path().u8string(); + XamRegisterContent(XamMakeContent(XCONTENTTYPE_DLC, (const char*)(fileNameU8.c_str())), (const char*)(filePathU8.c_str())); + } + } + XAudioInitializeSystem(); }