From 8c35a40648a580eb2c7da45392bd6001736d476b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 22 Jul 2014 04:48:26 +0200 Subject: [PATCH] (Menu) Refactor away menu_rom_history_push --- frontend/menu/menu_common.c | 24 ++++++++++-------------- frontend/menu/menu_common.h | 2 -- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index f12a6161b2..2f3deb1dec 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -82,14 +82,6 @@ int menu_defer_core(void *info_, const char *dir, const char *path, char *deferr return 0; } -void menu_rom_history_push(const char *path, - const char *core_path, - const char *core_name) -{ - if (driver.menu && driver.menu->history) - rom_history_push(driver.menu->history, path, core_path, core_name); -} - void menu_rom_history_push_current(void) { // g_extern.fullpath can be relative here. @@ -105,9 +97,11 @@ void menu_rom_history_push_current(void) path_resolve_realpath(tmp, sizeof(tmp)); if (g_extern.system.no_game || *tmp) - menu_rom_history_push(*tmp ? tmp : NULL, - g_settings.libretro, - g_extern.system.info.library_name); + if (driver.menu && driver.menu->history) + rom_history_push(driver.menu->history, + *tmp ? tmp : NULL, + g_settings.libretro, + g_extern.system.info.library_name); } void load_menu_game_prepare(void) @@ -130,9 +124,11 @@ void load_menu_game_prepare(void) #ifdef RARCH_CONSOLE if (g_extern.system.no_game || *g_extern.fullpath) #endif - menu_rom_history_push(*g_extern.fullpath ? g_extern.fullpath : NULL, - g_settings.libretro, - driver.menu->info.library_name ? driver.menu->info.library_name : ""); + if (driver.menu && driver.menu->history) + rom_history_push(driver.menu->history, + *g_extern.fullpath ? g_extern.fullpath : NULL, + g_settings.libretro, + driver.menu->info.library_name ? driver.menu->info.library_name : ""); } // redraw menu frame diff --git a/frontend/menu/menu_common.h b/frontend/menu/menu_common.h index 8c5afc8209..13e4616271 100644 --- a/frontend/menu/menu_common.h +++ b/frontend/menu/menu_common.h @@ -107,8 +107,6 @@ void load_menu_game_prepare(void); void load_menu_game_prepare_dummy(void); 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); bool menu_replace_config(const char *path);