diff --git a/config.def.h b/config.def.h index f0ee60d58b..618fba6174 100644 --- a/config.def.h +++ b/config.def.h @@ -117,8 +117,8 @@ static const unsigned monitor_index = 0; /* Window */ /* Window size. A value of 0 uses window scale * multiplied by the core framebuffer size. */ -static const unsigned window_x = 0; -static const unsigned window_y = 0; +static const unsigned window_width = 1280; +static const unsigned window_height = 720; /* Fullscreen resolution. A value of 0 uses the desktop * resolution. */ diff --git a/configuration.c b/configuration.c index d416670772..947011d30f 100644 --- a/configuration.c +++ b/configuration.c @@ -1590,8 +1590,6 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, SETTING_UINT("video_monitor_index", &settings->uints.video_monitor_index, true, monitor_index, false); SETTING_UINT("video_fullscreen_x", &settings->uints.video_fullscreen_x, true, fullscreen_x, false); SETTING_UINT("video_fullscreen_y", &settings->uints.video_fullscreen_y, true, fullscreen_y, false); - SETTING_UINT("video_window_x", &settings->uints.video_window_x, true, fullscreen_x, false); - SETTING_UINT("video_window_y", &settings->uints.video_window_y, true, fullscreen_y, false); SETTING_UINT("video_window_opacity", &settings->uints.video_window_opacity, true, window_opacity, false); #ifdef HAVE_COMMAND SETTING_UINT("network_cmd_port", &settings->uints.network_cmd_port, true, network_cmd_port, false); @@ -1675,8 +1673,8 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, SETTING_UINT("video_stream_scale_factor", &settings->uints.video_stream_scale_factor, true, 1, false); SETTING_UINT("video_windowed_position_x", &settings->uints.window_position_x, true, 0, false); SETTING_UINT("video_windowed_position_y", &settings->uints.window_position_y, true, 0, false); - SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, 0, false); - SETTING_UINT("video_windowed_position_height", &settings->uints.window_position_height, true, 0, false); + SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, window_width, false); + SETTING_UINT("video_windowed_position_height", &settings->uints.window_position_height, true, window_height, false); *size = count; diff --git a/configuration.h b/configuration.h index 89b65c52b6..7555118d62 100644 --- a/configuration.h +++ b/configuration.h @@ -373,8 +373,6 @@ typedef struct settings unsigned network_cmd_port; unsigned network_remote_base_port; unsigned keymapper_port; - unsigned video_window_x; - unsigned video_window_y; unsigned video_window_opacity; unsigned crt_switch_resolution; unsigned crt_switch_resolution_super; diff --git a/gfx/video_driver.c b/gfx/video_driver.c index aae7a7c4c3..c3157f8c6c 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -985,24 +985,16 @@ static bool video_driver_init_internal(bool *video_is_threaded) } else { - if (settings->uints.video_window_x || settings->uints.video_window_y) + if (settings->bools.video_force_aspect) { - width = settings->uints.video_window_x; - height = settings->uints.video_window_y; + /* Do rounding here to simplify integer scale correctness. */ + unsigned base_width = + roundf(geom->base_height * video_driver_get_aspect_ratio()); + width = roundf(base_width * settings->floats.video_scale); } else - { - if (settings->bools.video_force_aspect) - { - /* Do rounding here to simplify integer scale correctness. */ - unsigned base_width = - roundf(geom->base_height * video_driver_get_aspect_ratio()); - width = roundf(base_width * settings->floats.video_scale); - } - else - width = roundf(geom->base_width * settings->floats.video_scale); - height = roundf(geom->base_height * settings->floats.video_scale); - } + width = roundf(geom->base_width * settings->floats.video_scale); + height = roundf(geom->base_height * settings->floats.video_scale); } if (width && height) diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index 4231e13b4b..9a9163aa47 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -3723,4 +3723,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index d9cf167985..13f6fbb55a 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -4750,4 +4750,4 @@ MSG_HASH( "Warning: Missing assets, use the Online Updater if available" ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 6718972493..f619da864f 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3501,4 +3501,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 0ba3a04029..3a6c051535 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3637,4 +3637,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_el.h b/intl/msg_hash_el.h index 6e080a7c78..4a1a64116c 100644 --- a/intl/msg_hash_el.h +++ b/intl/msg_hash_el.h @@ -7731,4 +7731,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 80e3e3c412..4069f0cb2f 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3376,4 +3376,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index e4c0f02968..d60e909750 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -7749,4 +7749,4 @@ MSG_HASH( "ADVERTENCIA: Faltan recursos, use el Actualizador si está disponible" ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index a6d00bcdc7..0d2de27a1b 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3535,4 +3535,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index a9584919b0..053e67d894 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3595,4 +3595,4 @@ MSG_HASH( "Nessun preferito disponibile." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index f71fddf035..e0619ed04d 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -4044,4 +4044,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 76127c76fd..1a16c5793d 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3496,4 +3496,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index c843570f03..3f169052d4 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3382,4 +3382,4 @@ MSG_HASH( "Geen favorieten beschikbaar." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index 924afd0a8e..e510a17a18 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -3798,4 +3798,4 @@ MSG_HASH( "Brak ulubionych." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index b1c799e9cf..c63c4404f9 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -7781,4 +7781,4 @@ MSG_HASH( "Aviso: Recursos ausentes, use o Atualizador Online se disponível" ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 24f37afc9b..6aa36f56d5 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3462,4 +3462,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index df76bbb7f1..51d2ef1e6f 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3665,4 +3665,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index fc3ec43e66..c7ac4fc74f 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -4886,11 +4886,15 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_WINDOW_WIDTH, - "Set the custom width size for the display window. Leaving it at 0 will attempt to scale the window as large as possible." + "Set the custom width for the display window." ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_WINDOW_HEIGHT, - "Set the custom height size for the display window. Leaving it at 0 will attempt to scale the window as large as possible." + "Set the custom height for the display window." + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_VIDEO_WINDOW_SAVE_POSITION, + "Remember window size and position, enabling this has precedence over Windowed Scale" ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_FULLSCREEN_X, diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index fcc90e9f8e..79a6cdb8d7 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3535,4 +3535,4 @@ MSG_HASH( "No favorites available." ) MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_SAVE_POSITION, - "Remember Window Positions") + "Remember Window Position and Size") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index c4ff5f6cf5..34c9259106 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -194,6 +194,7 @@ default_sublabel_macro(action_bind_sublabel_video_window_width, MENU_ default_sublabel_macro(action_bind_sublabel_video_window_height, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_HEIGHT) default_sublabel_macro(action_bind_sublabel_video_fullscreen_x, MENU_ENUM_SUBLABEL_VIDEO_FULLSCREEN_X) default_sublabel_macro(action_bind_sublabel_video_fullscreen_y, MENU_ENUM_SUBLABEL_VIDEO_FULLSCREEN_Y) +default_sublabel_macro(action_bind_sublabel_video_save_window_position, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_SAVE_POSITION) default_sublabel_macro(action_bind_sublabel_video_message_pos_x, MENU_ENUM_SUBLABEL_VIDEO_MESSAGE_POS_X) default_sublabel_macro(action_bind_sublabel_video_message_pos_y, MENU_ENUM_SUBLABEL_VIDEO_MESSAGE_POS_Y) default_sublabel_macro(action_bind_sublabel_video_font_size, MENU_ENUM_SUBLABEL_VIDEO_FONT_SIZE) @@ -1624,6 +1625,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_VIDEO_FULLSCREEN_Y: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_fullscreen_y); break; + case MENU_ENUM_LABEL_VIDEO_WINDOW_SAVE_POSITION: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_save_window_position); + break; case MENU_ENUM_LABEL_QUIT_RETROARCH: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quit_retroarch); break; diff --git a/menu/drivers/nuklear/nk_common.c b/menu/drivers/nuklear/nk_common.c index 67323c0cf1..61800585fd 100644 --- a/menu/drivers/nuklear/nk_common.c +++ b/menu/drivers/nuklear/nk_common.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2011-2017 - Daniel De Matteis - * Copyright (C) 2014-2017 - Jean-Andr� Santoni - * Copyright (C) 2016-2017 - Andr�s Su�rez + * Copyright (C) 2014-2017 - Jean-André Santoni + * Copyright (C) 2016-2017 - Andrés Suárez * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 865980f621..73e3f6e744 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2011-2017 - Daniel De Matteis - * Copyright (C) 2014-2017 - Jean-André Santoni - * Copyright (C) 2015-2017 - Andrés Suárez + * Copyright (C) 2014-2017 - Jean-André Santoni + * Copyright (C) 2015-2017 - Andrés Suárez * Copyright (C) 2016-2017 - Brad Parker * * RetroArch is free software: you can redistribute it and/or modify it under the terms @@ -6609,12 +6609,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_VIDEO_SCALE, PARSE_ONLY_FLOAT, false); - menu_displaylist_parse_settings_enum(menu, info, - MENU_ENUM_LABEL_VIDEO_WINDOW_WIDTH, - PARSE_ONLY_UINT, false); - menu_displaylist_parse_settings_enum(menu, info, - MENU_ENUM_LABEL_VIDEO_WINDOW_HEIGHT, - PARSE_ONLY_UINT, false); menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_VIDEO_WINDOW_OPACITY, PARSE_ONLY_UINT, false); @@ -6624,6 +6618,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_VIDEO_WINDOW_SAVE_POSITION, PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_VIDEO_WINDOW_WIDTH, + PARSE_ONLY_UINT, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_VIDEO_WINDOW_HEIGHT, + PARSE_ONLY_UINT, false); menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_VIDEO_SCALE_INTEGER, PARSE_ONLY_BOOL, false); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index b55e28a2c5..1d76dedf57 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5457,10 +5457,10 @@ static bool setting_append_list( settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED); CONFIG_UINT( list, list_info, - &settings->uints.video_window_x, + &settings->uints.window_position_width, MENU_ENUM_LABEL_VIDEO_WINDOW_WIDTH, MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_WIDTH, - 0, + window_width, &group_info, &subgroup_info, parent_group, @@ -5471,10 +5471,10 @@ static bool setting_append_list( settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED); CONFIG_UINT( list, list_info, - &settings->uints.video_window_y, + &settings->uints.window_position_height, MENU_ENUM_LABEL_VIDEO_WINDOW_HEIGHT, MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_HEIGHT, - 0, + window_height, &group_info, &subgroup_info, parent_group,