Move create_menu_item_label to rmenu_xui.cpp

This commit is contained in:
twinaphex 2013-03-23 18:11:03 +01:00
parent c9673dbae6
commit 9058143953
5 changed files with 42 additions and 61 deletions

View File

@ -68,39 +68,3 @@ void menu_settings_msg(unsigned setting, unsigned delay)
msg_queue_push(g_extern.msg_queue, str, 1, delay);
}
void menu_settings_create_menu_item_label(char * str, unsigned setting, size_t size)
{
switch (setting)
{
case S_LBL_ASPECT_RATIO:
snprintf(str, size, "Aspect Ratio: %s", aspectratio_lut[g_settings.video.aspect_ratio_idx].name);
break;
case S_LBL_SHADER:
snprintf(str, size, "Shader #1: %s", g_settings.video.cg_shader_path);
break;
case S_LBL_SHADER_2:
snprintf(str, size, "Shader #2: %s", g_settings.video.second_pass_shader);
break;
case S_LBL_RARCH_VERSION:
#if !defined(__BLACKBERRY_QNX__) && !defined(IOS)
snprintf(str, size, "RetroArch %s", PACKAGE_VERSION);
#endif
break;
case S_LBL_SCALE_FACTOR:
snprintf(str, size, "Scale Factor: %f (X) / %f (Y)", g_settings.video.fbo.scale_x, g_settings.video.fbo.scale_y);
break;
case S_LBL_ROTATION:
snprintf(str, size, "Rotation: %s", rotation_lut[g_extern.console.screen.orientation]);
break;
case S_LBL_LOAD_STATE_SLOT:
snprintf(str, size, "Load State #%d", g_extern.state_slot);
break;
case S_LBL_SAVE_STATE_SLOT:
snprintf(str, size, "Save State #%d", g_extern.state_slot);
break;
case S_LBL_REWIND_GRANULARITY:
snprintf(str, size, "Rewind granularity: %d", g_settings.rewind_granularity);
break;
}
}

View File

@ -31,20 +31,6 @@ enum
S_MSG_SHADER_LOADING_SUCCEEDED
};
enum
{
S_LBL_ASPECT_RATIO = 0,
S_LBL_RARCH_VERSION,
S_LBL_ROTATION,
S_LBL_SHADER,
S_LBL_SHADER_2,
S_LBL_SCALE_FACTOR,
S_LBL_LOAD_STATE_SLOT,
S_LBL_SAVE_STATE_SLOT,
S_LBL_REWIND_GRANULARITY,
};
void menu_settings_msg(unsigned setting, unsigned delay);
void menu_settings_create_menu_item_label(char * str, unsigned setting, size_t size);
#endif

View File

@ -477,11 +477,8 @@ static void render_text(rgui_handle_t *rgui)
snprintf(type_str, sizeof(type_str), "%.2f", g_extern.console.screen.overscan_amount);
break;
case RGUI_SETTINGS_VIDEO_ROTATION:
{
char rotate_msg[64];
menu_settings_create_menu_item_label(rotate_msg, S_LBL_ROTATION, sizeof(rotate_msg));
strlcpy(type_str, rotate_msg, sizeof(type_str));
}
snprintf(type_str, sizeof(type_str), "Rotation: %s",
rotation_lut[g_extern.console.screen.orientation]);
break;
case RGUI_SETTINGS_AUDIO_MUTE:
if (g_extern.audio_data.mute)

View File

