(RMenu) Rmenu now uses g_settings.video.font_size

This commit is contained in:
twinaphex 2013-01-11 21:04:51 +01:00
parent 09f4482016
commit c7adeb9ed0
8 changed files with 35 additions and 26 deletions

View File

@ -216,7 +216,11 @@ static const bool aspect_ratio_auto = false; // 1:1 PAR
static const bool crop_overscan = true;
// Font size for on-screen messages.
#ifdef HAVE_RMENU
static const float font_size = 1.0f;
#else
static const unsigned font_size = 48;
#endif
// Attempt to scale the font size.
// The scale factor will be window_size / desktop_size.
static const bool font_scale = true;

View File

@ -162,7 +162,7 @@ static void populate_setting_item(void *data, unsigned input)
#endif
case SETTING_FONT_SIZE:
snprintf(current_item->text, sizeof(current_item->text), "Font Size");
snprintf(current_item->setting_text, sizeof(current_item->setting_text), "%f", g_extern.console.rmenu.font_size);
snprintf(current_item->setting_text, sizeof(current_item->setting_text), "%f", g_settings.video.font_size);
snprintf(current_item->comment, sizeof(current_item->comment), "INFO - Increase or decrease the [Font Size].");
break;
case SETTING_KEEP_ASPECT_RATIO:
@ -1119,16 +1119,16 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
case SETTING_FONT_SIZE:
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))
{
if(g_extern.console.rmenu.font_size > 0)
g_extern.console.rmenu.font_size -= 0.01f;
if(g_settings.video.font_size > 0)
g_settings.video.font_size -= 0.01f;
}
if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
if((g_extern.console.rmenu.font_size < 2.0f))
g_extern.console.rmenu.font_size += 0.01f;
if((g_settings.video.font_size < 2.0f))
g_settings.video.font_size += 0.01f;
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
g_extern.console.rmenu.font_size = 1.0f;
g_settings.video.font_size = 1.0f;
break;
case SETTING_KEEP_ASPECT_RATIO:
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))

View File

