mirror of
https://github.com/libretro/RetroArch
synced 2025-02-05 06:40:07 +00:00
(Android) Apply the same performance optimizations for RARCH_CONSOLE
to Android - call this compile-time option 'RARCH_PERFORMANCE_MODE'
This commit is contained in:
parent
eb17f80cfa
commit
253741ccf5
26
retroarch.c
26
retroarch.c
@ -52,6 +52,10 @@
|
|||||||
// We want to use -mconsole in Win32, so we need main().
|
// We want to use -mconsole in Win32, so we need main().
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(RARCH_CONSOLE) || defined(ANDROID)
|
||||||
|
#define RARCH_PERFORMANCE_MODE
|
||||||
|
#endif
|
||||||
|
|
||||||
// To avoid continous switching if we hold the button down, we require that the button must go from pressed, unpressed back to pressed to be able to toggle between then.
|
// To avoid continous switching if we hold the button down, we require that the button must go from pressed, unpressed back to pressed to be able to toggle between then.
|
||||||
static void set_fast_forward_button(bool new_button_state, bool new_hold_button_state)
|
static void set_fast_forward_button(bool new_button_state, bool new_hold_button_state)
|
||||||
{
|
{
|
||||||
@ -248,7 +252,7 @@ static void recording_dump_frame(const void *data, unsigned width, unsigned heig
|
|||||||
|
|
||||||
static void video_frame(const void *data, unsigned width, unsigned height, size_t pitch)
|
static void video_frame(const void *data, unsigned width, unsigned height, size_t pitch)
|
||||||
{
|
{
|
||||||
#ifndef RARCH_CONSOLE
|
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||||
if (!g_extern.video_active)
|
if (!g_extern.video_active)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
@ -1897,7 +1901,7 @@ static void check_savestates(bool immutable)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef RARCH_CONSOLE
|
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||||
static bool check_fullscreen(void)
|
static bool check_fullscreen(void)
|
||||||
{
|
{
|
||||||
// If we go fullscreen we drop all drivers and reinit to be safe.
|
// If we go fullscreen we drop all drivers and reinit to be safe.
|
||||||
@ -2145,7 +2149,7 @@ static void check_movie(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RARCH_CONSOLE
|
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||||
static void check_pause(void)
|
static void check_pause(void)
|
||||||
{
|
{
|
||||||
static bool old_state = false;
|
static bool old_state = false;
|
||||||
@ -2370,7 +2374,7 @@ static void check_dsp_config(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RARCH_CONSOLE
|
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||||
static void check_mute(void)
|
static void check_mute(void)
|
||||||
{
|
{
|
||||||
if (!g_extern.audio_active)
|
if (!g_extern.audio_active)
|
||||||
@ -2410,7 +2414,7 @@ static void do_state_checks(void)
|
|||||||
#if defined(HAVE_SCREENSHOTS) && !defined(_XBOX)
|
#if defined(HAVE_SCREENSHOTS) && !defined(_XBOX)
|
||||||
check_screenshot();
|
check_screenshot();
|
||||||
#endif
|
#endif
|
||||||
#ifndef RARCH_CONSOLE
|
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||||
check_mute();
|
check_mute();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2420,12 +2424,12 @@ static void do_state_checks(void)
|
|||||||
if (!g_extern.netplay)
|
if (!g_extern.netplay)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
#ifndef RARCH_CONSOLE
|
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||||
check_pause();
|
check_pause();
|
||||||
#endif
|
#endif
|
||||||
check_oneshot();
|
check_oneshot();
|
||||||
|
|
||||||
#ifdef RARCH_CONSOLE
|
#if defined(RARCH_PERFORMANCE_MODE)
|
||||||
if (g_extern.is_paused)
|
if (g_extern.is_paused)
|
||||||
#else
|
#else
|
||||||
if (check_fullscreen() && g_extern.is_paused)
|
if (check_fullscreen() && g_extern.is_paused)
|
||||||
@ -2434,7 +2438,7 @@ static void do_state_checks(void)
|
|||||||
rarch_render_cached_frame();
|
rarch_render_cached_frame();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef RARCH_CONSOLE
|
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||||
if (g_extern.is_paused && !g_extern.is_oneshot)
|
if (g_extern.is_paused && !g_extern.is_oneshot)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
@ -2471,7 +2475,7 @@ static void do_state_checks(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
check_netplay_flip();
|
check_netplay_flip();
|
||||||
#ifndef RARCH_CONSOLE
|
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||||
check_fullscreen();
|
check_fullscreen();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -2672,7 +2676,7 @@ bool rarch_main_iterate(void)
|
|||||||
do_state_checks();
|
do_state_checks();
|
||||||
|
|
||||||
// Run libretro for one frame.
|
// Run libretro for one frame.
|
||||||
#ifndef RARCH_CONSOLE // On consoles pausing is handled better elsewhere.
|
#if !defined(RARCH_PERFORMANCE_MODE) // On consoles pausing is handled better elsewhere.
|
||||||
if (!g_extern.is_paused || g_extern.is_oneshot)
|
if (!g_extern.is_paused || g_extern.is_oneshot)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -2706,7 +2710,7 @@ bool rarch_main_iterate(void)
|
|||||||
unlock_autosave();
|
unlock_autosave();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef RARCH_CONSOLE
|
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
input_poll();
|
input_poll();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user