Refactor initial ROM history save.
Add menu_rom_history_push_current().
This commit is contained in:
parent
50bd5bb4ff
commit
608f88bd55
|
@ -55,15 +55,7 @@ int main(int argc, char *argv[])
|
||||||
// If we started a ROM directly from command line,
|
// If we started a ROM directly from command line,
|
||||||
// push it to ROM history.
|
// push it to ROM history.
|
||||||
if (!g_extern.libretro_dummy)
|
if (!g_extern.libretro_dummy)
|
||||||
{
|
menu_rom_history_push_current();
|
||||||
// g_extern.fullpath can be relative here.
|
|
||||||
if (*g_extern.fullpath)
|
|
||||||
path_resolve_realpath(g_extern.fullpath, sizeof(g_extern.fullpath));
|
|
||||||
|
|
||||||
menu_rom_history_push(*g_extern.fullpath ? g_extern.fullpath : NULL,
|
|
||||||
g_settings.libretro,
|
|
||||||
g_extern.system.info.library_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
|
|
@ -371,6 +371,21 @@ void menu_rom_history_push(const char *path,
|
||||||
rom_history_push(rgui->history, path, core_path, core_name);
|
rom_history_push(rgui->history, path, core_path, core_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_rom_history_push_current(void)
|
||||||
|
{
|
||||||
|
// g_extern.fullpath can be relative here.
|
||||||
|
// Ensure we're pushing absolute path.
|
||||||
|
|
||||||
|
char tmp[PATH_MAX];
|
||||||
|
strlcpy(tmp, g_extern.fullpath, sizeof(tmp));
|
||||||
|
if (*tmp)
|
||||||
|
path_resolve_realpath(tmp, sizeof(tmp));
|
||||||
|
|
||||||
|
menu_rom_history_push(*tmp ? tmp : NULL,
|
||||||
|
g_settings.libretro,
|
||||||
|
g_extern.system.info.library_name);
|
||||||
|
}
|
||||||
|
|
||||||
void load_menu_game_prepare(void)
|
void load_menu_game_prepare(void)
|
||||||
{
|
{
|
||||||
if (*g_extern.fullpath || rgui->load_no_rom)
|
if (*g_extern.fullpath || rgui->load_no_rom)
|
||||||
|
|
|
@ -284,6 +284,7 @@ bool load_menu_game(void);
|
||||||
void load_menu_game_history(unsigned game_index);
|
void load_menu_game_history(unsigned game_index);
|
||||||
void menu_rom_history_push(const char *path, const char *core_path,
|
void menu_rom_history_push(const char *path, const char *core_path,
|
||||||
const char *core_name);
|
const char *core_name);
|
||||||
|
void menu_rom_history_push_current(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue