diff --git a/UnleashedRecomp/CMakeLists.txt b/UnleashedRecomp/CMakeLists.txt index 7fbe7d8..d21f07e 100644 --- a/UnleashedRecomp/CMakeLists.txt +++ b/UnleashedRecomp/CMakeLists.txt @@ -87,16 +87,8 @@ set(SWA_LOCALE_CXX_SOURCES "locale/locale.cpp" ) -set(SWA_OS_CXX_SOURCES - "os/logger.cpp" - "os/media.cpp" - "os/process.cpp" - "os/user.cpp" - "os/version.cpp" -) - if (WIN32) - list(APPEND SWA_OS_CXX_SOURCES + set(SWA_OS_CXX_SOURCES "os/win32/logger_win32.cpp" "os/win32/media_win32.cpp" "os/win32/process_win32.cpp" @@ -104,7 +96,7 @@ if (WIN32) "os/win32/version_win32.cpp" ) elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") - list(APPEND SWA_OS_CXX_SOURCES + set(SWA_OS_CXX_SOURCES "os/linux/logger_linux.cpp" "os/linux/media_linux.cpp" "os/linux/process_linux.cpp" diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index 28c74f3..fa1c20f 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -3017,7 +3017,7 @@ static void SetTexture(GuestDevice* device, uint32_t index, GuestTexture* textur auto isPlayStation = Config::ControllerIcons == EControllerIcons::PlayStation; if (Config::ControllerIcons == EControllerIcons::Auto) - isPlayStation = hid::detail::g_inputDeviceController == hid::detail::EInputDevice::PlayStation; + isPlayStation = hid::g_inputDeviceController == hid::EInputDevice::PlayStation; if (isPlayStation && texture != nullptr && texture->patchedTexture != nullptr) texture = texture->patchedTexture.get(); diff --git a/UnleashedRecomp/hid/driver/sdl_hid.cpp b/UnleashedRecomp/hid/driver/sdl_hid.cpp index 76e8f9a..983eb85 100644 --- a/UnleashedRecomp/hid/driver/sdl_hid.cpp +++ b/UnleashedRecomp/hid/driver/sdl_hid.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -40,17 +40,17 @@ public: return SDL_GameControllerTypeForIndex(index); } - hid::detail::EInputDevice GetInputDevice() const + hid::EInputDevice GetInputDevice() const { switch (GetControllerType()) { case SDL_CONTROLLER_TYPE_PS3: case SDL_CONTROLLER_TYPE_PS4: case SDL_CONTROLLER_TYPE_PS5: - return hid::detail::EInputDevice::PlayStation; + return hid::EInputDevice::PlayStation; } - return hid::detail::EInputDevice::Xbox; + return hid::EInputDevice::Xbox; } void Close() @@ -168,8 +168,8 @@ static void SetControllerInputDevice(Controller* controller) if (App::s_isLoading) return; - hid::detail::g_inputDevice = controller->GetInputDevice(); - hid::detail::g_inputDeviceController = hid::detail::g_inputDevice; + hid::g_inputDevice = controller->GetInputDevice(); + hid::g_inputDeviceController = hid::g_inputDevice; } int HID_OnSDLEvent(void*, SDL_Event* event) @@ -224,13 +224,13 @@ int HID_OnSDLEvent(void*, SDL_Event* event) case SDL_KEYDOWN: case SDL_KEYUP: - hid::detail::g_inputDevice = hid::detail::EInputDevice::Keyboard; + hid::g_inputDevice = hid::EInputDevice::Keyboard; break; case SDL_MOUSEMOTION: case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: - hid::detail::g_inputDevice = hid::detail::EInputDevice::Mouse; + hid::g_inputDevice = hid::EInputDevice::Mouse; break; case SDL_WINDOWEVENT: @@ -266,7 +266,7 @@ int HID_OnSDLEvent(void*, SDL_Event* event) return 0; } -void hid::detail::Init() +void hid::Init() { SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS3, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1"); @@ -282,7 +282,7 @@ void hid::detail::Init() SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER); } -uint32_t hid::detail::GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState) +uint32_t hid::GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState) { static uint32_t packet; @@ -301,7 +301,7 @@ uint32_t hid::detail::GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState) return ERROR_SUCCESS; } -uint32_t hid::detail::SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration) +uint32_t hid::SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration) { if (!pVibration) return ERROR_BAD_ARGUMENTS; @@ -314,7 +314,7 @@ uint32_t hid::detail::SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibrat return ERROR_SUCCESS; } -uint32_t hid::detail::GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps) +uint32_t hid::GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps) { if (!pCaps) return ERROR_BAD_ARGUMENTS; diff --git a/UnleashedRecomp/hid/hid.cpp b/UnleashedRecomp/hid/hid.cpp index 7bc58af..07ca9c4 100644 --- a/UnleashedRecomp/hid/hid.cpp +++ b/UnleashedRecomp/hid/hid.cpp @@ -1,39 +1,17 @@ -#include #include "hid.h" -#include "hid_detail.h" -hid::detail::EInputDevice hid::detail::g_inputDevice; -hid::detail::EInputDevice hid::detail::g_inputDeviceController; +hid::EInputDevice hid::g_inputDevice; +hid::EInputDevice hid::g_inputDeviceController; -uint16_t hid::detail::g_prohibitedButtons; - -void hid::Init() -{ - detail::Init(); -} +uint16_t hid::g_prohibitedButtons; void hid::SetProhibitedButtons(uint16_t wButtons) { - hid::detail::g_prohibitedButtons = wButtons; + hid::g_prohibitedButtons = wButtons; } -uint32_t hid::GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState) +bool hid::IsInputDeviceController() { - return detail::GetState(dwUserIndex, pState); -} - -uint32_t hid::SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration) -{ - return detail::SetState(dwUserIndex, pVibration); -} - -uint32_t hid::GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps) -{ - return detail::GetCapabilities(dwUserIndex, pCaps); -} - -bool hid::detail::IsInputDeviceController() -{ - return hid::detail::g_inputDevice != hid::detail::EInputDevice::Keyboard && - hid::detail::g_inputDevice != hid::detail::EInputDevice::Mouse; + return hid::g_inputDevice != hid::EInputDevice::Keyboard && + hid::g_inputDevice != hid::EInputDevice::Mouse; } diff --git a/UnleashedRecomp/hid/hid.h b/UnleashedRecomp/hid/hid.h index b8c2a9a..d9bf21d 100644 --- a/UnleashedRecomp/hid/hid.h +++ b/UnleashedRecomp/hid/hid.h @@ -1,13 +1,26 @@ #pragma once -union SDL_Event; - namespace hid { + enum class EInputDevice + { + Keyboard, + Mouse, + Xbox, + PlayStation + }; + + extern EInputDevice g_inputDevice; + extern EInputDevice g_inputDeviceController; + + extern uint16_t g_prohibitedButtons; + void Init(); void SetProhibitedButtons(uint16_t wButtons); uint32_t GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState); uint32_t SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration); uint32_t GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps); + + bool IsInputDeviceController(); } diff --git a/UnleashedRecomp/hid/hid_detail.h b/UnleashedRecomp/hid/hid_detail.h deleted file mode 100644 index 892e7ab..0000000 --- a/UnleashedRecomp/hid/hid_detail.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -namespace hid::detail -{ - enum class EInputDevice - { - Keyboard, - Mouse, - Xbox, - PlayStation - }; - - extern EInputDevice g_inputDevice; - extern EInputDevice g_inputDeviceController; - - extern uint16_t g_prohibitedButtons; - - void Init(); - - uint32_t GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState); - uint32_t SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration); - uint32_t GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps); - - bool IsInputDeviceController(); -} diff --git a/UnleashedRecomp/kernel/xam.cpp b/UnleashedRecomp/kernel/xam.cpp index ac68e9a..80a0a5a 100644 --- a/UnleashedRecomp/kernel/xam.cpp +++ b/UnleashedRecomp/kernel/xam.cpp @@ -2,7 +2,6 @@ #include "xam.h" #include "xdm.h" #include -#include #include #include #include @@ -455,7 +454,7 @@ uint32_t XamInputGetState(uint32_t userIndex, uint32_t flags, XAMINPUT_STATE* st state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_Y; } - state->Gamepad.wButtons &= ~hid::detail::g_prohibitedButtons; + state->Gamepad.wButtons &= ~hid::g_prohibitedButtons; ByteSwapInplace(state->Gamepad.wButtons); ByteSwapInplace(state->Gamepad.sThumbLX); @@ -468,7 +467,7 @@ uint32_t XamInputGetState(uint32_t userIndex, uint32_t flags, XAMINPUT_STATE* st uint32_t XamInputSetState(uint32_t userIndex, uint32_t flags, XAMINPUT_VIBRATION* vibration) { - if (!hid::detail::IsInputDeviceController() || !Config::Vibration) + if (!hid::IsInputDeviceController() || !Config::Vibration) return ERROR_SUCCESS; ByteSwapInplace(vibration->wLeftMotorSpeed); diff --git a/UnleashedRecomp/os/linux/logger_linux.cpp b/UnleashedRecomp/os/linux/logger_linux.cpp index 910307b..df5708d 100644 --- a/UnleashedRecomp/os/linux/logger_linux.cpp +++ b/UnleashedRecomp/os/linux/logger_linux.cpp @@ -1,10 +1,10 @@ -#include +#include -void os::logger::detail::Init() +void os::logger::Init() { } -void os::logger::detail::Log(const std::string_view str, detail::ELogType type, const char* func) +void os::logger::Log(const std::string_view str, ELogType type, const char* func) { if (func) { diff --git a/UnleashedRecomp/os/linux/media_linux.cpp b/UnleashedRecomp/os/linux/media_linux.cpp index 74ec996..9fc19b0 100644 --- a/UnleashedRecomp/os/linux/media_linux.cpp +++ b/UnleashedRecomp/os/linux/media_linux.cpp @@ -1,6 +1,6 @@ -#include +#include -bool os::media::detail::IsExternalMediaPlaying() +bool os::media::IsExternalMediaPlaying() { // This functionality is not supported in Linux. return false; diff --git a/UnleashedRecomp/os/linux/process_linux.cpp b/UnleashedRecomp/os/linux/process_linux.cpp index ed02c9e..20f88e4 100644 --- a/UnleashedRecomp/os/linux/process_linux.cpp +++ b/UnleashedRecomp/os/linux/process_linux.cpp @@ -1,8 +1,8 @@ -#include +#include #include -std::filesystem::path os::process::detail::GetExecutablePath() +std::filesystem::path os::process::GetExecutablePath() { char exePath[PATH_MAX] = {}; if (readlink("/proc/self/exe", exePath, PATH_MAX) > 0) @@ -15,7 +15,7 @@ std::filesystem::path os::process::detail::GetExecutablePath() } } -std::filesystem::path os::process::detail::GetWorkingDirectory() +std::filesystem::path os::process::GetWorkingDirectory() { char cwd[PATH_MAX] = {}; char *res = getcwd(cwd, sizeof(cwd)); @@ -29,7 +29,7 @@ std::filesystem::path os::process::detail::GetWorkingDirectory() } } -bool os::process::detail::StartProcess(const std::filesystem::path path, const std::vector args, std::filesystem::path work) +bool os::process::StartProcess(const std::filesystem::path& path, const std::vector& args, std::filesystem::path work) { pid_t pid = fork(); if (pid < 0) diff --git a/UnleashedRecomp/os/linux/user_linux.cpp b/UnleashedRecomp/os/linux/user_linux.cpp index b9c4034..a9679df 100644 --- a/UnleashedRecomp/os/linux/user_linux.cpp +++ b/UnleashedRecomp/os/linux/user_linux.cpp @@ -1,6 +1,6 @@ -#include +#include -bool os::user::detail::IsDarkTheme() +bool os::user::IsDarkTheme() { return false; } diff --git a/UnleashedRecomp/os/linux/version_linux.cpp b/UnleashedRecomp/os/linux/version_linux.cpp index 17b5b12..381b5c4 100644 --- a/UnleashedRecomp/os/linux/version_linux.cpp +++ b/UnleashedRecomp/os/linux/version_linux.cpp @@ -1,7 +1,7 @@ -#include +#include -os::version::detail::OSVersion os::version::detail::GetOSVersion() +os::version::OSVersion os::version::GetOSVersion() { assert(false && "Unimplemented."); - return os::version::detail::OSVersion(); + return os::version::OSVersion(); } diff --git a/UnleashedRecomp/os/logger.cpp b/UnleashedRecomp/os/logger.cpp deleted file mode 100644 index 42c25ac..0000000 --- a/UnleashedRecomp/os/logger.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - -void os::logger::Init() -{ - detail::Init(); -} - -void os::logger::Log(const std::string_view str, detail::ELogType type, const char* func) -{ - detail::Log(str, type, func); -} diff --git a/UnleashedRecomp/os/logger.h b/UnleashedRecomp/os/logger.h index 66793d0..707ca39 100644 --- a/UnleashedRecomp/os/logger.h +++ b/UnleashedRecomp/os/logger.h @@ -1,9 +1,9 @@ #pragma once -#include +#include -#define LOG_IMPL(type, func, str) os::logger::Log(str, os::logger::detail::ELogType::type, func) -#define LOGF_IMPL(type, func, str, ...) os::logger::Log(fmt::format(str, __VA_ARGS__), os::logger::detail::ELogType::type, func) +#define LOG_IMPL(type, func, str) os::logger::Log(str, os::logger::ELogType::type, func) +#define LOGF_IMPL(type, func, str, ...) os::logger::Log(fmt::format(str, __VA_ARGS__), os::logger::ELogType::type, func) // Function-specific logging. @@ -51,6 +51,14 @@ namespace os::logger { + enum class ELogType + { + None, + Utility, + Warning, + Error + }; + void Init(); - void Log(const std::string_view str, detail::ELogType type = detail::ELogType::None, const char* func = nullptr); + void Log(const std::string_view str, ELogType type = ELogType::None, const char* func = nullptr); } diff --git a/UnleashedRecomp/os/logger_detail.h b/UnleashedRecomp/os/logger_detail.h deleted file mode 100644 index e0da89b..0000000 --- a/UnleashedRecomp/os/logger_detail.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include - -namespace os::logger::detail -{ - enum class ELogType - { - None, - Utility, - Warning, - Error - }; - - void Init(); - void Log(const std::string_view str, ELogType type = ELogType::None, const char* func = nullptr); -} diff --git a/UnleashedRecomp/os/media.cpp b/UnleashedRecomp/os/media.cpp deleted file mode 100644 index 40d2b97..0000000 --- a/UnleashedRecomp/os/media.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -bool os::media::IsExternalMediaPlaying() -{ - return detail::IsExternalMediaPlaying(); -} diff --git a/UnleashedRecomp/os/media_detail.h b/UnleashedRecomp/os/media_detail.h deleted file mode 100644 index 9f66096..0000000 --- a/UnleashedRecomp/os/media_detail.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -namespace os::media::detail -{ - bool IsExternalMediaPlaying(); -} diff --git a/UnleashedRecomp/os/process.cpp b/UnleashedRecomp/os/process.cpp deleted file mode 100644 index bfad676..0000000 --- a/UnleashedRecomp/os/process.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -std::filesystem::path os::process::GetExecutablePath() -{ - return detail::GetExecutablePath(); -} - -std::filesystem::path os::process::GetWorkingDirectory() -{ - return detail::GetWorkingDirectory(); -} - -bool os::process::StartProcess(const std::filesystem::path path, const std::vector args, std::filesystem::path work) -{ - return detail::StartProcess(path, args, work); -} diff --git a/UnleashedRecomp/os/process.h b/UnleashedRecomp/os/process.h index d9af717..3ddf4fc 100644 --- a/UnleashedRecomp/os/process.h +++ b/UnleashedRecomp/os/process.h @@ -4,5 +4,5 @@ namespace os::process { std::filesystem::path GetExecutablePath(); std::filesystem::path GetWorkingDirectory(); - bool StartProcess(const std::filesystem::path path, const std::vector args, std::filesystem::path work = {}); + bool StartProcess(const std::filesystem::path& path, const std::vector& args, std::filesystem::path work = {}); } diff --git a/UnleashedRecomp/os/process_detail.h b/UnleashedRecomp/os/process_detail.h deleted file mode 100644 index e4a7a45..0000000 --- a/UnleashedRecomp/os/process_detail.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -namespace os::process::detail -{ - std::filesystem::path GetExecutablePath(); - std::filesystem::path GetWorkingDirectory(); - bool StartProcess(const std::filesystem::path path, const std::vector args, std::filesystem::path work = {}); -} diff --git a/UnleashedRecomp/os/user.cpp b/UnleashedRecomp/os/user.cpp deleted file mode 100644 index 530bbb1..0000000 --- a/UnleashedRecomp/os/user.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -bool os::user::IsDarkTheme() -{ - return detail::IsDarkTheme(); -} diff --git a/UnleashedRecomp/os/user_detail.h b/UnleashedRecomp/os/user_detail.h deleted file mode 100644 index bb81f25..0000000 --- a/UnleashedRecomp/os/user_detail.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -namespace os::user::detail -{ - bool IsDarkTheme(); -} diff --git a/UnleashedRecomp/os/version.cpp b/UnleashedRecomp/os/version.cpp deleted file mode 100644 index 7691d9d..0000000 --- a/UnleashedRecomp/os/version.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -os::version::detail::OSVersion os::version::GetOSVersion() -{ - return detail::GetOSVersion(); -} diff --git a/UnleashedRecomp/os/version.h b/UnleashedRecomp/os/version.h index 398b7ee..6cf6273 100644 --- a/UnleashedRecomp/os/version.h +++ b/UnleashedRecomp/os/version.h @@ -1,8 +1,13 @@ #pragma once -#include - namespace os::version { - detail::OSVersion GetOSVersion(); + struct OSVersion + { + uint32_t Major{}; + uint32_t Minor{}; + uint32_t Build{}; + }; + + OSVersion GetOSVersion(); } diff --git a/UnleashedRecomp/os/version_detail.h b/UnleashedRecomp/os/version_detail.h deleted file mode 100644 index 8c16c98..0000000 --- a/UnleashedRecomp/os/version_detail.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -namespace os::version::detail -{ - struct OSVersion - { - uint32_t Major{}; - uint32_t Minor{}; - uint32_t Build{}; - }; - - OSVersion GetOSVersion(); -} diff --git a/UnleashedRecomp/os/win32/logger_win32.cpp b/UnleashedRecomp/os/win32/logger_win32.cpp index b95011a..88ed83d 100644 --- a/UnleashedRecomp/os/win32/logger_win32.cpp +++ b/UnleashedRecomp/os/win32/logger_win32.cpp @@ -1,17 +1,16 @@ -#include -#include +#include #define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE) #define FOREGROUND_YELLOW (FOREGROUND_RED | FOREGROUND_GREEN) HANDLE g_hStandardOutput; -void os::logger::detail::Init() +void os::logger::Init() { g_hStandardOutput = GetStdHandle(STD_OUTPUT_HANDLE); } -void os::logger::detail::Log(const std::string_view str, detail::ELogType type, const char* func) +void os::logger::Log(const std::string_view str, ELogType type, const char* func) { switch (type) { diff --git a/UnleashedRecomp/os/win32/media_win32.cpp b/UnleashedRecomp/os/win32/media_win32.cpp index c6e77a5..1f3d583 100644 --- a/UnleashedRecomp/os/win32/media_win32.cpp +++ b/UnleashedRecomp/os/win32/media_win32.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -62,7 +62,7 @@ static GlobalSystemMediaTransportControlsSessionPlaybackInfo GetPlaybackInfo() } } -bool os::media::detail::IsExternalMediaPlaying() +bool os::media::IsExternalMediaPlaying() { auto playbackInfo = GetPlaybackInfo(); diff --git a/UnleashedRecomp/os/win32/process_win32.cpp b/UnleashedRecomp/os/win32/process_win32.cpp index 5e7a567..fe7e5be 100644 --- a/UnleashedRecomp/os/win32/process_win32.cpp +++ b/UnleashedRecomp/os/win32/process_win32.cpp @@ -1,6 +1,6 @@ -#include +#include -std::filesystem::path os::process::detail::GetExecutablePath() +std::filesystem::path os::process::GetExecutablePath() { WCHAR exePath[MAX_PATH]; @@ -10,7 +10,7 @@ std::filesystem::path os::process::detail::GetExecutablePath() return std::filesystem::path(exePath); } -std::filesystem::path os::process::detail::GetWorkingDirectory() +std::filesystem::path os::process::GetWorkingDirectory() { WCHAR workPath[MAX_PATH]; @@ -20,7 +20,7 @@ std::filesystem::path os::process::detail::GetWorkingDirectory() return std::filesystem::path(workPath); } -bool os::process::detail::StartProcess(const std::filesystem::path path, const std::vector args, std::filesystem::path work) +bool os::process::StartProcess(const std::filesystem::path& path, const std::vector& args, std::filesystem::path work) { if (path.empty()) return false; diff --git a/UnleashedRecomp/os/win32/user_win32.cpp b/UnleashedRecomp/os/win32/user_win32.cpp index 9fd2bdb..2bd997a 100644 --- a/UnleashedRecomp/os/win32/user_win32.cpp +++ b/UnleashedRecomp/os/win32/user_win32.cpp @@ -1,6 +1,6 @@ -#include +#include -bool os::user::detail::IsDarkTheme() +bool os::user::IsDarkTheme() { HKEY hKey; diff --git a/UnleashedRecomp/os/win32/version_win32.cpp b/UnleashedRecomp/os/win32/version_win32.cpp index 79e7bfa..ad5d711 100644 --- a/UnleashedRecomp/os/win32/version_win32.cpp +++ b/UnleashedRecomp/os/win32/version_win32.cpp @@ -1,10 +1,10 @@ -#include +#include LIB_FUNCTION(LONG, "ntdll.dll", RtlGetVersion, PRTL_OSVERSIONINFOW); -os::version::detail::OSVersion os::version::detail::GetOSVersion() +os::version::OSVersion os::version::GetOSVersion() { - auto result = os::version::detail::OSVersion{}; + auto result = os::version::OSVersion{}; OSVERSIONINFOEXW osvi = { 0 }; osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); diff --git a/UnleashedRecomp/patches/resident_patches.cpp b/UnleashedRecomp/patches/resident_patches.cpp index 31574e4..592e0cb 100644 --- a/UnleashedRecomp/patches/resident_patches.cpp +++ b/UnleashedRecomp/patches/resident_patches.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include bool m_isSavedAchievementData = false; @@ -133,7 +133,7 @@ void LoadingScreenControllerMidAsmHook() auto isPlayStation = Config::ControllerIcons == EControllerIcons::PlayStation; if (Config::ControllerIcons == EControllerIcons::Auto) - isPlayStation = hid::detail::g_inputDeviceController == hid::detail::EInputDevice::PlayStation; + isPlayStation = hid::g_inputDeviceController == hid::EInputDevice::PlayStation; const char* prefix = isPlayStation ? "ps3" : "360"; diff --git a/UnleashedRecomp/ui/button_guide.cpp b/UnleashedRecomp/ui/button_guide.cpp index 098645e..3318cdd 100644 --- a/UnleashedRecomp/ui/button_guide.cpp +++ b/UnleashedRecomp/ui/button_guide.cpp @@ -2,7 +2,7 @@ #include "imgui_utils.h" #include #include -#include +#include #include #include #include @@ -63,7 +63,7 @@ std::tuple, GuestTexture*> GetButtonIcon(EButtonIcon GuestTexture* texture; auto isPlayStation = Config::ControllerIcons == EControllerIcons::Auto - ? hid::detail::g_inputDeviceController == hid::detail::EInputDevice::PlayStation + ? hid::g_inputDeviceController == hid::EInputDevice::PlayStation : Config::ControllerIcons == EControllerIcons::PlayStation; auto yOffsetCmn = isPlayStation ? 42 : 0; diff --git a/UnleashedRecomp/ui/installer_wizard.cpp b/UnleashedRecomp/ui/installer_wizard.cpp index 230e999..7ab9c6c 100644 --- a/UnleashedRecomp/ui/installer_wizard.cpp +++ b/UnleashedRecomp/ui/installer_wizard.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -729,9 +728,9 @@ static void DrawDescriptionContainer() if (g_currentPage != WizardPage::Installing && textAlpha >= 1.0) { - auto icon = hid::detail::IsInputDeviceController() + auto icon = hid::IsInputDeviceController() ? EButtonIcon::A - : hid::detail::g_inputDevice == hid::detail::EInputDevice::Keyboard + : hid::g_inputDevice == hid::EInputDevice::Keyboard ? EButtonIcon::Enter : EButtonIcon::LMB; diff --git a/UnleashedRecomp/ui/message_window.cpp b/UnleashedRecomp/ui/message_window.cpp index b089373..3c3f7f0 100644 --- a/UnleashedRecomp/ui/message_window.cpp +++ b/UnleashedRecomp/ui/message_window.cpp @@ -2,7 +2,7 @@ #include "imgui_utils.h" #include #include -#include +#include #include #include #include @@ -257,7 +257,7 @@ static void ResetSelection() { /* Always use -1 for mouse input to prevent the selection cursor from erroneously appearing where it shouldn't. */ - g_selectedRowIndex = hid::detail::g_inputDevice == hid::detail::EInputDevice::Mouse + g_selectedRowIndex = hid::g_inputDevice == hid::EInputDevice::Mouse ? -1 : g_defaultButtonIndex; @@ -294,8 +294,8 @@ void MessageWindow::Draw() auto textMarginX = Scale(37); auto textMarginY = Scale(45); - bool isController = hid::detail::IsInputDeviceController(); - bool isKeyboard = hid::detail::g_inputDevice == hid::detail::EInputDevice::Keyboard; + bool isController = hid::IsInputDeviceController(); + bool isKeyboard = hid::g_inputDevice == hid::EInputDevice::Keyboard; // Handle controller input when the game is booted. if (App::s_isInit)