Reduce calls to 'draw_frame' to one

This commit is contained in:
twinaphex 2014-10-08 21:43:19 +02:00
parent fb5510f2ac
commit 80578199f6
2 changed files with 8 additions and 10 deletions

View File

@ -20,15 +20,12 @@
#include "menu_shader.h" #include "menu_shader.h"
#include "../frontend.h" #include "../frontend.h"
static void draw_frame(bool enable) static void draw_frame(void)
{ {
if (driver.video_data && driver.video_poke && if (driver.video_data && driver.video_poke &&
driver.video_poke->set_texture_enable) driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, driver.video_poke->set_texture_enable(driver.video_data,
enable, MENU_TEXTURE_FULLSCREEN); true, MENU_TEXTURE_FULLSCREEN);
if (!enable || !driver.video)
return;
if (!g_settings.menu.pause_libretro) if (!g_settings.menu.pause_libretro)
{ {
@ -38,7 +35,6 @@ static void draw_frame(bool enable)
driver.block_libretro_input = true; driver.block_libretro_input = true;
pretro_run(); pretro_run();
driver.block_libretro_input = block_libretro_input; driver.block_libretro_input = block_libretro_input;
return; return;
} }
} }
@ -111,8 +107,7 @@ bool load_menu_content(void)
driver.menu_ctx->backend->iterate) driver.menu_ctx->backend->iterate)
driver.menu_ctx->backend->iterate(MENU_ACTION_NOOP); driver.menu_ctx->backend->iterate(MENU_ACTION_NOOP);
draw_frame(true); draw_frame();
draw_frame(false);
if (!(main_load_content(0, NULL, NULL, menu_environment_get, if (!(main_load_content(0, NULL, NULL, menu_environment_get,
driver.frontend_ctx->process_args))) driver.frontend_ctx->process_args)))
@ -356,8 +351,7 @@ int menu_iterate(retro_input_t input,
&& driver.menu_ctx->backend->iterate) && driver.menu_ctx->backend->iterate)
ret = driver.menu_ctx->backend->iterate(action); ret = driver.menu_ctx->backend->iterate(action);
draw_frame(true); draw_frame();
draw_frame(false);
if (driver.menu_ctx && driver.menu_ctx->input_postprocess) if (driver.menu_ctx && driver.menu_ctx->input_postprocess)
driver.menu_ctx->input_postprocess(input, old_input); driver.menu_ctx->input_postprocess(input, old_input);

View File

@ -2034,6 +2034,10 @@ void rarch_main_set_state(unsigned cmd)
/* Restore libretro keyboard callback. */ /* Restore libretro keyboard callback. */
g_extern.system.key_event = g_extern.frontend_key_event; g_extern.system.key_event = g_extern.frontend_key_event;
#endif #endif
if (driver.video_data && driver.video_poke &&
driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data,
false, MENU_TEXTURE_FULLSCREEN);
break; break;
case RARCH_ACTION_STATE_QUIT: case RARCH_ACTION_STATE_QUIT:
g_extern.system.shutdown = true; g_extern.system.shutdown = true;