1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-31 10:29:10 +00:00

Cleanup: remove stre-style GetString

This commit is contained in:
Rubidium
2023-06-04 21:46:21 +02:00
committed by rubidium42
parent 772729cc7d
commit 14915526ad
2 changed files with 3 additions and 13 deletions

View File

@@ -281,15 +281,6 @@ void GetStringWithArgs(StringBuilder &builder, StringID string, StringParameters
FormatString(builder, GetStringPtr(string), args, case_index);
}
char *GetString(char *buffr, StringID string, const char *last)
{
_global_string_params.ClearTypeInformation();
_global_string_params.offset = 0;
StringBuilder builder(&buffr, last);
GetStringWithArgs(builder, string, &_global_string_params);
return builder.GetEnd();
}
/**
* Resolve the given StringID into a std::string with all the associated
@@ -299,9 +290,9 @@ char *GetString(char *buffr, StringID string, const char *last)
*/
std::string GetString(StringID string)
{
char buffer[DRAW_STRING_BUFFER];
GetString(buffer, string, lastof(buffer));
return buffer;
_global_string_params.ClearTypeInformation();
_global_string_params.offset = 0;
return GetStringWithArgs(string, &_global_string_params);
}
/**

View File

@@ -170,7 +170,6 @@ public:
};
extern StringParameters _global_string_params;
char *GetString(char *buffr, StringID string, const char *last);
std::string GetString(StringID string);
std::string GetStringWithArgs(StringID string, StringParameters *args);
const char *GetStringPtr(StringID string);