mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge encoding_convert_rct2_to_unicode() with generic counterpart
This commit is contained in:
parent
62d5a69051
commit
598675ca8f
|
@ -108,15 +108,10 @@ static int32_t encoding_search_compare(const void *pKey, const void *pEntry)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static wchar_t encoding_convert_x_to_unicode(wchar_t code, const encoding_convert_entry *table, size_t count)
|
|
||||||
{
|
|
||||||
encoding_convert_entry * entry = static_cast<encoding_convert_entry *>(std::bsearch(&code, table, count, sizeof(encoding_convert_entry), encoding_search_compare));
|
|
||||||
if (entry == nullptr)
|
|
||||||
return code;
|
|
||||||
return entry->unicode;
|
|
||||||
}
|
|
||||||
|
|
||||||
wchar_t encoding_convert_rct2_to_unicode(wchar_t rct2str)
|
wchar_t encoding_convert_rct2_to_unicode(wchar_t rct2str)
|
||||||
{
|
{
|
||||||
return encoding_convert_x_to_unicode(rct2str, RCT2ToUnicodeTable, std::size(RCT2ToUnicodeTable));
|
encoding_convert_entry * entry = static_cast<encoding_convert_entry *>(std::bsearch(&rct2str, RCT2ToUnicodeTable, std::size(RCT2ToUnicodeTable), sizeof(encoding_convert_entry), encoding_search_compare));
|
||||||
|
if (entry == nullptr)
|
||||||
|
return rct2str;
|
||||||
|
return entry->unicode;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue