Skip to content

Commit

Permalink
Allow building RetroArch with menu disabled (libretro#16881)
Browse files Browse the repository at this point in the history
* allow building with --disable-menu --disable-cheevos --disable-qt --disable-slang

* allow building with cheevos while disabling menus and qt
  • Loading branch information
kwyxz authored and Sunderland93 committed Dec 26, 2024
1 parent ba9deab commit 2b86afa
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 8 deletions.
15 changes: 11 additions & 4 deletions cheevos/cheevos_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@
#include "../gfx/gfx_display.h"
#include "../file_path_special.h"

#ifdef HAVE_MENU

#include "cheevos.h"

#include "../deps/rcheevos/include/rc_runtime_types.h"
#include "../deps/rcheevos/include/rc_api_runtime.h"
#include "../deps/rcheevos/src/rc_client_internal.h"

#if HAVE_MENU

#include "../menu/menu_driver.h"
#include "../menu/menu_entries.h"

#endif

#include <features/features_cpu.h>
#include <retro_assert.h>

Expand All @@ -43,6 +45,8 @@

#ifdef HAVE_RC_CLIENT

#if HAVE_MENU

bool rcheevos_menu_get_state(unsigned menu_offset, char* buffer, size_t buffer_size)
{
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
Expand Down Expand Up @@ -512,6 +516,7 @@ void rcheevos_menu_populate(void* data)
}
}

#endif /* HAVE_MENU */

uintptr_t rcheevos_get_badge_texture(const char* badge, bool locked, bool download_if_missing)
{
Expand Down Expand Up @@ -574,6 +579,8 @@ uintptr_t rcheevos_get_badge_texture(const char* badge, bool locked, bool downlo

#else /* !HAVE_RC_CLIENT */

#if HAVE_MENU

enum rcheevos_menuitem_bucket
{
RCHEEVOS_MENUITEM_BUCKET_UNKNOWN = 0,
Expand Down Expand Up @@ -1193,6 +1200,8 @@ void rcheevos_menu_populate(void* data)
}
}

#endif /* HAVE_MENU */

uintptr_t rcheevos_get_badge_texture(const char *badge, bool locked, bool download_if_missing)
{
if (badge)
Expand Down Expand Up @@ -1222,5 +1231,3 @@ uintptr_t rcheevos_get_badge_texture(const char *badge, bool locked, bool downlo
}

#endif /* HAVE_RC_CLIENT */

#endif /* HAVE_MENU */
2 changes: 2 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,9 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("run_ahead_hide_warnings", &settings->bools.run_ahead_hide_warnings, true, DEFAULT_RUN_AHEAD_HIDE_WARNINGS, false);
SETTING_BOOL("preemptive_frames_enable", &settings->bools.preemptive_frames_enable, true, false, false);
SETTING_BOOL("preemptive_frames_hide_warnings", &settings->bools.preemptive_frames_hide_warnings, true, DEFAULT_PREEMPT_HIDE_WARNINGS, false);
#if HAVE_MENU
SETTING_BOOL("kiosk_mode_enable", &settings->bools.kiosk_mode_enable, true, DEFAULT_KIOSK_MODE_ENABLE, false);
#endif
SETTING_BOOL("block_sram_overwrite", &settings->bools.block_sram_overwrite, true, DEFAULT_BLOCK_SRAM_OVERWRITE, false);
SETTING_BOOL("replay_auto_index", &settings->bools.replay_auto_index, true, DEFAULT_REPLAY_AUTO_INDEX, false);
SETTING_BOOL("savestate_auto_index", &settings->bools.savestate_auto_index, true, DEFAULT_SAVESTATE_AUTO_INDEX, false);
Expand Down
15 changes: 15 additions & 0 deletions gfx/video_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3473,10 +3473,15 @@ void video_driver_frame(const void *data, unsigned width,
* current frame is not (i.e. if core was
* previously sending duped frames, ensure
* that the next frame update is captured) */
#if HAVE_MENU
if ( video_info.input_driver_nonblock_state
&& video_info.fastforward_frameskip
&& !((video_info.menu_st_flags & MENU_ST_FLAG_ALIVE)
|| (last_frame_duped && !!data)))
#else
if ( video_info.input_driver_nonblock_state
&& video_info.fastforward_frameskip)
#endif
{
retro_time_t frame_time_accumulator_prev = frame_time_accumulator;
retro_time_t frame_time_delta = new_time - last_time;
Expand Down Expand Up @@ -3788,7 +3793,11 @@ void video_driver_frame(const void *data, unsigned width,
msg_entry.category,
msg_entry.prio,
false,
#if HAVE_MENU
(video_info.menu_st_flags & MENU_ST_FLAG_ALIVE) ? true : false
#else
false
#endif
);
}
/* ...otherwise, just output message via
Expand Down Expand Up @@ -3972,8 +3981,12 @@ void video_driver_frame(const void *data, unsigned width,
if (video_st->current_video->frame(
video_st->data, data, width, height,
video_st->frame_count, (unsigned)pitch,
#if HAVE_MENU
((video_info.menu_st_flags & MENU_ST_FLAG_SCREENSAVER_ACTIVE) > 0)
|| video_info.notifications_hidden ? "" : video_driver_msg,
#else
video_info.notifications_hidden ? "" : video_driver_msg,
#endif
&video_info))
video_st->flags |= VIDEO_FLAG_ACTIVE;
else
Expand All @@ -3988,7 +4001,9 @@ void video_driver_frame(const void *data, unsigned width,
|| video_info.memory_show
|| video_info.core_status_msg_show
)
#if HAVE_MENU
&& !((video_info.menu_st_flags & MENU_ST_FLAG_SCREENSAVER_ACTIVE))
#endif
&& !video_info.notifications_hidden
)
{
Expand Down
2 changes: 1 addition & 1 deletion gfx/widgets/gfx_widget_achievement_popup.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "../gfx_display.h"
#include "../gfx_widgets.h"

#include "../cheevos/cheevos.h"
#include "../../cheevos/cheevos.h"

#define CHEEVO_NOTIFICATION_DURATION 4000

Expand Down
2 changes: 1 addition & 1 deletion gfx/widgets/gfx_widget_leaderboard_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "../gfx_display.h"
#include "../gfx_widgets.h"

#include "../cheevos/cheevos.h"
#include "../../cheevos/cheevos.h"
#include <features/features_cpu.h>

#define CHEEVO_LBOARD_ARRAY_SIZE 4
Expand Down
2 changes: 2 additions & 0 deletions retroarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -4463,6 +4463,7 @@ bool command_event(enum event_command cmd, void *data)
}
break;
}
#if HAVE_MENU
case CMD_EVENT_ADD_TO_PLAYLIST:
{
struct string_list *str_list = (struct string_list*)data;
Expand Down Expand Up @@ -4533,6 +4534,7 @@ bool command_event(enum event_command cmd, void *data)
}
break;
}
#endif
case CMD_EVENT_RESET_CORE_ASSOCIATION:
{
const char *core_name = "DETECT";
Expand Down
4 changes: 2 additions & 2 deletions runloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -6814,10 +6814,10 @@ static enum runloop_state_enum runloop_check_state(
cbs->poll_cb();
return RUNLOOP_STATE_PAUSE;
}

#if HAVE_MENU
if (menu_was_alive)
return RUNLOOP_STATE_MENU;

#endif
return RUNLOOP_STATE_ITERATE;
}

Expand Down
2 changes: 2 additions & 0 deletions tasks/task_pl_thumbnail_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#ifdef HAVE_MENU
#include "../menu/menu_cbs.h"
#include "../menu/menu_driver.h"
#else
#include <queues/message_queue.h>
#endif
#endif

Expand Down

0 comments on commit 2b86afa

Please sign in to comment.