From 46d1c31bda749e4a829bf94e618965d234df76b8 Mon Sep 17 00:00:00 2001 From: Jujstme Date: Fri, 7 Mar 2025 17:43:23 +0100 Subject: [PATCH 1/8] Upload patches --- README.md | 14 ++++++++++++++ UnleashedRecomp/app.cpp | 2 +- UnleashedRecomp/kernel/xam.cpp | 4 ++-- UnleashedRecomp/main.cpp | 10 +++++----- UnleashedRecomp/mod/mod_loader.cpp | 2 +- UnleashedRecomp/user/paths.cpp | 1 + UnleashedRecomp/user/paths.h | 10 ++++++++-- 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index abf1a3d..eb329ee 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ +> [!WARNING] +> This repository is a fork of the Unleashed Recompiled project, specifically designed to support binary Arch Linux packaging through the AUR and the PKGBUILD system. For Windows builds, please refer to the upstream repository. +> **Do not attempt to compile the content of this repository with Windows targets**. +> Please be also aware this package, unlike the Flatpak version provided upstream, may not be compatible with the Hedgemod Manager differently from the Flatpak version provided upstream. + +Binaries from this repository are built using: + +``` +$ cmake -DCMAKE_AR=/usr/bin/llvm-ar -DCMAKE_RANLIB=/usr/bin/llvm-ranlib . --preset linux-release +$ cmake --build ./out/build/linux-release --target UnleashedRecomp +``` + +--- +

