Add non-HAVE_MENU ifdefs

This commit is contained in:
twinaphex 2015-10-28 00:55:11 +01:00
parent cf7a5f6361
commit df01279cf3
15 changed files with 87 additions and 22 deletions

View File

@ -110,6 +110,7 @@ OBJ += frontend/frontend.o \
ui/drivers/ui_null.o \
libretro_version_1.o \
retroarch.o \
input/keyboard_line.o \
system.o \
retroarch_info.o \
command_event.o \
@ -151,7 +152,6 @@ OBJ += frontend/frontend.o \
gfx/video_pixel_converter.o \
gfx/video_viewport.o \
camera/camera_driver.o \
menu/menu_driver.o \
location/location_driver.o \
driver.o \
configuration.o \
@ -168,7 +168,6 @@ OBJ += frontend/frontend.o \
input/input_keymaps.o \
input/input_remapping.o \
input/input_sensor.o \
input/keyboard_line.o \
tasks/task_overlay.o \
input/input_overlay.o \
patch.o \
@ -416,6 +415,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
endif
OBJ += menu/menu.o \
menu/menu_hash.o \
menu/menu_driver.o \
menu/intl/menu_hash_de.o \
menu/intl/menu_hash_es.o \
menu/intl/menu_hash_eo.o \

View File

