1
0
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:
Gymnasiast
2022-01-08 12:24:57 +01:00
parent 12034b2d36
commit 3f22b60f94
12 changed files with 60 additions and 60 deletions

View File

@@ -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()
{