mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 18:35:22 +00:00
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,
|
||||
// push it to ROM history.
|
||||
if (!g_extern.libretro_dummy)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
menu_rom_history_push_current();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
@ -371,6 +371,21 @@ void menu_rom_history_push(const char *path,
|
||||
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)
|
||||
{
|
||||
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 menu_rom_history_push(const char *path, const char *core_path,
|
||||
const char *core_name);
|
||||
void menu_rom_history_push_current(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user