@ -13,6 +13,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <ctype.h>
#include <compat/strl.h>
#include "command_event.h"
@ -981,6 +983,7 @@ static void event_main_state(unsigned cmd)
RARCH_LOG("%s\n", msg);
}
#ifdef HAVE_MENU
static bool event_update_system_info(struct retro_system_info *_info,
bool *load_no_content)
{
@ -1003,6 +1006,7 @@ static bool event_update_system_info(struct retro_system_info *_info,
return true;
}
#endif
/**
* event_command:
@ -1052,7 +1056,9 @@ bool event_command(enum event_command cmd)
break;
case EVENT_CMD_LOAD_CORE_DEINIT:
#ifdef HAVE_DYNAMIC
#ifdef HAVE_MENU
libretro_free_system_info(&global->menu.info);
#endif
#endif
break;
case EVENT_CMD_LOAD_CORE_PERSIST:

View File

@ -487,7 +487,7 @@ static void config_set_defaults(void)
settings->video.threaded = g_defaults.settings.video_threaded_enable;
#ifdef HAVE_THREADS
settings->menu.threaded_data_runloop_enable = threaded_data_runloop_enable;
settings->threaded_data_runloop_enable = threaded_data_runloop_enable;
#endif
settings->video.shared_context = video_shared_context;
settings->video.force_srgb_disable = false;
@ -1255,7 +1255,7 @@ static bool config_load_file(const char *path, bool set_defaults)
#ifdef HAVE_MENU
#ifdef HAVE_THREADS
CONFIG_GET_BOOL_BASE(conf, settings, menu.threaded_data_runloop_enable,
CONFIG_GET_BOOL_BASE(conf, settings, threaded_data_runloop_enable,
"threaded_data_runloop_enable");
#endif
@ -2506,7 +2506,7 @@ bool config_save_file(const char *path)
#ifdef HAVE_MENU
#ifdef HAVE_THREADS
config_set_bool(conf,"threaded_data_runloop_enable",
settings->menu.threaded_data_runloop_enable);
settings->threaded_data_runloop_enable);
#endif
config_set_bool(conf, "dpi_override_enable", settings->menu.dpi.override_enable);

View File

@ -151,9 +151,6 @@ typedef struct settings
} dpi;
bool show_advanced_settings;
#ifdef HAVE_THREADS
bool threaded_data_runloop_enable;
#endif
unsigned entry_normal_color;
unsigned entry_hover_color;
@ -161,6 +158,10 @@ typedef struct settings
} menu;
#endif
#ifdef HAVE_THREADS
bool threaded_data_runloop_enable;
#endif
struct
{
char driver[32];

View File

@ -320,6 +320,7 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info)
return true;
}
#ifdef HAVE_MENU
/**
* menu_update_libretro_info:
*
@ -328,7 +329,10 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info)
static void menu_update_libretro_info(void)
{
global_t *global = global_get_ptr();
struct retro_system_info *info = global ? &global->menu.info : NULL;
struct retro_system_info *info = NULL;
if (global)
info = &global->menu.info;
if (!global || !info)
return;
@ -340,6 +344,7 @@ static void menu_update_libretro_info(void)
event_command(EVENT_CMD_CORE_INFO_INIT);
event_command(EVENT_CMD_LOAD_CORE_PERSIST);
}
#endif
/**
* init_drivers:

View File

@ -3341,6 +3341,7 @@ static void gl_apply_state_changes(void *data)
gl->should_resize = true;
}
#ifdef HAVE_MENU
static void gl_set_osd_msg(void *data, const char *msg,
const struct font_params *params, void *font)
{
@ -3368,6 +3369,7 @@ static struct video_shader *gl_get_current_shader(void *data)
gl_t *gl = (gl_t*)data;
return (gl && gl->shader) ? gl->shader->get_current_shader() : NULL;
}
#endif
static void gl_get_video_output_size(void *data,
unsigned *width, unsigned *height)
@ -3402,13 +3404,19 @@ static const video_poke_interface_t gl_poke_interface = {
#if defined(HAVE_MENU)
gl_set_texture_frame,
gl_set_texture_enable,
#endif
gl_set_osd_msg,
gl_show_mouse,
#else
NULL,
NULL,
NULL,
NULL,
#endif
NULL,
#ifdef HAVE_MENU
gl_get_current_shader,
#endif
};
static void gl_get_poke_interface(void *data,

View File

@ -691,6 +691,7 @@ static void sdl2_poke_apply_state_changes(void *data)
vid->should_resize = true;
}
#ifdef HAVE_MENU
static void sdl2_poke_set_texture_frame(void *data, const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha)
{
@ -738,6 +739,7 @@ static void sdl2_grab_mouse_toggle(void *data)
sdl2_video_t *vid = (sdl2_video_t*)data;
SDL_SetWindowGrab(vid->window, SDL_GetWindowGrab(vid->window));
}
#endif
static video_poke_interface_t sdl2_video_poke_interface = {
NULL,
@ -752,10 +754,16 @@ static video_poke_interface_t sdl2_video_poke_interface = {
#ifdef HAVE_MENU
sdl2_poke_set_texture_frame,
sdl2_poke_texture_enable,
#endif
sdl2_poke_set_osd_msg,
sdl2_show_mouse,
sdl2_grab_mouse_toggle,
#else
NULL,
NULL,
NULL,
NULL,
NULL<
#endif
NULL,
};

View File

@ -963,7 +963,6 @@ static void thread_set_texture_enable(void *data, bool state, bool full_screen)
thr->texture.full_screen = full_screen;
slock_unlock(thr->frame.lock);
}
#endif
static void thread_set_osd_msg(void *data, const char *msg,
const struct font_params *params, void *font)
@ -978,6 +977,7 @@ static void thread_set_osd_msg(void *data, const char *msg,
if (thr->poke && thr->poke->set_osd_msg)
thr->poke->set_osd_msg(thr->driver_data, msg, params, font);
}
#endif
static void thread_apply_state_changes(void *data)
{
@ -1014,9 +1014,12 @@ static const video_poke_interface_t thread_poke = {
#if defined(HAVE_MENU)
thread_set_texture_frame,
thread_set_texture_enable,
thread_set_osd_msg,
#else
NULL,
NULL,
#endif
thread_set_osd_msg,
NULL,
NULL,

View File

@ -19,6 +19,7 @@
#include <ctype.h>
#include "../general.h"
#include "keyboard_line.h"
struct input_keyboard_line
{

View File

@ -5363,7 +5363,7 @@ static bool setting_append_list_menu_options(
#ifdef HAVE_THREADS
CONFIG_BOOL(
settings->menu.threaded_data_runloop_enable,
settings->threaded_data_runloop_enable,
menu_hash_to_str(MENU_LABEL_THREADED_DATA_RUNLOOP_ENABLE),
menu_hash_to_str(MENU_LABEL_VALUE_THREADED_DATA_RUNLOOP_ENABLE),
threaded_data_runloop_enable,

View File

@ -50,6 +50,8 @@
#include "git_version.h"
#include "retroarch.h"
#ifdef HAVE_MENU
#include "menu/menu.h"
#include "menu/menu_hash.h"
@ -337,8 +339,11 @@ void set_paths_redirect(const char *path)
global->dir.savestate,
sizeof(current_savestate_dir));
if(global_library_name_hash != 0 &&
(global_library_name_hash != MENU_VALUE_NO_CORE))
if(global_library_name_hash != 0
#ifdef HAVE_MENU
&& (global_library_name_hash != MENU_VALUE_NO_CORE)
#endif
)
{
/* per-core saves: append the library_name to the save location */
if (settings->sort_savefiles_enable && global->dir.savefile[0] != '\0')
@ -1491,8 +1496,10 @@ void rarch_playlist_load_content(void *data, unsigned idx)
char *path_tolower = NULL;
RFILE *fp = NULL;
content_playlist_t *playlist = (content_playlist_t*)data;
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
#ifdef HAVE_MENU
menu_handle_t *menu = menu_driver_get_ptr();
#endif
if (!playlist)
return;
@ -1529,8 +1536,10 @@ void rarch_playlist_load_content(void *data, unsigned idx)
strlcpy(settings->libretro, core_path, sizeof(settings->libretro));
#ifdef HAVE_MENU
if (menu)
menu->load_no_content = (path) ? false : true;
#endif
rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)path);
@ -1562,7 +1571,9 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
size_t supported = 0;
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
#ifdef HAVE_MENU
uint32_t menu_label_hash = msg_hash_calculate(menu_label);
#endif
fill_pathname_join(s, dir, path, len);
@ -1580,6 +1591,7 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
core_info_list_get_supported_cores(core_info, s, &info,
&supported);
#ifdef HAVE_MENU
if (menu_label_hash == MENU_LABEL_LOAD_CONTENT)
{
info = (const core_info_t*)&global->core_info.current;
@ -1591,6 +1603,7 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
}
}
else
#endif
strlcpy(new_core_path, info->path, sizeof(new_core_path));
/* There are multiple deferred cores and a

View File

@ -746,6 +746,7 @@ FILE *retro_main_log_file(void)
return global->log_file;
}
#ifdef HAVE_MENU
static bool rarch_main_cmd_get_state_menu_toggle_button_combo(
driver_t *driver, settings_t *settings,
retro_input_t input, retro_input_t old_input,
@ -776,6 +777,7 @@ static bool rarch_main_cmd_get_state_menu_toggle_button_combo(
driver->flushing_input = true;
return true;
}
#endif
static void rarch_main_cmd_get_state(driver_t *driver,
settings_t *settings, event_cmd_state_t *cmd,
@ -946,7 +948,11 @@ int rarch_main_iterate(unsigned *sleep_ms)
if (cmd.overlay_next_pressed)
event_command(EVENT_CMD_OVERLAY_NEXT);
if (!main_is_paused || menu_driver_alive())
if (!main_is_paused
#ifdef HAVE_MENU
|| menu_driver_alive()
#endif
)
{
if (cmd.fullscreen_toggle)
event_command(EVENT_CMD_FULLSCREEN_TOGGLE);

View File

@ -105,9 +105,11 @@ void rarch_main_data_free(void)
static void data_runloop_iterate(bool is_thread)
{
rarch_main_data_nbio_iterate (is_thread);
#ifdef HAVE_MENU
#ifdef HAVE_RPNG
rarch_main_data_nbio_image_iterate (is_thread);
#endif
#endif
#ifdef HAVE_NETWORKING
rarch_main_data_http_iterate (is_thread);
#endif
@ -226,7 +228,7 @@ void rarch_main_data_iterate(void)
(void)settings;
#ifdef HAVE_THREADS
if (settings->menu.threaded_data_runloop_enable)
if (settings->threaded_data_runloop_enable)
{
switch (g_data_runloop.thread_code)
{
@ -244,8 +246,10 @@ void rarch_main_data_iterate(void)
rarch_main_data_overlay_image_upload_iterate(false);
#endif
#ifdef HAVE_RPNG
#ifdef HAVE_MENU
rarch_main_data_nbio_image_upload_iterate(false);
#endif
#endif
#ifdef HAVE_OVERLAY
rarch_main_data_overlay_iterate (false);
#endif
@ -261,7 +265,7 @@ void rarch_main_data_iterate(void)
}
#ifdef HAVE_THREADS
if (settings->menu.threaded_data_runloop_enable && g_data_runloop.alive)
if (settings->threaded_data_runloop_enable && g_data_runloop.alive)
return;
#endif
@ -355,7 +359,7 @@ void rarch_main_data_msg_queue_push(unsigned type,
msg_queue_push(queue, new_msg, prio, duration);
#ifdef HAVE_THREADS
if (settings->menu.threaded_data_runloop_enable)
if (settings->threaded_data_runloop_enable)
{
if (!g_data_runloop.thread_inited)
rarch_main_data_thread_init();

View File

@ -413,6 +413,7 @@ static int cb_nbio_default(void *data, size_t len)
}
#ifdef HAVE_RPNG
#ifdef HAVE_MENU
static int cb_nbio_generic(nbio_handle_t *nbio, size_t *len)
{
void *ptr = NULL;
@ -477,6 +478,7 @@ static int cb_nbio_image_menu_boxart(void *data, size_t len)
return cb_nbio_generic(nbio, &len);
}
#endif
#endif
static int rarch_main_data_nbio_iterate_poll(nbio_handle_t *nbio)
{

View File

@ -74,6 +74,7 @@ int cb_core_content_list(void *data_, size_t len);
static http_handle_t *http_ptr;
#ifdef HAVE_ZLIB
#ifdef HAVE_MENU
static int zlib_extract_core_callback(const char *name, const char *valid_exts,
const uint8_t *cdata, unsigned cmode, uint32_t csize, uint32_t size,
uint32_t crc32, void *userdata)
@ -106,7 +107,9 @@ error:
return 0;
}
#endif
#endif
#ifdef HAVE_MENU
static int cb_generic_download(void *data, size_t len,
const char *dir_path)
{
@ -226,6 +229,7 @@ static int cb_update_cheats(void *data, size_t len)
settings_t *settings = config_get_ptr();
return cb_generic_download(data, len, settings->cheat_database);
}
#endif
static int rarch_main_data_http_con_iterate_transfer(http_handle_t *http)
{
@ -292,6 +296,7 @@ static int cb_http_conn_default(void *data_, size_t len)
switch (label_hash)
{
#ifdef HAVE_MENU
case CB_CORE_UPDATER_DOWNLOAD:
http->cb = &cb_core_updater_download;
break;
@ -328,6 +333,9 @@ static int cb_http_conn_default(void *data_, size_t len)
case CB_UPDATE_OVERLAYS:
http->cb = &cb_update_overlays;
break;
#endif
default:
break;
}
}