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 authored and GitHub committed 2023-05-17 19:27:04 +01:00
1 parent d72fce1721
commit fe2d1e2372
4 files changed
+17 -19

No files matched your search

-3
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
-16
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();
+1
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;
@@ -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]));
}
}
}