(RMenu) Add rewind_granularity option

This commit is contained in:
twinaphex 2013-01-19 08:54:03 +01:00
parent f073eefe80
commit 5d33861c8b
3 changed files with 18 additions and 0 deletions

View File

@ -308,6 +308,11 @@ static void populate_setting_item(void *data, unsigned input)
else
snprintf(current_item->comment, sizeof(current_item->comment), "INFO - [Rewind] feature is set to 'OFF'.");
break;
case SETTING_EMU_REWIND_GRANULARITY:
snprintf(current_item->text, sizeof(current_item->text), "Rewind granularity");
snprintf(current_item->setting_text, sizeof(current_item->setting_text), "%d", g_settings.rewind_granularity);
snprintf(current_item->comment, sizeof(current_item->comment), "INFO - Set the amount of frames to 'rewind'.\nIncrease this to lower CPU usage.");
break;
#ifdef HAVE_ZLIB
case SETTING_ZIP_EXTRACT:
snprintf(current_item->text, sizeof(current_item->text), "Unzip mode");
@ -1394,6 +1399,17 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
if(input & (1ULL << RMENU_DEVICE_NAV_START))
g_settings.rewind_enable = false;
break;
case SETTING_EMU_REWIND_GRANULARITY:
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))
{
if (g_settings.rewind_granularity > 1)
g_settings.rewind_granularity--;
}
if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
g_settings.rewind_granularity++;
if(input & (1ULL << RMENU_DEVICE_NAV_START))
g_settings.rewind_granularity = 1;
break;
#ifdef HAVE_ZLIB
case SETTING_ZIP_EXTRACT:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)))

View File

@ -146,6 +146,7 @@ enum
SETTING_QUIT_RARCH,
SETTING_EMU_DEFAULT_ALL,
SETTING_EMU_REWIND_ENABLED,
SETTING_EMU_REWIND_GRANULARITY,
SETTING_EMU_VIDEO_DEFAULT_ALL,
#ifdef _XBOX1
SETTING_EMU_AUDIO_SOUND_VOLUME_LEVEL,

View File

@ -1168,6 +1168,7 @@ bool config_save_file(const char *path)
config_set_string(conf, "libretro_path", g_settings.libretro);
config_set_string(conf, "cheat_database_path", g_settings.cheat_database);
config_set_bool(conf, "rewind_enable", g_settings.rewind_enable);
config_set_int(conf, "rewind_granularity", g_settings.rewind_granularity);
config_set_string(conf, "video_cg_shader", g_settings.video.cg_shader_path);
config_set_float(conf, "video_aspect_ratio", g_settings.video.aspect_ratio);
#ifdef HAVE_FBO