@ -43,6 +43,7 @@ wchar_t strw_buffer[PATH_MAX];
char str_buffer[PATH_MAX];
static int process_input_ret = 0;
static unsigned input_loop = 0;
enum
{
@ -843,7 +844,7 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
driver.video->set_rotation(driver.video_data, g_extern.console.screen.orientation);
break;
case MENU_ITEM_RESIZE_MODE:
g_extern.console.rmenu.input_loop = INPUT_LOOP_RESIZE_MODE;
input_loop = INPUT_LOOP_RESIZE_MODE;
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESIZE_SCREEN, S_DELAY_270);
@ -1029,7 +1030,7 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
if ( hObjPressed == m_filebrowser )
{
g_extern.console.rmenu.input_loop = INPUT_LOOP_FILEBROWSER;
input_loop = INPUT_LOOP_FILEBROWSER;
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_filebrowser.xur", NULL, &app.hFileBrowser);
if (hr < 0)
@ -1202,7 +1203,7 @@ static void ingame_menu_resize (void)
g_extern.console.screen.viewports.custom_vp.height = 720; //FIXME: hardcoded
}
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_B)
g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;
input_loop = INPUT_LOOP_MENU;
}
bool rmenu_iterate(void)
@ -1213,7 +1214,7 @@ bool rmenu_iterate(void)
if (g_extern.lifecycle_menu_state & (1 << MODE_MENU_PREINIT))
{
g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;
input_loop = INPUT_LOOP_MENU;
g_extern.lifecycle_menu_state |= (1 << MODE_MENU_DRAW);
g_extern.lifecycle_menu_state &= ~(1 << MODE_MENU_PREINIT);
}
@ -1249,7 +1250,7 @@ bool rmenu_iterate(void)
rarch_render_cached_frame();
switch(g_extern.console.rmenu.input_loop)
switch(input_loop)
{
case INPUT_LOOP_FILEBROWSER:
case INPUT_LOOP_MENU:

View File

@ -168,7 +168,11 @@ struct settings
char shader_dir[PATH_MAX];
char font_path[PATH_MAX];
#ifdef HAVE_RMENU
float font_size;
#else
unsigned font_size;
#endif
bool font_enable;
bool font_scale;
float msg_pos_x;
@ -506,12 +510,6 @@ struct global
// Settings and/or global state that is specific to a console-style implementation.
struct
{
struct
{
unsigned input_loop;
float font_size;
} rmenu;
struct
{
struct

View File

@ -67,9 +67,6 @@ static PSGLcontext* gl_context;
#define MSG_PREV_NEXT_Y_POSITION 0.03f
#define CURRENT_PATH_Y_POSITION 0.15f
#define CURRENT_PATH_FONT_SIZE FONT_SIZE
#define FONT_SIZE (g_extern.console.rmenu.font_size)
#define NUM_ENTRY_PER_PAGE 15
@ -135,9 +132,9 @@ static void gfx_ctx_ps3_set_default_pos(rmenu_default_positions_t *position)
position->msg_queue_y_position = MSG_QUEUE_Y_POSITION;
position->msg_queue_font_size= MSG_QUEUE_FONT_SIZE;
position->msg_prev_next_y_position = MSG_PREV_NEXT_Y_POSITION;
position->current_path_font_size = CURRENT_PATH_FONT_SIZE;
position->current_path_font_size = g_settings.video.font_size;
position->current_path_y_position = CURRENT_PATH_Y_POSITION;
position->variable_font_size = FONT_SIZE;
position->variable_font_size = g_settings.video.font_size;
position->entries_per_page = NUM_ENTRY_PER_PAGE;
position->core_msg_x_position = 0.3f;
position->core_msg_y_position = 0.06f;

View File

@ -178,6 +178,8 @@ static HRESULT xdk360_video_font_create_shaders (xdk360_video_font_t * font)
static bool xdk_init_font(void *data, const char *font_path, unsigned font_size)
{
(void)font_size;
// Create the font
xdk360_video_font_t *font = &m_Font;

View File

@ -277,7 +277,6 @@ void config_set_defaults(void)
g_extern.audio_data.mute = 0;
g_extern.verbose = true;
g_extern.console.rmenu.font_size = 1.0f;
g_extern.console.sound.mode = SOUND_MODE_NORMAL;
g_extern.console.screen.viewports.custom_vp.width = 0;
g_extern.console.screen.viewports.custom_vp.height = 0;
@ -449,7 +448,11 @@ bool config_load_file(const char *path)
CONFIG_GET_BOOL(video.allow_rotate, "video_allow_rotate");
CONFIG_GET_PATH(video.font_path, "video_font_path");
#ifdef HAVE_RMENU
CONFIG_GET_FLOAT(video.font_size, "video_font_size");
#else
CONFIG_GET_INT(video.font_size, "video_font_size");
#endif
CONFIG_GET_BOOL(video.font_enable, "video_font_enable");
CONFIG_GET_BOOL(video.font_scale, "video_font_scale");
CONFIG_GET_FLOAT(video.msg_pos_x, "video_message_pos_x");
@ -566,7 +569,6 @@ bool config_load_file(const char *path)
CONFIG_GET_INT_EXTERN(console.screen.viewports.custom_vp.y, "custom_viewport_y");
CONFIG_GET_INT_EXTERN(console.screen.viewports.custom_vp.width, "custom_viewport_width");
CONFIG_GET_INT_EXTERN(console.screen.viewports.custom_vp.height, "custom_viewport_height");
CONFIG_GET_FLOAT_EXTERN(console.rmenu.font_size, "menu_font_size");
#endif
unsigned msg_color = 0;
@ -1198,12 +1200,17 @@ bool config_save_file(const char *path)
config_set_int(conf, "custom_viewport_x", g_extern.console.screen.viewports.custom_vp.x);
config_set_int(conf, "custom_viewport_y", g_extern.console.screen.viewports.custom_vp.y);
config_set_string(conf, "default_rom_startup_dir", g_extern.console.main_wrap.paths.default_rom_startup_dir);
config_set_float(conf, "menu_font_size", g_extern.console.rmenu.font_size);
config_set_float(conf, "overscan_amount", g_extern.console.screen.overscan_amount);
#ifdef HAVE_ZLIB
config_set_int(conf, "zip_extract_mode", g_extern.file_state.zip_extract_mode);
#endif
#ifdef HAVE_RMENU
config_set_float(conf, "video_font_size", g_settings.video.font_size);
#else
config_set_int(conf, "video_font_size", g_settings.video.font_size);
#endif
// g_extern
config_set_int(conf, "sound_mode", g_extern.console.sound.mode);
config_set_int(conf, "state_slot", g_extern.state_slot);

View File

@ -947,7 +947,7 @@ static void xdk_d3d_start(void)
#elif defined(_XBOX360)
snprintf(g_settings.video.font_path, sizeof(g_settings.video.font_path), "game:\\media\\Arial_12.xpr");
#endif
d3d->font_ctx = d3d_font_init_first(d3d, g_settings.video.font_path, g_settings.video.font_size);
d3d->font_ctx = d3d_font_init_first(d3d, g_settings.video.font_path, 0 /* font size - fixed/unused */);
}
static void xdk_d3d_restart(void)