diff --git a/UnleashedRecomp/app.cpp b/UnleashedRecomp/app.cpp index b298ebc..e6c2414 100644 --- a/UnleashedRecomp/app.cpp +++ b/UnleashedRecomp/app.cpp @@ -33,7 +33,7 @@ PPC_FUNC_IMPL(__imp__sub_824EB490); PPC_FUNC(sub_824EB490) { App::s_isInit = true; - App::s_isMissingDLC = !Installer::checkAllDLC(GetGamePath()); + App::s_isMissingDLC = !Installer::checkAllDLC(g_gamepath); App::s_language = Config::Language; SWA::SGlobals::Init(); diff --git a/UnleashedRecomp/kernel/xam.cpp b/UnleashedRecomp/kernel/xam.cpp index 3d7ca77..05f34d5 100644 --- a/UnleashedRecomp/kernel/xam.cpp +++ b/UnleashedRecomp/kernel/xam.cpp @@ -315,11 +315,11 @@ uint32_t XamContentCreateEx(uint32_t dwUserIndex, const char* szRootName, const } else if (pContentData->dwContentType == XCONTENTTYPE_DLC) { - root = GAME_INSTALL_DIRECTORY "/dlc"; + root = g_gamepath + "/dlc"; } else { - root = GAME_INSTALL_DIRECTORY; + root = g_gamepath; } XamRegisterContent(*pContentData, root); diff --git a/UnleashedRecomp/main.cpp b/UnleashedRecomp/main.cpp index a55c018..fe4b303 100644 --- a/UnleashedRecomp/main.cpp +++ b/UnleashedRecomp/main.cpp @@ -61,8 +61,8 @@ void KiSystemStartup() { const auto gameContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Game"); const auto updateContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Update"); - XamRegisterContent(gameContent, GAME_INSTALL_DIRECTORY "/game"); - XamRegisterContent(updateContent, GAME_INSTALL_DIRECTORY "/update"); + XamRegisterContent(gameContent, g_gamepath + "/game"); + XamRegisterContent(updateContent, g_gamepath + "/update"); const auto saveFilePath = GetSaveFilePath(true); bool saveFileExists = std::filesystem::exists(saveFilePath); @@ -94,7 +94,7 @@ void KiSystemStartup() XamContentCreateEx(0, "D", &gameContent, OPEN_EXISTING, nullptr, nullptr, 0, 0, nullptr); std::error_code ec; - for (auto& file : std::filesystem::directory_iterator(GAME_INSTALL_DIRECTORY "/dlc", ec)) + for (auto& file : std::filesystem::directory_iterator(g_gamepath + "/dlc", ec)) { if (file.is_directory()) { @@ -244,7 +244,7 @@ int main(int argc, char *argv[]) HostStartup(); std::filesystem::path modulePath; - bool isGameInstalled = Installer::checkGameInstall(GAME_INSTALL_DIRECTORY, modulePath); + bool isGameInstalled = Installer::checkGameInstall(g_gamepath, modulePath); bool runInstallerWizard = forceInstaller || forceDLCInstaller || !isGameInstalled; if (runInstallerWizard) { @@ -254,7 +254,7 @@ int main(int argc, char *argv[]) std::_Exit(1); } - if (!InstallerWizard::Run(GAME_INSTALL_DIRECTORY, isGameInstalled && forceDLCInstaller)) + if (!InstallerWizard::Run(g_gamepath, isGameInstalled && forceDLCInstaller)) { std::_Exit(0); } diff --git a/UnleashedRecomp/mod/mod_loader.cpp b/UnleashedRecomp/mod/mod_loader.cpp index dd33c56..282238d 100644 --- a/UnleashedRecomp/mod/mod_loader.cpp +++ b/UnleashedRecomp/mod/mod_loader.cpp @@ -100,7 +100,7 @@ void ModLoader::Init() { configIni = {}; - if (!configIni.read(GAME_INSTALL_DIRECTORY "/cpkredir.ini")) + if (!configIni.read(g_gamepath + "/cpkredir.ini")) return; } diff --git a/UnleashedRecomp/user/paths.cpp b/UnleashedRecomp/user/paths.cpp index 13a8588..633d97c 100644 --- a/UnleashedRecomp/user/paths.cpp +++ b/UnleashedRecomp/user/paths.cpp @@ -3,6 +3,7 @@ std::filesystem::path g_executableRoot = os::process::GetExecutablePath().remove_filename(); std::filesystem::path g_userPath = BuildUserPath(); +extern const std::string g_gamepath = GetGamePath(); bool CheckPortable() { diff --git a/UnleashedRecomp/user/paths.h b/UnleashedRecomp/user/paths.h index c083520..118b570 100644 --- a/UnleashedRecomp/user/paths.h +++ b/UnleashedRecomp/user/paths.h @@ -10,14 +10,20 @@ extern std::filesystem::path g_executableRoot; -inline std::filesystem::path GetGamePath() +inline std::string GetGamePath() { - return GAME_INSTALL_DIRECTORY; + const char* homeDir = getenv("HOME"); + if (homeDir == nullptr) + return g_executableRoot.string(); + std::filesystem::path homePath = homeDir; + std::filesystem::path gamePath = homePath / ".local/share" / USER_DIRECTORY; + return gamePath.string(); } bool CheckPortable(); std::filesystem::path BuildUserPath(); const std::filesystem::path& GetUserPath(); +extern const std::string g_gamepath; inline std::filesystem::path GetSavePath(bool checkForMods) { From a60a7cefef97eeadcba0041eeb16ec206977390c Mon Sep 17 00:00:00 2001 From: Jujstme Date: Mon, 10 Mar 2025 17:36:28 +0100 Subject: [PATCH 2/8] Changed `g_gamepath` into a more descriptive `g_gameInstallPath` --- UnleashedRecomp/app.cpp | 2 +- UnleashedRecomp/kernel/xam.cpp | 4 ++-- UnleashedRecomp/main.cpp | 10 +++++----- UnleashedRecomp/mod/mod_loader.cpp | 2 +- UnleashedRecomp/user/paths.cpp | 2 +- UnleashedRecomp/user/paths.h | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/UnleashedRecomp/app.cpp b/UnleashedRecomp/app.cpp index e6c2414..84d2376 100644 --- a/UnleashedRecomp/app.cpp +++ b/UnleashedRecomp/app.cpp @@ -33,7 +33,7 @@ PPC_FUNC_IMPL(__imp__sub_824EB490); PPC_FUNC(sub_824EB490) { App::s_isInit = true; - App::s_isMissingDLC = !Installer::checkAllDLC(g_gamepath); + App::s_isMissingDLC = !Installer::checkAllDLC(g_gameInstallPath); App::s_language = Config::Language; SWA::SGlobals::Init(); diff --git a/UnleashedRecomp/kernel/xam.cpp b/UnleashedRecomp/kernel/xam.cpp index 05f34d5..adb1cf0 100644 --- a/UnleashedRecomp/kernel/xam.cpp +++ b/UnleashedRecomp/kernel/xam.cpp @@ -315,11 +315,11 @@ uint32_t XamContentCreateEx(uint32_t dwUserIndex, const char* szRootName, const } else if (pContentData->dwContentType == XCONTENTTYPE_DLC) { - root = g_gamepath + "/dlc"; + root = g_gameInstallPath + "/dlc"; } else { - root = g_gamepath; + root = g_gameInstallPath; } XamRegisterContent(*pContentData, root); diff --git a/UnleashedRecomp/main.cpp b/UnleashedRecomp/main.cpp index fe4b303..55a25cf 100644 --- a/UnleashedRecomp/main.cpp +++ b/UnleashedRecomp/main.cpp @@ -61,8 +61,8 @@ void KiSystemStartup() { const auto gameContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Game"); const auto updateContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Update"); - XamRegisterContent(gameContent, g_gamepath + "/game"); - XamRegisterContent(updateContent, g_gamepath + "/update"); + XamRegisterContent(gameContent, g_gameInstallPath + "/game"); + XamRegisterContent(updateContent, g_gameInstallPath + "/update"); const auto saveFilePath = GetSaveFilePath(true); bool saveFileExists = std::filesystem::exists(saveFilePath); @@ -94,7 +94,7 @@ void KiSystemStartup() XamContentCreateEx(0, "D", &gameContent, OPEN_EXISTING, nullptr, nullptr, 0, 0, nullptr); std::error_code ec; - for (auto& file : std::filesystem::directory_iterator(g_gamepath + "/dlc", ec)) + for (auto& file : std::filesystem::directory_iterator(g_gameInstallPath + "/dlc", ec)) { if (file.is_directory()) { @@ -244,7 +244,7 @@ int main(int argc, char *argv[]) HostStartup(); std::filesystem::path modulePath; - bool isGameInstalled = Installer::checkGameInstall(g_gamepath, modulePath); + bool isGameInstalled = Installer::checkGameInstall(g_gameInstallPath, modulePath); bool runInstallerWizard = forceInstaller || forceDLCInstaller || !isGameInstalled; if (runInstallerWizard) { @@ -254,7 +254,7 @@ int main(int argc, char *argv[]) std::_Exit(1); } - if (!InstallerWizard::Run(g_gamepath, isGameInstalled && forceDLCInstaller)) + if (!InstallerWizard::Run(g_gameInstallPath, isGameInstalled && forceDLCInstaller)) { std::_Exit(0); } diff --git a/UnleashedRecomp/mod/mod_loader.cpp b/UnleashedRecomp/mod/mod_loader.cpp index 282238d..da58417 100644 --- a/UnleashedRecomp/mod/mod_loader.cpp +++ b/UnleashedRecomp/mod/mod_loader.cpp @@ -100,7 +100,7 @@ void ModLoader::Init() { configIni = {}; - if (!configIni.read(g_gamepath + "/cpkredir.ini")) + if (!configIni.read(g_gameInstallPath + "/cpkredir.ini")) return; } diff --git a/UnleashedRecomp/user/paths.cpp b/UnleashedRecomp/user/paths.cpp index 633d97c..9a23eb2 100644 --- a/UnleashedRecomp/user/paths.cpp +++ b/UnleashedRecomp/user/paths.cpp @@ -3,7 +3,7 @@ std::filesystem::path g_executableRoot = os::process::GetExecutablePath().remove_filename(); std::filesystem::path g_userPath = BuildUserPath(); -extern const std::string g_gamepath = GetGamePath(); +extern const std::string g_gameInstallPath = GetGamePath(); bool CheckPortable() { diff --git a/UnleashedRecomp/user/paths.h b/UnleashedRecomp/user/paths.h index 118b570..50d8408 100644 --- a/UnleashedRecomp/user/paths.h +++ b/UnleashedRecomp/user/paths.h @@ -23,7 +23,7 @@ inline std::string GetGamePath() bool CheckPortable(); std::filesystem::path BuildUserPath(); const std::filesystem::path& GetUserPath(); -extern const std::string g_gamepath; +extern const std::string g_gameInstallPath; inline std::filesystem::path GetSavePath(bool checkForMods) { From d7d7c208cb0c2c8950db62acc266f8e4b2158cf9 Mon Sep 17 00:00:00 2001 From: Jujstme Date: Mon, 10 Mar 2025 19:19:50 +0100 Subject: [PATCH 3/8] Added Flatpak runtime detection --- UnleashedRecomp/CMakeLists.txt | 11 ----------- UnleashedRecomp/app.cpp | 2 +- UnleashedRecomp/kernel/xam.cpp | 4 ++-- UnleashedRecomp/main.cpp | 10 +++++----- UnleashedRecomp/mod/mod_loader.cpp | 2 +- UnleashedRecomp/user/config.cpp | 4 ++++ UnleashedRecomp/user/config.h | 4 ++++ UnleashedRecomp/user/paths.cpp | 1 + UnleashedRecomp/user/paths.h | 13 ++++++++----- flatpak/io.github.hedge_dev.unleashedrecomp.json | 2 +- 10 files changed, 27 insertions(+), 26 deletions(-) diff --git a/UnleashedRecomp/CMakeLists.txt b/UnleashedRecomp/CMakeLists.txt index 66b60a4..d753a1d 100644 --- a/UnleashedRecomp/CMakeLists.txt +++ b/UnleashedRecomp/CMakeLists.txt @@ -4,10 +4,6 @@ if (WIN32) option(UNLEASHED_RECOMP_D3D12 "Add D3D12 support for rendering" ON) endif() -if (CMAKE_SYSTEM_NAME MATCHES "Linux") - option(UNLEASHED_RECOMP_FLATPAK "Configure the build for Flatpak compatibility." OFF) -endif() - function(BIN2C) cmake_parse_arguments(BIN2C_ARGS "" "TARGET_OBJ;SOURCE_FILE;DEST_FILE;ARRAY_NAME;COMPRESSION_TYPE" "" ${ARGN}) @@ -300,13 +296,6 @@ else() add_executable(UnleashedRecomp ${UNLEASHED_RECOMP_CXX_SOURCES}) endif() -if (UNLEASHED_RECOMP_FLATPAK) - target_compile_definitions(UnleashedRecomp PRIVATE - "UNLEASHED_RECOMP_FLATPAK" - "GAME_INSTALL_DIRECTORY=\"/var/data\"" - ) -endif() - if (UNLEASHED_RECOMP_D3D12) find_package(directx-headers CONFIG REQUIRED) find_package(directx12-agility CONFIG REQUIRED) diff --git a/UnleashedRecomp/app.cpp b/UnleashedRecomp/app.cpp index b298ebc..84d2376 100644 --- a/UnleashedRecomp/app.cpp +++ b/UnleashedRecomp/app.cpp @@ -33,7 +33,7 @@ PPC_FUNC_IMPL(__imp__sub_824EB490); PPC_FUNC(sub_824EB490) { App::s_isInit = true; - App::s_isMissingDLC = !Installer::checkAllDLC(GetGamePath()); + App::s_isMissingDLC = !Installer::checkAllDLC(g_gameInstallPath); App::s_language = Config::Language; SWA::SGlobals::Init(); diff --git a/UnleashedRecomp/kernel/xam.cpp b/UnleashedRecomp/kernel/xam.cpp index 3d7ca77..687df93 100644 --- a/UnleashedRecomp/kernel/xam.cpp +++ b/UnleashedRecomp/kernel/xam.cpp @@ -315,11 +315,11 @@ uint32_t XamContentCreateEx(uint32_t dwUserIndex, const char* szRootName, const } else if (pContentData->dwContentType == XCONTENTTYPE_DLC) { - root = GAME_INSTALL_DIRECTORY "/dlc"; + root = g_gameInstallPath / "dlc"; } else { - root = GAME_INSTALL_DIRECTORY; + root = g_gameInstallPath; } XamRegisterContent(*pContentData, root); diff --git a/UnleashedRecomp/main.cpp b/UnleashedRecomp/main.cpp index a55c018..2186a3a 100644 --- a/UnleashedRecomp/main.cpp +++ b/UnleashedRecomp/main.cpp @@ -61,8 +61,8 @@ void KiSystemStartup() { const auto gameContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Game"); const auto updateContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Update"); - XamRegisterContent(gameContent, GAME_INSTALL_DIRECTORY "/game"); - XamRegisterContent(updateContent, GAME_INSTALL_DIRECTORY "/update"); + XamRegisterContent(gameContent, (g_gameInstallPath / "game").string()); + XamRegisterContent(updateContent, (g_gameInstallPath / "update").string()); const auto saveFilePath = GetSaveFilePath(true); bool saveFileExists = std::filesystem::exists(saveFilePath); @@ -94,7 +94,7 @@ void KiSystemStartup() XamContentCreateEx(0, "D", &gameContent, OPEN_EXISTING, nullptr, nullptr, 0, 0, nullptr); std::error_code ec; - for (auto& file : std::filesystem::directory_iterator(GAME_INSTALL_DIRECTORY "/dlc", ec)) + for (auto& file : std::filesystem::directory_iterator(g_gameInstallPath / "dlc", ec)) { if (file.is_directory()) { @@ -244,7 +244,7 @@ int main(int argc, char *argv[]) HostStartup(); std::filesystem::path modulePath; - bool isGameInstalled = Installer::checkGameInstall(GAME_INSTALL_DIRECTORY, modulePath); + bool isGameInstalled = Installer::checkGameInstall(g_gameInstallPath, modulePath); bool runInstallerWizard = forceInstaller || forceDLCInstaller || !isGameInstalled; if (runInstallerWizard) { @@ -254,7 +254,7 @@ int main(int argc, char *argv[]) std::_Exit(1); } - if (!InstallerWizard::Run(GAME_INSTALL_DIRECTORY, isGameInstalled && forceDLCInstaller)) + if (!InstallerWizard::Run(g_gameInstallPath, isGameInstalled && forceDLCInstaller)) { std::_Exit(0); } diff --git a/UnleashedRecomp/mod/mod_loader.cpp b/UnleashedRecomp/mod/mod_loader.cpp index dd33c56..a6d5eb8 100644 --- a/UnleashedRecomp/mod/mod_loader.cpp +++ b/UnleashedRecomp/mod/mod_loader.cpp @@ -100,7 +100,7 @@ void ModLoader::Init() { configIni = {}; - if (!configIni.read(GAME_INSTALL_DIRECTORY "/cpkredir.ini")) + if (!configIni.read(g_gameInstallPath / "cpkredir.ini")) return; } diff --git a/UnleashedRecomp/user/config.cpp b/UnleashedRecomp/user/config.cpp index dddcf5a..163bc81 100644 --- a/UnleashedRecomp/user/config.cpp +++ b/UnleashedRecomp/user/config.cpp @@ -3,6 +3,10 @@ #include #include +#if defined(__linux__) + const bool g_isRunningUnderFlatpak = getenv("FLATPAK_ID") != nullptr; +#endif + std::vector g_configDefinitions; #define CONFIG_DEFINE_ENUM_TEMPLATE(type) \ diff --git a/UnleashedRecomp/user/config.h b/UnleashedRecomp/user/config.h index 5cda9d9..bf766c6 100644 --- a/UnleashedRecomp/user/config.h +++ b/UnleashedRecomp/user/config.h @@ -2,6 +2,10 @@ #include +#if defined(__linux__) + extern const bool g_isRunningUnderFlatpak; +#endif + class IConfigDef { public: diff --git a/UnleashedRecomp/user/paths.cpp b/UnleashedRecomp/user/paths.cpp index 13a8588..ffb7e5c 100644 --- a/UnleashedRecomp/user/paths.cpp +++ b/UnleashedRecomp/user/paths.cpp @@ -3,6 +3,7 @@ std::filesystem::path g_executableRoot = os::process::GetExecutablePath().remove_filename(); std::filesystem::path g_userPath = BuildUserPath(); +extern const std::filesystem::path g_gameInstallPath = GetGamePath(); bool CheckPortable() { diff --git a/UnleashedRecomp/user/paths.h b/UnleashedRecomp/user/paths.h index c083520..403aca9 100644 --- a/UnleashedRecomp/user/paths.h +++ b/UnleashedRecomp/user/paths.h @@ -1,23 +1,26 @@ #pragma once #include +#include "config.h" #define USER_DIRECTORY "UnleashedRecomp" -#ifndef GAME_INSTALL_DIRECTORY -#define GAME_INSTALL_DIRECTORY "." -#endif - extern std::filesystem::path g_executableRoot; inline std::filesystem::path GetGamePath() { - return GAME_INSTALL_DIRECTORY; +#if defined(__linux__) + if (g_isRunningUnderFlatpak) + return "/var/data"; + else +#endif + return "."; } bool CheckPortable(); std::filesystem::path BuildUserPath(); const std::filesystem::path& GetUserPath(); +extern const std::filesystem::path g_gameInstallPath; inline std::filesystem::path GetSavePath(bool checkForMods) { diff --git a/flatpak/io.github.hedge_dev.unleashedrecomp.json b/flatpak/io.github.hedge_dev.unleashedrecomp.json index f6ae932..34926b5 100644 --- a/flatpak/io.github.hedge_dev.unleashedrecomp.json +++ b/flatpak/io.github.hedge_dev.unleashedrecomp.json @@ -20,7 +20,7 @@ "name": "UnleashedRecomp", "buildsystem": "simple", "build-commands": [ - "cmake --preset linux-release -DUNLEASHED_RECOMP_FLATPAK=ON -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache", + "cmake --preset linux-release -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache", "cmake --build out/build/linux-release --target UnleashedRecomp", "mkdir -p /app/bin", "cp out/build/linux-release/UnleashedRecomp/UnleashedRecomp /app/bin/UnleashedRecomp", From e71a8bc13a7f39f35c277cb5f53bf2fd51da616a Mon Sep 17 00:00:00 2001 From: Jujstme Date: Mon, 10 Mar 2025 20:01:49 +0100 Subject: [PATCH 4/8] Revert "Merge branch 'main' into workingdir" This reverts commit 44effe4f64a0a6ed013e25b0d0a7eb0b2eca1ff8, reversing changes made to d7d7c208cb0c2c8950db62acc266f8e4b2158cf9. --- README.md | 14 -------------- UnleashedRecomp/user/paths.h | 7 +------ 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/README.md b/README.md index eb329ee..abf1a3d 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,3 @@ -> [!WARNING] -> This repository is a fork of the Unleashed Recompiled project, specifically designed to support binary Arch Linux packaging through the AUR and the PKGBUILD system. For Windows builds, please refer to the upstream repository. -> **Do not attempt to compile the content of this repository with Windows targets**. -> Please be also aware this package, unlike the Flatpak version provided upstream, may not be compatible with the Hedgemod Manager differently from the Flatpak version provided upstream. - -Binaries from this repository are built using: - -``` -$ cmake -DCMAKE_AR=/usr/bin/llvm-ar -DCMAKE_RANLIB=/usr/bin/llvm-ranlib . --preset linux-release -$ cmake --build ./out/build/linux-release --target UnleashedRecomp -``` - ---- -

diff --git a/UnleashedRecomp/user/paths.h b/UnleashedRecomp/user/paths.h index d52443e..403aca9 100644 --- a/UnleashedRecomp/user/paths.h +++ b/UnleashedRecomp/user/paths.h @@ -14,12 +14,7 @@ inline std::filesystem::path GetGamePath() return "/var/data"; else #endif - const char* homeDir = getenv("HOME"); - if (homeDir == nullptr) - return g_executableRoot; - std::filesystem::path homePath = homeDir; - std::filesystem::path gamePath = homePath / ".local" / "share" / USER_DIRECTORY; - return gamePath; + return "."; } bool CheckPortable(); From b69ce62a5d551fe02a8c342e983dbfca9a135fdf Mon Sep 17 00:00:00 2001 From: Jujstme Date: Wed, 19 Mar 2025 23:21:42 +0100 Subject: [PATCH 5/8] Apply suggestion --- .vscode/settings.json | 5 +++++ UnleashedRecomp/main.cpp | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d8cb326 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "string": "cpp" + } +} \ No newline at end of file diff --git a/UnleashedRecomp/main.cpp b/UnleashedRecomp/main.cpp index 2186a3a..b27a89d 100644 --- a/UnleashedRecomp/main.cpp +++ b/UnleashedRecomp/main.cpp @@ -61,8 +61,12 @@ void KiSystemStartup() { const auto gameContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Game"); const auto updateContent = XamMakeContent(XCONTENTTYPE_RESERVED, "Update"); - XamRegisterContent(gameContent, (g_gameInstallPath / "game").string()); - XamRegisterContent(updateContent, (g_gameInstallPath / "update").string()); + + std::u8string gamePathU8 = (g_gameInstallPath / "game").u8string(); + std::u8string updatePathU8 = (g_gameInstallPath / "update").u8string(); + + XamRegisterContent(gameContent, (const char*)(gamePathU8.c_str())); + XamRegisterContent(updateContent, (const char*)(updatePathU8.c_str())); const auto saveFilePath = GetSaveFilePath(true); bool saveFileExists = std::filesystem::exists(saveFilePath); From 90c5795a18e4b4d6b3b35af820f4c3a60fd74644 Mon Sep 17 00:00:00 2001 From: Jujstme Date: Wed, 19 Mar 2025 23:24:00 +0100 Subject: [PATCH 6/8] Deleting file that shouldn't be committed --- .vscode/settings.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index d8cb326..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "files.associations": { - "string": "cpp" - } -} \ No newline at end of file From 026a161bda4f3777d68d32c0983eed68e8581a8e Mon Sep 17 00:00:00 2001 From: Jujstme Date: Sat, 22 Mar 2025 10:20:33 +0100 Subject: [PATCH 7/8] Applied suggestion to check for the `./flatpak-info` file --- UnleashedRecomp/user/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnleashedRecomp/user/config.cpp b/UnleashedRecomp/user/config.cpp index 163bc81..cf2836b 100644 --- a/UnleashedRecomp/user/config.cpp +++ b/UnleashedRecomp/user/config.cpp @@ -4,7 +4,7 @@ #include #if defined(__linux__) - const bool g_isRunningUnderFlatpak = getenv("FLATPAK_ID") != nullptr; + const bool g_isRunningUnderFlatpak = std::filesystem::exists("/.flatpak-info"); #endif std::vector g_configDefinitions; From ceeb831436419741921f1f56468b135ab04a572e Mon Sep 17 00:00:00 2001 From: Jujstme Date: Sun, 23 Mar 2025 16:40:39 +0100 Subject: [PATCH 8/8] Update UnleashedRecomp/user/config.cpp Co-authored-by: Skyth (Asilkan) <19259897+blueskythlikesclouds@users.noreply.github.com> --- UnleashedRecomp/user/config.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UnleashedRecomp/user/config.cpp b/UnleashedRecomp/user/config.cpp index cf2836b..dc5a3cf 100644 --- a/UnleashedRecomp/user/config.cpp +++ b/UnleashedRecomp/user/config.cpp @@ -4,7 +4,11 @@ #include #if defined(__linux__) - const bool g_isRunningUnderFlatpak = std::filesystem::exists("/.flatpak-info"); + const bool g_isRunningUnderFlatpak = []() + { + std::error_code ec; + return std::filesystem::exists("/.flatpak-info", ec); + }(); #endif std::vector g_configDefinitions;