mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 15:24:30 +01:00
Upgrade platform_get_locale_currency()
This commit is contained in:
@@ -70,6 +70,24 @@ static LARGE_INTEGER _entryTimestamp;
|
||||
|
||||
namespace Platform
|
||||
{
|
||||
CurrencyType GetCurrencyValue(const char* currCode)
|
||||
{
|
||||
if (currCode == nullptr || strlen(currCode) < 3)
|
||||
{
|
||||
return CurrencyType::Pounds;
|
||||
}
|
||||
|
||||
for (int32_t currency = 0; currency < EnumValue(CurrencyType::Count); ++currency)
|
||||
{
|
||||
if (strncmp(currCode, CurrencyDescriptors[currency].isoCode, 3) == 0)
|
||||
{
|
||||
return static_cast<CurrencyType>(currency);
|
||||
}
|
||||
}
|
||||
|
||||
return CurrencyType::Pounds;
|
||||
}
|
||||
|
||||
rct2_date GetDateLocal()
|
||||
{
|
||||
auto time = std::time(nullptr);
|
||||
@@ -242,24 +260,6 @@ void platform_sleep(uint32_t ms)
|
||||
#endif
|
||||
}
|
||||
|
||||
CurrencyType platform_get_currency_value(const char* currCode)
|
||||
{
|
||||
if (currCode == nullptr || strlen(currCode) < 3)
|
||||
{
|
||||
return CurrencyType::Pounds;
|
||||
}
|
||||
|
||||
for (int32_t currency = 0; currency < EnumValue(CurrencyType::Count); ++currency)
|
||||
{
|
||||
if (strncmp(currCode, CurrencyDescriptors[currency].isoCode, 3) == 0)
|
||||
{
|
||||
return static_cast<CurrencyType>(currency);
|
||||
}
|
||||
}
|
||||
|
||||
return CurrencyType::Pounds;
|
||||
}
|
||||
|
||||
#ifndef __ANDROID__
|
||||
float platform_get_default_scale()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user