mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 14:01:17 +12:00
Merge branch 'main' into linux-overlay
This commit is contained in:
commit
edeb14d4c6
4 changed files with 16 additions and 13 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -22,6 +22,7 @@ bin/Cemu
|
||||||
# Cemu bin files
|
# Cemu bin files
|
||||||
bin/otp.bin
|
bin/otp.bin
|
||||||
bin/seeprom.bin
|
bin/seeprom.bin
|
||||||
|
bin/log.txt
|
||||||
bin/Cemu.pdb
|
bin/Cemu.pdb
|
||||||
bin/Cemu.ilk
|
bin/Cemu.ilk
|
||||||
bin/Cemu.exe.backup
|
bin/Cemu.exe.backup
|
||||||
|
@ -36,3 +37,5 @@ bin/controllerProfiles/*
|
||||||
|
|
||||||
!bin/gameProfiles/default/*
|
!bin/gameProfiles/default/*
|
||||||
bin/gameProfiles/*
|
bin/gameProfiles/*
|
||||||
|
|
||||||
|
bin/graphicPacks/*
|
||||||
|
|
|
@ -22,7 +22,7 @@ constexpr T bswap(T i)
|
||||||
template <typename T>
|
template <typename T>
|
||||||
constexpr T SwapEndian(T value)
|
constexpr T SwapEndian(T value)
|
||||||
{
|
{
|
||||||
if constexpr (boost::is_integral<T>::value)
|
if constexpr (std::is_integral<T>::value)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
if constexpr (sizeof(T) == sizeof(uint32_t))
|
if constexpr (sizeof(T) == sizeof(uint32_t))
|
||||||
|
@ -33,7 +33,7 @@ constexpr T SwapEndian(T value)
|
||||||
|
|
||||||
return (T)bswap((std::make_unsigned_t<T>)value);
|
return (T)bswap((std::make_unsigned_t<T>)value);
|
||||||
}
|
}
|
||||||
else if constexpr (boost::is_floating_point<T>::value)
|
else if constexpr (std::is_floating_point<T>::value)
|
||||||
{
|
{
|
||||||
if constexpr (sizeof(T) == sizeof(uint32_t))
|
if constexpr (sizeof(T) == sizeof(uint32_t))
|
||||||
{
|
{
|
||||||
|
@ -46,18 +46,18 @@ constexpr T SwapEndian(T value)
|
||||||
return *(T*)&tmp;
|
return *(T*)&tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if constexpr (boost::is_enum<T>::value)
|
else if constexpr (std::is_enum<T>::value)
|
||||||
{
|
{
|
||||||
return (T)SwapEndian((std::underlying_type_t<T>)value);
|
return (T)SwapEndian((std::underlying_type_t<T>)value);
|
||||||
}
|
}
|
||||||
else if constexpr (boost::is_base_of<Latte::LATTEREG, T>::value)
|
else if constexpr (std::is_base_of<Latte::LATTEREG, T>::value)
|
||||||
{
|
{
|
||||||
const auto tmp = bswap<uint32_t>(*(uint32_t*)&value);
|
const auto tmp = bswap<uint32_t>(*(uint32_t*)&value);
|
||||||
return *(T*)&tmp;
|
return *(T*)&tmp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static_assert(boost::is_integral<T>::value, "unsupported betype specialization!");
|
static_assert(std::is_integral<T>::value, "unsupported betype specialization!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|
|
@ -96,14 +96,14 @@ public:
|
||||||
m_value = v;
|
m_value = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename = typename boost::enable_if<boost::is_same<TType, std::string>>>
|
template <typename = typename std::enable_if<std::is_same_v<TType, std::string>>>
|
||||||
void SetValue(std::string_view v)
|
void SetValue(std::string_view v)
|
||||||
{
|
{
|
||||||
std::lock_guard lock(m_mutex);
|
std::lock_guard lock(m_mutex);
|
||||||
m_value = v;
|
m_value = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename = typename boost::enable_if<boost::is_same<TType, std::wstring>>>
|
template <typename = typename std::enable_if<std::is_same_v<TType, std::wstring>>>
|
||||||
void SetValue(std::wstring_view v)
|
void SetValue(std::wstring_view v)
|
||||||
{
|
{
|
||||||
std::lock_guard lock(m_mutex);
|
std::lock_guard lock(m_mutex);
|
||||||
|
@ -171,21 +171,21 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// init from enum with iterators
|
// init from enum with iterators
|
||||||
template<typename TEnum = typename boost::enable_if_c<boost::is_enum<TType>::value && EnableEnumIterators<TType>::enable, TType>>
|
template<typename TEnum = typename std::enable_if<std::is_enum<TType>::value && EnableEnumIterators<TType>::enable, TType>>
|
||||||
constexpr ConfigValueBounds()
|
constexpr ConfigValueBounds()
|
||||||
: base_type(), m_min_value(begin(TEnum{})), m_max_value(rbegin(TEnum{}))
|
: base_type(), m_min_value(begin(TEnum{})), m_max_value(rbegin(TEnum{}))
|
||||||
{
|
{
|
||||||
assert(m_min_value <= this->GetInitValue() && this->GetInitValue() <= m_max_value);
|
assert(m_min_value <= this->GetInitValue() && this->GetInitValue() <= m_max_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename TEnum = typename boost::enable_if_c<boost::is_enum<TType>::value && EnableEnumIterators<TType>::enable, TType>>
|
template<typename TEnum = typename std::enable_if<std::is_enum<TType>::value && EnableEnumIterators<TType>::enable, TType>>
|
||||||
constexpr ConfigValueBounds(const TType& init_value)
|
constexpr ConfigValueBounds(const TType& init_value)
|
||||||
: base_type(std::forward<TType>(init_value)), m_min_value(begin(init_value)), m_max_value(rbegin(init_value))
|
: base_type(std::forward<TType>(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);
|
assert(m_min_value <= init_value && init_value <= m_max_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename TEnum = typename boost::enable_if_c<boost::is_enum<TType>::value && EnableEnumIterators<TType>::enable, TType>>
|
template<typename TEnum = typename std::enable_if<std::is_enum<TType>::value && EnableEnumIterators<TType>::enable, TType>>
|
||||||
constexpr ConfigValueBounds(TType&& init_value)
|
constexpr ConfigValueBounds(TType&& init_value)
|
||||||
: base_type(std::forward<TType>(init_value)), m_min_value(begin(init_value)), m_max_value(rbegin(init_value))
|
: base_type(std::forward<TType>(init_value)), m_min_value(begin(init_value)), m_max_value(rbegin(init_value))
|
||||||
{
|
{
|
||||||
|
|
|
@ -121,9 +121,9 @@ void DownloadGraphicPacksWindow::UpdateThread()
|
||||||
// get github url
|
// get github url
|
||||||
std::string githubAPIUrl;
|
std::string githubAPIUrl;
|
||||||
curlDownloadFileState_t tempDownloadState;
|
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];
|
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(temp);
|
||||||
queryUrl.append("&");
|
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)
|
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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue