1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 23:04:36 +01:00

Move storage into Formatter class and refactor usage

This commit is contained in:
Matt
2020-08-26 22:54:12 +02:00
parent 1982e8491b
commit 2639349925
13 changed files with 62 additions and 80 deletions

View File

@@ -619,8 +619,7 @@ static void window_title_command_editor_tool_down(
if (peep != nullptr)
{
validSprite = true;
uint8_t formatArgs[32]{};
Formatter ft(formatArgs);
Formatter ft;
peep->FormatNameTo(ft);
format_string(command.SpriteName, USER_STRING_MAX_LENGTH, STR_STRINGID, &peep->Id);
}
@@ -631,10 +630,9 @@ static void window_title_command_editor_tool_down(
auto ride = vehicle->GetRide();
if (ride != nullptr)
{
uint8_t formatArgs[32]{};
Formatter ft(formatArgs);
Formatter ft;
ride->FormatNameTo(ft);
format_string(command.SpriteName, USER_STRING_MAX_LENGTH, STR_STRINGID, formatArgs);
format_string(command.SpriteName, USER_STRING_MAX_LENGTH, STR_STRINGID, ft.Data());
}
}
else if (litter != nullptr)