1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Make it possible to compile without HAVE_MENU defined

This commit is contained in:
twinaphex 2014-09-05 18:14:00 +02:00
parent a66b16c862
commit e4681e0013
4 changed files with 29 additions and 14 deletions

View File

@ -34,8 +34,10 @@ void file_list_push(file_list_t *list,
list->capacity * sizeof(struct item_file));
}
#ifdef HAVE_MENU
if (driver.menu_ctx && driver.menu_ctx->list_insert)
driver.menu_ctx->list_insert(list, path, label, list->size);
#endif
list->list[list->size].label = strdup(label);
list->list[list->size].path = strdup(path);
@ -60,8 +62,10 @@ void file_list_pop(file_list_t *list, size_t *directory_ptr)
{
if (!(list->size == 0))
{
#ifdef HAVE_MENU
if (driver.menu_ctx && driver.menu_ctx->list_delete)
driver.menu_ctx->list_delete(list, list->size);
#endif
--list->size;
free(list->list[list->size].path);
free(list->list[list->size].label);
@ -70,8 +74,10 @@ void file_list_pop(file_list_t *list, size_t *directory_ptr)
if (directory_ptr)
*directory_ptr = list->list[list->size].directory_ptr;
#ifdef HAVE_MENU
if (driver.menu_ctx && driver.menu_ctx->list_set_selection)
driver.menu_ctx->list_set_selection(list);
#endif
}
void file_list_free(file_list_t *list)
@ -98,8 +104,10 @@ void file_list_clear(file_list_t *list)
free(list->list[i].alt);
}
#ifdef HAVE_MENU
if (driver.menu_ctx && driver.menu_ctx->list_clear)
driver.menu_ctx->list_clear(list);
#endif
list->size = 0;
}

View File

@ -19,6 +19,7 @@
#include "../general.h"
#include "../conf/config_file.h"
#include "../file.h"
#include "../performance.h"
#include "frontend_context.h"
@ -113,7 +114,6 @@ static int main_entry_iterate_content_nomenu(signature(), args_type() args)
}
#endif
#ifdef HAVE_MENU
int main_entry_iterate_clear_input(signature(), args_type() args)
{
(void)args;
@ -122,25 +122,24 @@ int main_entry_iterate_clear_input(signature(), args_type() args)
return main_entry_iterate_shutdown(signature_expand(), args);
rarch_input_poll();
if (!menu_input())
{
/* Restore libretro keyboard callback. */
g_extern.system.key_event = key_event;
#ifdef HAVE_MENU
if (menu_input())
return 0;
#endif
rarch_main_set_state(RARCH_ACTION_STATE_FLUSH_INPUT_FINISHED);
}
/* Restore libretro keyboard callback. */
g_extern.system.key_event = key_event;
rarch_main_set_state(RARCH_ACTION_STATE_FLUSH_INPUT_FINISHED);
return 0;
}
int main_entry_iterate_load_content(signature(), args_type() args)
{
if (g_extern.system.shutdown)
return main_entry_iterate_shutdown(signature_expand(), args);
#ifdef HAVE_MENU
if (!load_menu_content())
{
/* If content loading fails, we go back to menu. */
@ -148,12 +147,14 @@ int main_entry_iterate_load_content(signature(), args_type() args)
if (driver.menu)
rarch_main_set_state(RARCH_ACTION_STATE_MENU_PREINIT);
}
#endif
rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT_FINISHED);
return 0;
}
#ifdef HAVE_MENU
int main_entry_iterate_menu_preinit(signature(), args_type() args)
{
int i;
@ -237,8 +238,10 @@ void main_exit(args_type() args)
if (g_extern.main_is_init)
{
#ifdef HAVE_MENU
/* Do not want menu context to live any more. */
driver.menu_data_own = false;
#endif
rarch_main_deinit();
}

View File

@ -73,12 +73,12 @@ extern const frontend_ctx_driver_t frontend_ctx_null;
const frontend_ctx_driver_t *frontend_ctx_find_driver(const char *ident); // Finds driver with ident. Does not initialize.
const frontend_ctx_driver_t *frontend_ctx_init_first(void); // Finds first suitable driver and initializes.
#ifdef HAVE_MENU
int main_entry_iterate_content(signature(), args_type() args);
int main_entry_iterate_menu_preinit(signature(), args_type() args);
int main_entry_iterate_menu(signature(), args_type() args);
int main_entry_iterate_clear_input(signature(), args_type() args);
int main_entry_iterate_load_content(signature(), args_type() args);
int main_entry_iterate_content(signature(), args_type() args);
#ifdef HAVE_MENU
int main_entry_iterate_menu_preinit(signature(), args_type() args);
int main_entry_iterate_menu(signature(), args_type() args);
#endif
extern int (*frontend_loop)(signature(), args_type() args);

View File

@ -1019,7 +1019,9 @@ bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_BOOL(location.allow, "location_allow");
CONFIG_GET_STRING(video.driver, "video_driver");
#ifdef HAVE_MENU
CONFIG_GET_STRING(menu.driver, "menu_driver");
#endif
CONFIG_GET_STRING(video.gl_context, "video_gl_context");
CONFIG_GET_STRING(audio.driver, "audio_driver");
CONFIG_GET_PATH(video.softfilter_plugin, "video_filter");
@ -1440,7 +1442,9 @@ bool config_save_file(const char *path)
config_set_int(conf, "video_fullscreen_x", g_settings.video.fullscreen_x);
config_set_int(conf, "video_fullscreen_y", g_settings.video.fullscreen_y);
config_set_string(conf,"video_driver", g_settings.video.driver);
#ifdef HAVE_MENU
config_set_string(conf,"menu_driver", g_settings.menu.driver);
#endif
config_set_bool(conf, "video_vsync", g_settings.video.vsync);
config_set_bool(conf, "video_hard_sync", g_settings.video.hard_sync);
config_set_int(conf, "video_hard_sync_frames",