From ef1ce59931faed220e8dbf760bb74436f31eef74 Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Fri, 2 Sep 2022 20:54:22 +0200 Subject: [PATCH 1/2] Update graphic pack url query request (#154) Fixed bad request url and changed URL to separate post 2.0 releases. Also updated .gitignore --- .gitignore | 5 ++++- src/gui/DownloadGraphicPacksWindow.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index cdf32796..1fe47b70 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ bin/Cemu # Cemu bin files bin/otp.bin bin/seeprom.bin +bin/log.txt bin/Cemu.pdb bin/Cemu.ilk bin/Cemu.exe.backup @@ -35,4 +36,6 @@ bin/shaderCache/* bin/controllerProfiles/* !bin/gameProfiles/default/* -bin/gameProfiles/* \ No newline at end of file +bin/gameProfiles/* + +bin/graphicPacks/* diff --git a/src/gui/DownloadGraphicPacksWindow.cpp b/src/gui/DownloadGraphicPacksWindow.cpp index 651f7399..35f25225 100644 --- a/src/gui/DownloadGraphicPacksWindow.cpp +++ b/src/gui/DownloadGraphicPacksWindow.cpp @@ -121,9 +121,9 @@ void DownloadGraphicPacksWindow::UpdateThread() // get github url std::string githubAPIUrl; curlDownloadFileState_t tempDownloadState; - std::string queryUrl("http://cemu.info/api/query_graphicpack_url_1_17_0.php?"); + std::string queryUrl("https://cemu.info/api2/query_graphicpack_url.php?"); char temp[64]; - sprintf(temp, "version=%d.%d.%d%s", EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR, EMULATOR_VERSION_MINOR, EMULATOR_VERSION_SUFFIX); + sprintf(temp, "version=%d.%d.%d", EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR, EMULATOR_VERSION_MINOR); queryUrl.append(temp); queryUrl.append("&"); sprintf(temp, "t=%u", (uint32)std::chrono::seconds(std::time(NULL)).count()); // add a dynamic part to the url to bypass overly aggressive caching (like some proxies do) From 8c617a39b78bc44439579b5647eb728bffda90a1 Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Fri, 2 Sep 2022 21:06:05 +0200 Subject: [PATCH 2/2] style: use std::enable_if & co instead of boost:: (#153) --- src/Common/betype.h | 10 +++++----- src/config/ConfigValue.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Common/betype.h b/src/Common/betype.h index 62762da4..e684fb93 100644 --- a/src/Common/betype.h +++ b/src/Common/betype.h @@ -22,7 +22,7 @@ constexpr T bswap(T i) template constexpr T SwapEndian(T value) { - if constexpr (boost::is_integral::value) + if constexpr (std::is_integral::value) { #ifdef _MSC_VER if constexpr (sizeof(T) == sizeof(uint32_t)) @@ -33,7 +33,7 @@ constexpr T SwapEndian(T value) return (T)bswap((std::make_unsigned_t)value); } - else if constexpr (boost::is_floating_point::value) + else if constexpr (std::is_floating_point::value) { if constexpr (sizeof(T) == sizeof(uint32_t)) { @@ -46,18 +46,18 @@ constexpr T SwapEndian(T value) return *(T*)&tmp; } } - else if constexpr (boost::is_enum::value) + else if constexpr (std::is_enum::value) { return (T)SwapEndian((std::underlying_type_t)value); } - else if constexpr (boost::is_base_of::value) + else if constexpr (std::is_base_of::value) { const auto tmp = bswap(*(uint32_t*)&value); return *(T*)&tmp; } else { - static_assert(boost::is_integral::value, "unsupported betype specialization!"); + static_assert(std::is_integral::value, "unsupported betype specialization!"); } return value; diff --git a/src/config/ConfigValue.h b/src/config/ConfigValue.h index b53992de..11fc1e48 100644 --- a/src/config/ConfigValue.h +++ b/src/config/ConfigValue.h @@ -96,14 +96,14 @@ public: m_value = v; } - template >> + template >> void SetValue(std::string_view v) { std::lock_guard lock(m_mutex); m_value = v; } - template >> + template >> void SetValue(std::wstring_view v) { std::lock_guard lock(m_mutex); @@ -171,21 +171,21 @@ public: } // init from enum with iterators - template::value && EnableEnumIterators::enable, TType>> + template::value && EnableEnumIterators::enable, TType>> constexpr ConfigValueBounds() : base_type(), m_min_value(begin(TEnum{})), m_max_value(rbegin(TEnum{})) { assert(m_min_value <= this->GetInitValue() && this->GetInitValue() <= m_max_value); } - template::value && EnableEnumIterators::enable, TType>> + template::value && EnableEnumIterators::enable, TType>> constexpr ConfigValueBounds(const TType& init_value) : base_type(std::forward(init_value)), m_min_value(begin(init_value)), m_max_value(rbegin(init_value)) { assert(m_min_value <= init_value && init_value <= m_max_value); } - template::value && EnableEnumIterators::enable, TType>> + template::value && EnableEnumIterators::enable, TType>> constexpr ConfigValueBounds(TType&& init_value) : base_type(std::forward(init_value)), m_min_value(begin(init_value)), m_max_value(rbegin(init_value)) {