summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui/simpleselgame.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-02-28 11:09:00 +1100
committer Vas Crabb <vas@vastheman.com>2016-02-28 13:36:19 +1100
commitaec01e740736db267e452f0ed5947649f79e3408 (patch)
tree633ca7d80a756bfcc05d871817201c729e55142d /src/emu/ui/simpleselgame.cpp
parent3cba23966f6c1c6f9ee616e5af00ebcfcb0d0b0a (diff)
Replace strformat, strprintf and strcatprintf with type-safe steam_format and string_format
Update MAME to use new function Instantiate ODR-used static constant members Make some of the UI code more localisable Remove use of retired functions in tools
Diffstat (limited to 'src/emu/ui/simpleselgame.cpp')
-rw-r--r--src/emu/ui/simpleselgame.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/emu/ui/simpleselgame.cpp b/src/emu/ui/simpleselgame.cpp
index 4847eb06da4..617c6e651e4 100644
--- a/src/emu/ui/simpleselgame.cpp
+++ b/src/emu/ui/simpleselgame.cpp
@@ -228,12 +228,12 @@ void ui_simple_menu_select_game::populate()
// if nothing there, add a single multiline item and return
if (matchcount == 0)
{
- std::string txt;
- strprintf(txt, "No machines found. Please check the rompath specified in the %s.ini file.\n\n"
- "If this is your first time using %s, please see the config.txt file in "
- "the docs directory for information on configuring %s.",
- emulator_info::get_configname(),
- emulator_info::get_appname(),emulator_info::get_appname() );
+ std::string txt = string_format(
+ _("No machines found. Please check the rompath specified in the %1$s.ini file.\n\n"
+ "If this is your first time using %2$s, please see the config.txt file in "
+ "the docs directory for information on configuring %2$s."),
+ emulator_info::get_configname(),
+ emulator_info::get_appname());
item_append(txt.c_str(), nullptr, MENU_FLAG_MULTILINE | MENU_FLAG_REDTEXT, nullptr);
return;
}
@@ -284,9 +284,9 @@ void ui_simple_menu_select_game::custom_render(void *selectedref, float top, flo
// display the current typeahead
if (m_search[0] != 0)
- strprintf(tempbuf[0], "Type name or select: %s_", m_search);
+ tempbuf[0] = string_format(_("Type name or select: %1$s_"), m_search);
else
- strprintf(tempbuf[0],"Type name or select: (random)");
+ tempbuf[0] = _("Type name or select: (random)");
// get the size of the text
machine().ui().draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
@@ -319,36 +319,36 @@ void ui_simple_menu_select_game::custom_render(void *selectedref, float top, flo
const char *gfxstat, *soundstat;
// first line is game name
- strprintf(tempbuf[0],"%-.100s", driver->description);
+ tempbuf[0] = string_format(_("%1$-.100s"), driver->description);
// next line is year, manufacturer
- strprintf(tempbuf[1], "%s, %-.100s", driver->year, driver->manufacturer);
+ tempbuf[1] = string_format(_("%1$s, %2$-.100s"), driver->year, driver->manufacturer);
// next line source path
- strprintf(tempbuf[2],"Driver: %-.100s", core_filename_extract_base(driver->source_file).c_str());
+ tempbuf[2] = string_format(_("Driver: %1$-.100s"), core_filename_extract_base(driver->source_file).c_str());
// next line is overall driver status
if (driver->flags & MACHINE_NOT_WORKING)
- tempbuf[3].assign("Overall: NOT WORKING");
+ tempbuf[3].assign(_("Overall: NOT WORKING"));
else if (driver->flags & MACHINE_UNEMULATED_PROTECTION)
- tempbuf[3].assign("Overall: Unemulated Protection");
+ tempbuf[3].assign(_("Overall: Unemulated Protection"));
else
- tempbuf[3].assign("Overall: Working");
+ tempbuf[3].assign(_("Overall: Working"));
// next line is graphics, sound status
if (driver->flags & (MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_COLORS))
- gfxstat = "Imperfect";
+ gfxstat = _("Imperfect");
else
- gfxstat = "OK";
+ gfxstat = _("OK");
if (driver->flags & MACHINE_NO_SOUND)
- soundstat = "Unimplemented";
+ soundstat = _("Unimplemented");
else if (driver->flags & MACHINE_IMPERFECT_SOUND)
- soundstat = "Imperfect";
+ soundstat = _("Imperfect");
else
- soundstat = "OK";
+ soundstat = _("OK");
- strprintf(tempbuf[4], "Gfx: %s, Sound: %s", gfxstat, soundstat);
+ tempbuf[4] = string_format(_("Gfx: %s, Sound: %s"), gfxstat, soundstat);
}
else
{
@@ -356,7 +356,7 @@ void ui_simple_menu_select_game::custom_render(void *selectedref, float top, flo
line = 0;
// first line is version string
- strprintf(tempbuf[line++], "%s %s", emulator_info::get_appname(), build_version);
+ tempbuf[line++] = string_format("%s %s", emulator_info::get_appname(), build_version);
// output message
while (line < ARRAY_LENGTH(tempbuf))