(RMenu) Split up more settings into rmenu_settings

This commit is contained in:
twinaphex 2013-01-13 08:04:06 +01:00
parent 15cbab4876
commit d2a20483fb
3 changed files with 78 additions and 56 deletions

View File

@ -1400,25 +1400,15 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
break;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW);
}
rmenu_settings_set(S_INFO_DEBUG_MSG_TOGGLE);
if(input & (1ULL << RMENU_DEVICE_NAV_START))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
rmenu_settings_set_default(S_DEF_INFO_DEBUG_MSG);
break;
case SETTING_EMU_SHOW_INFO_MSG:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INFO_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_INFO_DRAW);
}
rmenu_settings_set(S_INFO_MSG_TOGGLE);
if(input & (1ULL << RMENU_DEVICE_NAV_START))
g_extern.lifecycle_mode_state |= (1ULL << MODE_INFO_DRAW);
rmenu_settings_set_default(S_DEF_INFO_MSG);
break;
case SETTING_EMU_REWIND_ENABLED:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
@ -1434,50 +1424,11 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
#ifdef HAVE_ZLIB
case SETTING_ZIP_EXTRACT:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CACHEDIR))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CACHEDIR);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
}
}
rmenu_settings_set(S_UNZIP_MODE_DECREMENT);
if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CACHEDIR);
}
}
rmenu_settings_set(S_UNZIP_MODE_INCREMENT);
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
g_extern.lifecycle_mode_state &= ~((1ULL << MODE_UNZIP_TO_CURDIR) |
(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE) |
(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN) |
(1ULL << MODE_UNZIP_TO_CACHEDIR));
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
}
rmenu_settings_set_default(S_DEF_UNZIP_MODE);
break;
#endif
case SETTING_RARCH_DEFAULT_EMU:

View File

@ -135,6 +135,55 @@ void rmenu_settings_set(unsigned setting)
case S_REFRESH_RATE_INCREMENT:
g_settings.video.refresh_rate += 0.01f;
break;
case S_UNZIP_MODE_DECREMENT:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CACHEDIR))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CACHEDIR);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
}
break;
case S_UNZIP_MODE_INCREMENT:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CACHEDIR);
}
break;
case S_INFO_DEBUG_MSG_TOGGLE:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW);
break;
case S_INFO_MSG_TOGGLE:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INFO_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_INFO_DRAW);
break;
default:
RARCH_WARN("rmenu_settings_set - unhandled action.\n");
}
}
@ -196,6 +245,21 @@ void rmenu_settings_set_default(unsigned setting)
g_settings.video.refresh_rate = 59.95;
#endif
break;
case S_DEF_UNZIP_MODE:
g_extern.lifecycle_mode_state &= ~((1ULL << MODE_UNZIP_TO_CURDIR) |
(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE) |
(1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE_AND_CLEAN) |
(1ULL << MODE_UNZIP_TO_CACHEDIR));
g_extern.lifecycle_mode_state |= (1ULL << MODE_UNZIP_TO_CURDIR_AND_LOAD_FIRST_FILE);
break;
case S_DEF_INFO_DEBUG_MSG:
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
break;
case S_DEF_INFO_MSG:
g_extern.lifecycle_mode_state |= (1ULL << MODE_INFO_DRAW);
break;
default:
RARCH_WARN("rmenu_settings_set_default: unhandled action.\n");
}
}

View File

@ -53,6 +53,10 @@ enum
S_TRIPLE_BUFFERING,
S_REFRESH_RATE_DECREMENT,
S_REFRESH_RATE_INCREMENT,
S_UNZIP_MODE_DECREMENT,
S_UNZIP_MODE_INCREMENT,
S_INFO_DEBUG_MSG_TOGGLE,
S_INFO_MSG_TOGGLE,
};
enum
@ -70,6 +74,9 @@ enum
S_DEF_SCALE_ENABLED,
S_DEF_SCALE_FACTOR,
S_DEF_REFRESH_RATE,
S_DEF_UNZIP_MODE,
S_DEF_INFO_DEBUG_MSG,
S_DEF_INFO_MSG,
};
enum