mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-16 07:16:36 +00:00
Move driver.menu->history to g_extern.history
This commit is contained in:
parent
9c3eb0bce4
commit
42c48b715c
@ -21,7 +21,6 @@
|
||||
#include <stdint.h>
|
||||
#include "boolean.h"
|
||||
#include "frontend/menu/file_list.h"
|
||||
#include "frontend/menu/history.h"
|
||||
#include "frontend/info/core_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -163,7 +162,6 @@ typedef struct
|
||||
struct gfx_shader *parameter_shader; // Points to either shader or graphics driver current shader.
|
||||
unsigned current_pad;
|
||||
|
||||
content_history_t *history;
|
||||
retro_time_t last_time; // Used to throttle menu in case VSync is broken.
|
||||
|
||||
struct menu_bind_state binds;
|
||||
|
@ -654,7 +654,7 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
|
||||
#if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT)
|
||||
file_list_push(menu->selection_buf, "Core", MENU_SETTINGS_CORE, 0);
|
||||
#endif
|
||||
if (menu->history)
|
||||
if (g_extern.history)
|
||||
file_list_push(menu->selection_buf, "Load Content (History)", MENU_SETTINGS_OPEN_HISTORY, 0);
|
||||
|
||||
if (menu->core_info && core_info_list_num_info_files(menu->core_info))
|
||||
@ -2130,7 +2130,7 @@ static void menu_parse_and_resolve(unsigned menu_type)
|
||||
{
|
||||
case MENU_SETTINGS_OPEN_HISTORY:
|
||||
/* History parse */
|
||||
list_size = content_history_size(driver.menu->history);
|
||||
list_size = content_history_size(g_extern.history);
|
||||
|
||||
for (i = 0; i < list_size; i++)
|
||||
{
|
||||
@ -2141,7 +2141,7 @@ static void menu_parse_and_resolve(unsigned menu_type)
|
||||
core_path = NULL;
|
||||
core_name = NULL;
|
||||
|
||||
content_history_get_index(driver.menu->history, i,
|
||||
content_history_get_index(g_extern.history, i,
|
||||
&path, &core_path, &core_name);
|
||||
|
||||
if (path)
|
||||
|
@ -88,8 +88,8 @@ void menu_content_history_push_current(void)
|
||||
path_resolve_realpath(tmp, sizeof(tmp));
|
||||
|
||||
if (g_extern.system.no_game || *tmp)
|
||||
if (driver.menu && driver.menu->history)
|
||||
content_history_push(driver.menu->history,
|
||||
if (driver.menu && g_extern.history)
|
||||
content_history_push(g_extern.history,
|
||||
*tmp ? tmp : NULL,
|
||||
g_settings.libretro,
|
||||
g_extern.system.info.library_name);
|
||||
@ -115,8 +115,8 @@ void load_menu_game_prepare(void)
|
||||
#ifdef RARCH_CONSOLE
|
||||
if (g_extern.system.no_game || *g_extern.fullpath)
|
||||
#endif
|
||||
if (driver.menu && driver.menu->history)
|
||||
content_history_push(driver.menu->history,
|
||||
if (driver.menu && g_extern.history)
|
||||
content_history_push(g_extern.history,
|
||||
*g_extern.fullpath ? g_extern.fullpath : NULL,
|
||||
g_settings.libretro,
|
||||
driver.menu->info.library_name ? driver.menu->info.library_name : "");
|
||||
@ -151,7 +151,7 @@ void load_menu_game_history(unsigned game_index)
|
||||
if (!driver.menu)
|
||||
return;
|
||||
|
||||
content_history_get_index(driver.menu->history,
|
||||
content_history_get_index(g_extern.history,
|
||||
game_index, &path, &core_path, &core_name);
|
||||
|
||||
strlcpy(g_settings.libretro, core_path, sizeof(g_settings.libretro));
|
||||
@ -243,9 +243,9 @@ bool load_menu_game(void)
|
||||
// Update menu state which depends on config.
|
||||
menu_update_libretro_info(driver.menu);
|
||||
|
||||
if (driver.menu->history)
|
||||
content_history_free(driver.menu->history);
|
||||
driver.menu->history = content_history_init(g_settings.game_history_path, g_settings.game_history_size);
|
||||
if (g_extern.history)
|
||||
content_history_free(g_extern.history);
|
||||
g_extern.history = content_history_init(g_settings.game_history_path, g_settings.game_history_size);
|
||||
|
||||
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->shader_manager_init)
|
||||
driver.menu_ctx->backend->shader_manager_init(driver.menu);
|
||||
@ -293,7 +293,7 @@ void *menu_init(const void *data)
|
||||
if (menu_ctx && menu_ctx->backend && menu_ctx->backend->shader_manager_init)
|
||||
menu_ctx->backend->shader_manager_init(menu);
|
||||
|
||||
menu->history = content_history_init(g_settings.game_history_path, g_settings.game_history_size);
|
||||
g_extern.history = content_history_init(g_settings.game_history_path, g_settings.game_history_size);
|
||||
menu->last_time = rarch_get_time_usec();
|
||||
|
||||
return menu;
|
||||
@ -327,9 +327,9 @@ void menu_free(void *data)
|
||||
file_list_free(menu->menu_stack);
|
||||
file_list_free(menu->selection_buf);
|
||||
|
||||
if (menu->history)
|
||||
content_history_free(menu->history);
|
||||
menu->history = NULL;
|
||||
if (g_extern.history)
|
||||
content_history_free(g_extern.history);
|
||||
g_extern.history = NULL;
|
||||
core_info_list_free(menu->core_info);
|
||||
|
||||
if (menu->core_info_current)
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include "miscellaneous.h"
|
||||
#include "gfx/filter.h"
|
||||
|
||||
#include "frontend/menu/history.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
@ -389,6 +391,8 @@ struct global
|
||||
|
||||
struct string_list *temporary_roms;
|
||||
|
||||
content_history_t *history;
|
||||
|
||||
uint32_t cart_crc;
|
||||
|
||||
char gb_rom_path[PATH_MAX];
|
||||
|
Loading…
Reference in New Issue
Block a user