mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 16:44:01 +00:00
Make it possible to compile without HAVE_MENU defined
This commit is contained in:
parent
a66b16c862
commit
e4681e0013
@ -34,8 +34,10 @@ void file_list_push(file_list_t *list,
|
|||||||
list->capacity * sizeof(struct item_file));
|
list->capacity * sizeof(struct item_file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
if (driver.menu_ctx && driver.menu_ctx->list_insert)
|
if (driver.menu_ctx && driver.menu_ctx->list_insert)
|
||||||
driver.menu_ctx->list_insert(list, path, label, list->size);
|
driver.menu_ctx->list_insert(list, path, label, list->size);
|
||||||
|
#endif
|
||||||
|
|
||||||
list->list[list->size].label = strdup(label);
|
list->list[list->size].label = strdup(label);
|
||||||
list->list[list->size].path = strdup(path);
|
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))
|
if (!(list->size == 0))
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_MENU
|
||||||
if (driver.menu_ctx && driver.menu_ctx->list_delete)
|
if (driver.menu_ctx && driver.menu_ctx->list_delete)
|
||||||
driver.menu_ctx->list_delete(list, list->size);
|
driver.menu_ctx->list_delete(list, list->size);
|
||||||
|
#endif
|
||||||
--list->size;
|
--list->size;
|
||||||
free(list->list[list->size].path);
|
free(list->list[list->size].path);
|
||||||
free(list->list[list->size].label);
|
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)
|
if (directory_ptr)
|
||||||
*directory_ptr = list->list[list->size].directory_ptr;
|
*directory_ptr = list->list[list->size].directory_ptr;
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
if (driver.menu_ctx && driver.menu_ctx->list_set_selection)
|
if (driver.menu_ctx && driver.menu_ctx->list_set_selection)
|
||||||
driver.menu_ctx->list_set_selection(list);
|
driver.menu_ctx->list_set_selection(list);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_list_free(file_list_t *list)
|
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);
|
free(list->list[i].alt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
if (driver.menu_ctx && driver.menu_ctx->list_clear)
|
if (driver.menu_ctx && driver.menu_ctx->list_clear)
|
||||||
driver.menu_ctx->list_clear(list);
|
driver.menu_ctx->list_clear(list);
|
||||||
|
#endif
|
||||||
list->size = 0;
|
list->size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
#include "../conf/config_file.h"
|
#include "../conf/config_file.h"
|
||||||
#include "../file.h"
|
#include "../file.h"
|
||||||
|
#include "../performance.h"
|
||||||
|
|
||||||
#include "frontend_context.h"
|
#include "frontend_context.h"
|
||||||
|
|
||||||
@ -113,7 +114,6 @@ static int main_entry_iterate_content_nomenu(signature(), args_type() args)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
|
||||||
int main_entry_iterate_clear_input(signature(), args_type() args)
|
int main_entry_iterate_clear_input(signature(), args_type() args)
|
||||||
{
|
{
|
||||||
(void)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);
|
return main_entry_iterate_shutdown(signature_expand(), args);
|
||||||
|
|
||||||
rarch_input_poll();
|
rarch_input_poll();
|
||||||
if (!menu_input())
|
#ifdef HAVE_MENU
|
||||||
{
|
if (menu_input())
|
||||||
/* Restore libretro keyboard callback. */
|
return 0;
|
||||||
g_extern.system.key_event = key_event;
|
#endif
|
||||||
|
|
||||||
|
/* Restore libretro keyboard callback. */
|
||||||
rarch_main_set_state(RARCH_ACTION_STATE_FLUSH_INPUT_FINISHED);
|
g_extern.system.key_event = key_event;
|
||||||
}
|
rarch_main_set_state(RARCH_ACTION_STATE_FLUSH_INPUT_FINISHED);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main_entry_iterate_load_content(signature(), args_type() args)
|
int main_entry_iterate_load_content(signature(), args_type() args)
|
||||||
{
|
{
|
||||||
if (g_extern.system.shutdown)
|
if (g_extern.system.shutdown)
|
||||||
return main_entry_iterate_shutdown(signature_expand(), args);
|
return main_entry_iterate_shutdown(signature_expand(), args);
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
if (!load_menu_content())
|
if (!load_menu_content())
|
||||||
{
|
{
|
||||||
/* If content loading fails, we go back to menu. */
|
/* 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)
|
if (driver.menu)
|
||||||
rarch_main_set_state(RARCH_ACTION_STATE_MENU_PREINIT);
|
rarch_main_set_state(RARCH_ACTION_STATE_MENU_PREINIT);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT_FINISHED);
|
rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT_FINISHED);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
int main_entry_iterate_menu_preinit(signature(), args_type() args)
|
int main_entry_iterate_menu_preinit(signature(), args_type() args)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -237,8 +238,10 @@ void main_exit(args_type() args)
|
|||||||
|
|
||||||
if (g_extern.main_is_init)
|
if (g_extern.main_is_init)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_MENU
|
||||||
/* Do not want menu context to live any more. */
|
/* Do not want menu context to live any more. */
|
||||||
driver.menu_data_own = false;
|
driver.menu_data_own = false;
|
||||||
|
#endif
|
||||||
rarch_main_deinit();
|
rarch_main_deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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_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.
|
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_clear_input(signature(), args_type() args);
|
||||||
int main_entry_iterate_load_content(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
|
#endif
|
||||||
|
|
||||||
extern int (*frontend_loop)(signature(), args_type() args);
|
extern int (*frontend_loop)(signature(), args_type() args);
|
||||||
|
@ -1019,7 +1019,9 @@ bool config_load_file(const char *path, bool set_defaults)
|
|||||||
|
|
||||||
CONFIG_GET_BOOL(location.allow, "location_allow");
|
CONFIG_GET_BOOL(location.allow, "location_allow");
|
||||||
CONFIG_GET_STRING(video.driver, "video_driver");
|
CONFIG_GET_STRING(video.driver, "video_driver");
|
||||||
|
#ifdef HAVE_MENU
|
||||||
CONFIG_GET_STRING(menu.driver, "menu_driver");
|
CONFIG_GET_STRING(menu.driver, "menu_driver");
|
||||||
|
#endif
|
||||||
CONFIG_GET_STRING(video.gl_context, "video_gl_context");
|
CONFIG_GET_STRING(video.gl_context, "video_gl_context");
|
||||||
CONFIG_GET_STRING(audio.driver, "audio_driver");
|
CONFIG_GET_STRING(audio.driver, "audio_driver");
|
||||||
CONFIG_GET_PATH(video.softfilter_plugin, "video_filter");
|
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_x", g_settings.video.fullscreen_x);
|
||||||
config_set_int(conf, "video_fullscreen_y", g_settings.video.fullscreen_y);
|
config_set_int(conf, "video_fullscreen_y", g_settings.video.fullscreen_y);
|
||||||
config_set_string(conf,"video_driver", g_settings.video.driver);
|
config_set_string(conf,"video_driver", g_settings.video.driver);
|
||||||
|
#ifdef HAVE_MENU
|
||||||
config_set_string(conf,"menu_driver", g_settings.menu.driver);
|
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_vsync", g_settings.video.vsync);
|
||||||
config_set_bool(conf, "video_hard_sync", g_settings.video.hard_sync);
|
config_set_bool(conf, "video_hard_sync", g_settings.video.hard_sync);
|
||||||
config_set_int(conf, "video_hard_sync_frames",
|
config_set_int(conf, "video_hard_sync_frames",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user