@ -3074,7 +3074,7 @@ int ingame_menu(void *data, void *state)
if (driver.video_poke->set_osd_msg)
driver.video_poke->set_osd_msg(driver.video_data, strw_buffer, &font_parms);
menu_settings_create_menu_item_label(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
snprintf(strw_buffer, sizeof(strw_buffer), "Load State #%d", g_extern.state_slot);
font_parms.y = default_pos.y_position;
font_parms.color = MENU_ITEM_SELECTED(MENU_ITEM_LOAD_STATE);
@ -3082,7 +3082,7 @@ int ingame_menu(void *data, void *state)
if (driver.video_poke->set_osd_msg)
driver.video_poke->set_osd_msg(driver.video_data, strw_buffer, &font_parms);
menu_settings_create_menu_item_label(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
snprintf(strw_buffer, sizeof(strw_buffer), "Save State #%d", g_extern.state_slot);
font_parms.y = default_pos.y_position + (default_pos.y_position_increment * MENU_ITEM_SAVE_STATE);
font_parms.color = MENU_ITEM_SELECTED(MENU_ITEM_SAVE_STATE);
@ -3090,7 +3090,8 @@ int ingame_menu(void *data, void *state)
if (driver.video_poke->set_osd_msg)
driver.video_poke->set_osd_msg(driver.video_data, strw_buffer, &font_parms);
menu_settings_create_menu_item_label(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
snprintf(strw_buffer, sizeof(strw_buffer), "Aspect Ratio: %s",
aspectratio_lut[g_settings.video.aspect_ratio_idx].name);
font_parms.y = default_pos.y_position + (default_pos.y_position_increment * MENU_ITEM_KEEP_ASPECT_RATIO);
font_parms.color = MENU_ITEM_SELECTED(MENU_ITEM_KEEP_ASPECT_RATIO);
@ -3106,7 +3107,7 @@ int ingame_menu(void *data, void *state)
if (driver.video_poke->set_osd_msg)
driver.video_poke->set_osd_msg(driver.video_data, strw_buffer, &font_parms);
menu_settings_create_menu_item_label(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
snprintf(strw_buffer, sizeof(strw_buffer), "Rotation: %s", rotation_lut[g_extern.console.screen.orientation]);
font_parms.y = default_pos.y_position + (default_pos.y_position_increment * MENU_ITEM_ORIENTATION);
font_parms.color = MENU_ITEM_SELECTED(MENU_ITEM_ORIENTATION);
@ -3115,7 +3116,8 @@ int ingame_menu(void *data, void *state)
driver.video_poke->set_osd_msg(driver.video_data, strw_buffer, &font_parms);
#ifdef HAVE_FBO
menu_settings_create_menu_item_label(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
snprintf(strw_buffer, sizeof(strw_buffer), "Scale Factor: %f (X) / %f (Y)",
g_settings.video.fbo.scale_x, g_settings.video.fbo.scale_y);
font_parms.y = default_pos.y_position + (default_pos.y_position_increment * MENU_ITEM_SCALE_FACTOR);
font_parms.color = MENU_ITEM_SELECTED(MENU_ITEM_SCALE_FACTOR);

View File

@ -268,7 +268,39 @@ static void menu_settings_create_menu_item_label_w(wchar_t *strwbuf, unsigned se
{
char str[PATH_MAX];
menu_settings_create_menu_item_label(str, setting, sizeof(str));
switch (setting)
{
case S_LBL_ASPECT_RATIO:
snprintf(str, size, "Aspect Ratio: %s", aspectratio_lut[g_settings.video.aspect_ratio_idx].name);
break;
case S_LBL_SHADER:
snprintf(str, size, "Shader #1: %s", g_settings.video.cg_shader_path);
break;
case S_LBL_SHADER_2:
snprintf(str, size, "Shader #2: %s", g_settings.video.second_pass_shader);
break;
case S_LBL_RARCH_VERSION:
#if !defined(__BLACKBERRY_QNX__) && !defined(IOS)
snprintf(str, size, "RetroArch %s", PACKAGE_VERSION);
#endif
break;
case S_LBL_SCALE_FACTOR:
snprintf(str, size, "Scale Factor: %f (X) / %f (Y)", g_settings.video.fbo.scale_x, g_settings.video.fbo.scale_y);
break;
case S_LBL_ROTATION:
snprintf(str, size, "Rotation: %s", rotation_lut[g_extern.console.screen.orientation]);
break;
case S_LBL_LOAD_STATE_SLOT:
snprintf(str, size, "Load State #%d", g_extern.state_slot);
break;
case S_LBL_SAVE_STATE_SLOT:
snprintf(str, size, "Save State #%d", g_extern.state_slot);
break;
case S_LBL_REWIND_GRANULARITY:
snprintf(str, size, "Rewind granularity: %d", g_settings.rewind_granularity);
break;
}
convert_char_to_wchar(strwbuf, str, size);
}