Small symbol cleanup (#20229)

* Remove unused generate_string_file() declaration

* Move IsUserStringID() to RCT12.h

The function is only used by RCT1/2 code, and the implementation is in RCT12.cpp

* Move ScenarioTranslate() to ScenarioRepository.cpp

Seems to have ended up in ObjectRepository.cpp by accident.
This commit is contained in:
Michael Steenbeek 2023-05-17 20:27:04 +02:00 committed by GitHub
parent d72fce1721
commit fe2d1e2372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 19 deletions

View File

@ -20,7 +20,6 @@
std::string FormatStringID(StringId format, const void* args);
void FormatStringToUpper(char* dest, size_t size, StringId format, const void* args);
void generate_string_file();
/**
* Formats sizeBytes into buf as a human readable text, e.x.: "1024 MB"
@ -40,8 +39,6 @@ size_t GetStringSize(const utf8* text);
money64 StringToMoney(const char* string_to_monetise);
void MoneyToString(money64 amount, char* buffer_to_put_value_to, size_t buffer_len, bool forceDecimals);
bool IsUserStringID(StringId stringId);
#define MAX_USER_STRINGS 1024
#define USER_STRING_MAX_LENGTH 32

View File

@ -690,22 +690,6 @@ std::unique_ptr<Object> ObjectRepositoryLoadObject(const RCTObjectEntry* objectE
return object;
}
void ScenarioTranslate(ScenarioIndexEntry* scenarioEntry)
{
StringId localisedStringIds[3];
if (LanguageGetLocalisedScenarioStrings(scenarioEntry->Name, localisedStringIds))
{
if (localisedStringIds[0] != STR_NONE)
{
String::Set(scenarioEntry->Name, sizeof(scenarioEntry->Name), LanguageGetString(localisedStringIds[0]));
}
if (localisedStringIds[2] != STR_NONE)
{
String::Set(scenarioEntry->Details, sizeof(scenarioEntry->Details), LanguageGetString(localisedStringIds[2]));
}
}
}
size_t ObjectRepositoryGetItemsCount()
{
auto& objectRepository = GetContext()->GetObjectRepository();

View File

@ -870,6 +870,7 @@ uint8_t GetStationStyleFromIdentifier(u8string_view identifier);
std::optional<uint8_t> GetStyleFromMusicIdentifier(std::string_view identifier);
void RCT12AddDefaultObjects(ObjectList& objectList);
void AppendRequiredObjects(ObjectList& objectList, ObjectType objectType, const RCT12::EntryList& entryList);
bool IsUserStringID(StringId stringId);
static constexpr money32 RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x80000001;

View File

@ -804,3 +804,19 @@ bool ScenarioRepositoryTryRecordHighscore(const utf8* scenarioFileName, money64
IScenarioRepository* repo = GetScenarioRepository();
return repo->TryRecordHighscore(LocalisationService_GetCurrentLanguage(), scenarioFileName, companyValue, name);
}
void ScenarioTranslate(ScenarioIndexEntry* scenarioEntry)
{
StringId localisedStringIds[3];
if (LanguageGetLocalisedScenarioStrings(scenarioEntry->Name, localisedStringIds))
{
if (localisedStringIds[0] != STR_NONE)
{
String::Set(scenarioEntry->Name, sizeof(scenarioEntry->Name), LanguageGetString(localisedStringIds[0]));
}
if (localisedStringIds[2] != STR_NONE)
{
String::Set(scenarioEntry->Details, sizeof(scenarioEntry->Details), LanguageGetString(localisedStringIds[2]));
}
}
}