mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Overlay configuration improvements
This commit is contained in:
parent
59f90ddb28
commit
b8ea4fd54e
13
config.def.h
13
config.def.h
@ -375,6 +375,19 @@
|
||||
#define DEFAULT_INPUT_OVERLAY_OPACITY 0.7f
|
||||
#endif
|
||||
|
||||
#define DEFAULT_INPUT_OVERLAY_SCALE_LANDSCAPE 1.0f
|
||||
#define DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_LANDSCAPE 0.0f
|
||||
#define DEFAULT_INPUT_OVERLAY_X_SEPARATION_LANDSCAPE 0.0f
|
||||
#define DEFAULT_INPUT_OVERLAY_Y_SEPARATION_LANDSCAPE 0.0f
|
||||
#define DEFAULT_INPUT_OVERLAY_X_OFFSET_LANDSCAPE 0.0f
|
||||
#define DEFAULT_INPUT_OVERLAY_Y_OFFSET_LANDSCAPE 0.0f
|
||||
|
||||
#define DEFAULT_INPUT_OVERLAY_SCALE_PORTRAIT 1.0f
|
||||
#define DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_PORTRAIT 0.0f
|
||||
#define DEFAULT_INPUT_OVERLAY_X_SEPARATION_PORTRAIT 0.0f
|
||||
#define DEFAULT_INPUT_OVERLAY_X_OFFSET_PORTRAIT 0.0f
|
||||
#define DEFAULT_INPUT_OVERLAY_Y_OFFSET_PORTRAIT 0.0f
|
||||
|
||||
#if defined(RARCH_MOBILE)
|
||||
#define DEFAULT_OVERLAY_AUTO_ROTATE true
|
||||
#else
|
||||
|
@ -1779,9 +1779,17 @@ static struct config_float_setting *populate_settings_float(
|
||||
#endif
|
||||
#ifdef HAVE_OVERLAY
|
||||
SETTING_FLOAT("input_overlay_opacity", &settings->floats.input_overlay_opacity, true, DEFAULT_INPUT_OVERLAY_OPACITY, false);
|
||||
SETTING_FLOAT("input_overlay_scale", &settings->floats.input_overlay_scale, true, 1.0f, false);
|
||||
SETTING_FLOAT("input_overlay_center_x", &settings->floats.input_overlay_center_x, true, 0.5f, false);
|
||||
SETTING_FLOAT("input_overlay_center_y", &settings->floats.input_overlay_center_y, true, 0.5f, false);
|
||||
SETTING_FLOAT("input_overlay_scale_landscape", &settings->floats.input_overlay_scale_landscape, true, DEFAULT_INPUT_OVERLAY_SCALE_LANDSCAPE, false);
|
||||
SETTING_FLOAT("input_overlay_aspect_adjust_landscape", &settings->floats.input_overlay_aspect_adjust_landscape, true, DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_LANDSCAPE, false);
|
||||
SETTING_FLOAT("input_overlay_x_separation_landscape", &settings->floats.input_overlay_x_separation_landscape, true, DEFAULT_INPUT_OVERLAY_X_SEPARATION_LANDSCAPE, false);
|
||||
SETTING_FLOAT("input_overlay_y_separation_landscape", &settings->floats.input_overlay_y_separation_landscape, true, DEFAULT_INPUT_OVERLAY_Y_SEPARATION_LANDSCAPE, false);
|
||||
SETTING_FLOAT("input_overlay_x_offset_landscape", &settings->floats.input_overlay_x_offset_landscape, true, DEFAULT_INPUT_OVERLAY_X_OFFSET_LANDSCAPE, false);
|
||||
SETTING_FLOAT("input_overlay_y_offset_landscape", &settings->floats.input_overlay_y_offset_landscape, true, DEFAULT_INPUT_OVERLAY_Y_OFFSET_LANDSCAPE, false);
|
||||
SETTING_FLOAT("input_overlay_scale_portrait", &settings->floats.input_overlay_scale_portrait, true, DEFAULT_INPUT_OVERLAY_SCALE_PORTRAIT, false);
|
||||
SETTING_FLOAT("input_overlay_aspect_adjust_portrait", &settings->floats.input_overlay_aspect_adjust_portrait, true, DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_PORTRAIT, false);
|
||||
SETTING_FLOAT("input_overlay_x_separation_portrait", &settings->floats.input_overlay_x_separation_portrait, true, DEFAULT_INPUT_OVERLAY_X_SEPARATION_PORTRAIT, false);
|
||||
SETTING_FLOAT("input_overlay_x_offset_portrait", &settings->floats.input_overlay_x_offset_portrait, true, DEFAULT_INPUT_OVERLAY_X_OFFSET_PORTRAIT, false);
|
||||
SETTING_FLOAT("input_overlay_y_offset_portrait", &settings->floats.input_overlay_y_offset_portrait, true, DEFAULT_INPUT_OVERLAY_Y_OFFSET_PORTRAIT, false);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_FLOAT("menu_scale_factor", &settings->floats.menu_scale_factor, true, DEFAULT_MENU_SCALE_FACTOR, false);
|
||||
|
@ -301,9 +301,19 @@ typedef struct settings
|
||||
float audio_mixer_volume; /* dB scale. */
|
||||
|
||||
float input_overlay_opacity;
|
||||
float input_overlay_scale;
|
||||
float input_overlay_center_x;
|
||||
float input_overlay_center_y;
|
||||
|
||||
float input_overlay_scale_landscape;
|
||||
float input_overlay_aspect_adjust_landscape;
|
||||
float input_overlay_x_separation_landscape;
|
||||
float input_overlay_y_separation_landscape;
|
||||
float input_overlay_x_offset_landscape;
|
||||
float input_overlay_y_offset_landscape;
|
||||
|
||||
float input_overlay_scale_portrait;
|
||||
float input_overlay_aspect_adjust_portrait;
|
||||
float input_overlay_x_separation_portrait;
|
||||
float input_overlay_x_offset_portrait;
|
||||
float input_overlay_y_offset_portrait;
|
||||
|
||||
float slowmotion_ratio;
|
||||
float fastforward_ratio;
|
||||
|
@ -117,7 +117,6 @@ struct overlay
|
||||
|
||||
float mod_x, mod_y, mod_w, mod_h;
|
||||
float x, y, w, h;
|
||||
float scale;
|
||||
float center_x, center_y;
|
||||
|
||||
struct overlay_desc *descs;
|
||||
@ -180,6 +179,13 @@ struct overlay_desc
|
||||
float delta_x, delta_y;
|
||||
float x;
|
||||
float y;
|
||||
/* These are 'raw' x/y values shifted
|
||||
* by a user-configured offset (c.f.
|
||||
* OVERLAY_X/Y_SEPARATION). Used to determine
|
||||
* correct hitbox locations. By default,
|
||||
* will be equal to x/y */
|
||||
float x_shift;
|
||||
float y_shift;
|
||||
|
||||
/* This is a retro_key value for keyboards */
|
||||
unsigned retro_key_idx;
|
||||
@ -192,6 +198,24 @@ struct overlay_desc
|
||||
struct texture_image image;
|
||||
};
|
||||
|
||||
/* Holds general layout information for an
|
||||
* overlay (overall scaling + positional
|
||||
* offset factors) */
|
||||
typedef struct
|
||||
{
|
||||
float scale_landscape;
|
||||
float aspect_adjust_landscape;
|
||||
float x_separation_landscape;
|
||||
float y_separation_landscape;
|
||||
float x_offset_landscape;
|
||||
float y_offset_landscape;
|
||||
float scale_portrait;
|
||||
float aspect_adjust_portrait;
|
||||
float x_separation_portrait;
|
||||
float x_offset_portrait;
|
||||
float y_offset_portrait;
|
||||
} overlay_layout_t;
|
||||
|
||||
typedef struct overlay_desc overlay_desc_t;
|
||||
|
||||
typedef struct input_overlay input_overlay_t;
|
||||
@ -202,9 +226,7 @@ typedef struct
|
||||
struct overlay *active;
|
||||
size_t size;
|
||||
float overlay_opacity;
|
||||
float overlay_scale;
|
||||
float overlay_center_x;
|
||||
float overlay_center_y;
|
||||
overlay_layout_t layout;
|
||||
bool overlay_enable;
|
||||
bool hide_in_menu;
|
||||
bool hide_when_gamepad_connected;
|
||||
|
@ -1993,16 +1993,48 @@ MSG_HASH(
|
||||
"input_overlay"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_SCALE,
|
||||
"input_overlay_scale"
|
||||
MENU_ENUM_LABEL_OVERLAY_SCALE_LANDSCAPE,
|
||||
"input_overlay_scale_landscape"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_CENTER_X,
|
||||
"input_overlay_center_x"
|
||||
MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_LANDSCAPE,
|
||||
"input_overlay_aspect_adjust_landscape"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_CENTER_Y,
|
||||
"input_overlay_center_y"
|
||||
MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_LANDSCAPE,
|
||||
"input_overlay_x_separation_landscape"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_Y_SEPARATION_LANDSCAPE,
|
||||
"input_overlay_y_separation_landscape"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_X_OFFSET_LANDSCAPE,
|
||||
"input_overlay_x_offset_landscape"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_LANDSCAPE,
|
||||
"input_overlay_y_offset_landscape"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_SCALE_PORTRAIT,
|
||||
"input_overlay_scale_portrait"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_PORTRAIT,
|
||||
"input_overlay_aspect_adjust_portrait"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_PORTRAIT,
|
||||
"input_overlay_x_separation_portrait"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_X_OFFSET_PORTRAIT,
|
||||
"input_overlay_x_offset_portrait"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_PORTRAIT,
|
||||
"input_overlay_y_offset_portrait"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_PAL60_ENABLE,
|
||||
|
@ -667,18 +667,6 @@ int msg_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Input bind hold time (in seconds). \n"
|
||||
"Amount of seconds to hold an input to bind it.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_SCALE:
|
||||
snprintf(s, len,
|
||||
"Overlay scale.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_CENTER_X:
|
||||
snprintf(s, len,
|
||||
"Overlay X offset.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_CENTER_Y:
|
||||
snprintf(s, len,
|
||||
"Overlay Y offset.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_AUDIO_OUTPUT_RATE:
|
||||
snprintf(s, len,
|
||||
"Audio output samplerate.");
|
||||
|
@ -3323,30 +3323,92 @@ MSG_HASH(
|
||||
"Select an overlay from the file browser."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE,
|
||||
"Overlay Scale"
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE_LANDSCAPE,
|
||||
"(Landscape) Overlay Scale"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_SCALE,
|
||||
"Scale of all UI elements of the overlay."
|
||||
)
|
||||
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_CENTER_X,
|
||||
"Overlay Offset X"
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_SCALE_LANDSCAPE,
|
||||
"Scale of all UI elements of the overlay when using landscape display orientations."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_CENTER_X,
|
||||
"X offset of all UI elements of the overlay."
|
||||
)
|
||||
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_CENTER_Y,
|
||||
"Overlay Offset Y"
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_ASPECT_ADJUST_LANDSCAPE,
|
||||
"(Landscape) Overlay Aspect Adjustment"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_CENTER_Y,
|
||||
"Y offset of all UI elements of the overlay."
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_ASPECT_ADJUST_LANDSCAPE,
|
||||
"Apply an aspect ratio correction factor to the overlay when using landscape display orientations. Positive values increase (while negative values decrease) effective overlay width."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_X_SEPARATION_LANDSCAPE,
|
||||
"(Landscape) Overlay Horizontal Separation"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_X_SEPARATION_LANDSCAPE,
|
||||
"Adjust the spacing between UI elements in the left and right halves of an overlay when using landscape display orientations. Positive values increase (while negative values decrease) the separation of the two halves."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_Y_SEPARATION_LANDSCAPE,
|
||||
"(Landscape) Overlay Vertical Separation"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_Y_SEPARATION_LANDSCAPE,
|
||||
"Adjust the spacing between UI elements in the top and bottom halves of an overlay when using landscape display orientations. Positive values increase (while negative values decrease) the separation of the two halves."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_X_OFFSET_LANDSCAPE,
|
||||
"(Landscape) Overlay X Offset"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_X_OFFSET_LANDSCAPE,
|
||||
"Horizontal overlay offset when using landscape display orientations. Positive values shift overlay to the right; negative values to the left."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_Y_OFFSET_LANDSCAPE,
|
||||
"(Landscape) Overlay Y Offset"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_Y_OFFSET_LANDSCAPE,
|
||||
"Vertical overlay offset when using landscape display orientations. Positive values shift overlay upwards; negative values downwards."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE_PORTRAIT,
|
||||
"(Portrait) Overlay Scale"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_SCALE_PORTRAIT,
|
||||
"Scale of all UI elements of the overlay when using portrait display orientations."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_ASPECT_ADJUST_PORTRAIT,
|
||||
"(Portrait) Overlay Aspect Adjustment"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_ASPECT_ADJUST_PORTRAIT,
|
||||
"Apply an aspect ratio correction factor to the overlay when using portrait display orientations. Positive values increase (while negative values decrease) effective overlay height."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_X_SEPARATION_PORTRAIT,
|
||||
"(Portrait) Overlay Horizontal Separation"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_X_SEPARATION_PORTRAIT,
|
||||
"Adjust the spacing between UI elements in the left and right halves of an overlay when using portrait display orientations. Positive values increase (while negative values decrease) the separation of the two halves."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_X_OFFSET_PORTRAIT,
|
||||
"(Portrait) Overlay X Offset"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_X_OFFSET_PORTRAIT,
|
||||
"Horizontal overlay offset when using portrait display orientations. Positive values shift overlay to the right; negative values to the left."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_Y_OFFSET_PORTRAIT,
|
||||
"(Portrait) Overlay Y Offset"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OVERLAY_Y_OFFSET_PORTRAIT,
|
||||
"Vertical overlay offset when using portrait display orientations. Positive values shift overlay upwards; negative values downwards."
|
||||
)
|
||||
|
||||
/* Settings > On-Screen Display > Video Layout */
|
||||
|
@ -512,9 +512,17 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_audio_wasapi_exclusive_mode, MENU_
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_audio_wasapi_float_format, MENU_ENUM_SUBLABEL_AUDIO_WASAPI_FLOAT_FORMAT)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_audio_wasapi_sh_buffer_length, MENU_ENUM_SUBLABEL_AUDIO_WASAPI_SH_BUFFER_LENGTH)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_opacity, MENU_ENUM_SUBLABEL_OVERLAY_OPACITY)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_scale, MENU_ENUM_SUBLABEL_OVERLAY_SCALE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_center_x, MENU_ENUM_SUBLABEL_OVERLAY_CENTER_X)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_center_y, MENU_ENUM_SUBLABEL_OVERLAY_CENTER_Y)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_scale_landscape, MENU_ENUM_SUBLABEL_OVERLAY_SCALE_LANDSCAPE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_aspect_adjust_landscape, MENU_ENUM_SUBLABEL_OVERLAY_ASPECT_ADJUST_LANDSCAPE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_x_separation_landscape, MENU_ENUM_SUBLABEL_OVERLAY_X_SEPARATION_LANDSCAPE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_y_separation_landscape, MENU_ENUM_SUBLABEL_OVERLAY_Y_SEPARATION_LANDSCAPE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_x_offset_landscape, MENU_ENUM_SUBLABEL_OVERLAY_X_OFFSET_LANDSCAPE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_y_offset_landscape, MENU_ENUM_SUBLABEL_OVERLAY_Y_OFFSET_LANDSCAPE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_scale_portrait, MENU_ENUM_SUBLABEL_OVERLAY_SCALE_PORTRAIT)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_aspect_adjust_portrait, MENU_ENUM_SUBLABEL_OVERLAY_ASPECT_ADJUST_PORTRAIT)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_x_separation_portrait, MENU_ENUM_SUBLABEL_OVERLAY_X_SEPARATION_PORTRAIT)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_x_offset_portrait, MENU_ENUM_SUBLABEL_OVERLAY_X_OFFSET_PORTRAIT)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_y_offset_portrait, MENU_ENUM_SUBLABEL_OVERLAY_Y_OFFSET_PORTRAIT)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_enable, MENU_ENUM_SUBLABEL_INPUT_OVERLAY_ENABLE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_overlay_preset, MENU_ENUM_SUBLABEL_OVERLAY_PRESET)
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
@ -2687,14 +2695,38 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_OVERLAY_OPACITY:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_opacity);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_SCALE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_scale);
|
||||
case MENU_ENUM_LABEL_OVERLAY_SCALE_LANDSCAPE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_scale_landscape);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_CENTER_X:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_center_x);
|
||||
case MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_LANDSCAPE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_aspect_adjust_landscape);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_CENTER_Y:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_center_y);
|
||||
case MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_LANDSCAPE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_x_separation_landscape);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_Y_SEPARATION_LANDSCAPE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_y_separation_landscape);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_X_OFFSET_LANDSCAPE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_x_offset_landscape);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_LANDSCAPE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_y_offset_landscape);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_SCALE_PORTRAIT:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_scale_portrait);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_PORTRAIT:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_aspect_adjust_portrait);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_PORTRAIT:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_x_separation_portrait);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_X_OFFSET_PORTRAIT:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_x_offset_portrait);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_PORTRAIT:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_overlay_y_offset_portrait);
|
||||
break;
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
case MENU_ENUM_LABEL_VIDEO_LAYOUT_ENABLE:
|
||||
|
@ -7563,9 +7563,17 @@ unsigned menu_displaylist_build_list(
|
||||
{MENU_ENUM_LABEL_INPUT_OVERLAY_AUTO_ROTATE, PARSE_ONLY_BOOL, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_PRESET, PARSE_ONLY_PATH, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_OPACITY, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_SCALE, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_CENTER_X, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_CENTER_Y, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_SCALE_LANDSCAPE, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_LANDSCAPE, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_LANDSCAPE, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_Y_SEPARATION_LANDSCAPE, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_X_OFFSET_LANDSCAPE, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_LANDSCAPE, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_SCALE_PORTRAIT, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_PORTRAIT, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_PORTRAIT, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_X_OFFSET_PORTRAIT, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_PORTRAIT, PARSE_ONLY_FLOAT, false },
|
||||
};
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(build_list); i++)
|
||||
@ -7580,9 +7588,17 @@ unsigned menu_displaylist_build_list(
|
||||
case MENU_ENUM_LABEL_INPUT_OVERLAY_AUTO_ROTATE:
|
||||
case MENU_ENUM_LABEL_OVERLAY_PRESET:
|
||||
case MENU_ENUM_LABEL_OVERLAY_OPACITY:
|
||||
case MENU_ENUM_LABEL_OVERLAY_SCALE:
|
||||
case MENU_ENUM_LABEL_OVERLAY_CENTER_X:
|
||||
case MENU_ENUM_LABEL_OVERLAY_CENTER_Y:
|
||||
case MENU_ENUM_LABEL_OVERLAY_SCALE_LANDSCAPE:
|
||||
case MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_LANDSCAPE:
|
||||
case MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_LANDSCAPE:
|
||||
case MENU_ENUM_LABEL_OVERLAY_Y_SEPARATION_LANDSCAPE:
|
||||
case MENU_ENUM_LABEL_OVERLAY_X_OFFSET_LANDSCAPE:
|
||||
case MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_LANDSCAPE:
|
||||
case MENU_ENUM_LABEL_OVERLAY_SCALE_PORTRAIT:
|
||||
case MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_PORTRAIT:
|
||||
case MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_PORTRAIT:
|
||||
case MENU_ENUM_LABEL_OVERLAY_X_OFFSET_PORTRAIT:
|
||||
case MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_PORTRAIT:
|
||||
if (input_overlay_enable)
|
||||
build_list[i].checked = true;
|
||||
break;
|
||||
|
@ -13087,7 +13087,7 @@ static bool setting_append_list(
|
||||
&settings->floats.input_overlay_opacity,
|
||||
MENU_ENUM_LABEL_OVERLAY_OPACITY,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_OPACITY,
|
||||
0.7f,
|
||||
DEFAULT_INPUT_OVERLAY_OPACITY,
|
||||
"%.2f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
@ -13101,11 +13101,11 @@ static bool setting_append_list(
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_scale,
|
||||
MENU_ENUM_LABEL_OVERLAY_SCALE,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE,
|
||||
1.0f,
|
||||
"%.2f",
|
||||
&settings->floats.input_overlay_scale_landscape,
|
||||
MENU_ENUM_LABEL_OVERLAY_SCALE_LANDSCAPE,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE_LANDSCAPE,
|
||||
DEFAULT_INPUT_OVERLAY_SCALE_LANDSCAPE,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
@ -13113,16 +13113,16 @@ static bool setting_append_list(
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 2, 0.01, true, true);
|
||||
menu_settings_list_current_add_range(list, list_info, 0.0f, 2.0f, 0.005, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_center_x,
|
||||
MENU_ENUM_LABEL_OVERLAY_CENTER_X,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_CENTER_X,
|
||||
0.5f,
|
||||
"%.2f",
|
||||
&settings->floats.input_overlay_aspect_adjust_landscape,
|
||||
MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_LANDSCAPE,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_ASPECT_ADJUST_LANDSCAPE,
|
||||
DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_LANDSCAPE,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
@ -13130,16 +13130,16 @@ static bool setting_append_list(
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 1, 0.01, true, true);
|
||||
menu_settings_list_current_add_range(list, list_info, -2.0f, 2.0f, 0.005f, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_center_y,
|
||||
MENU_ENUM_LABEL_OVERLAY_CENTER_Y,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_CENTER_Y,
|
||||
0.5f,
|
||||
"%.2f",
|
||||
&settings->floats.input_overlay_x_separation_landscape,
|
||||
MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_LANDSCAPE,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_X_SEPARATION_LANDSCAPE,
|
||||
DEFAULT_INPUT_OVERLAY_X_SEPARATION_LANDSCAPE,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
@ -13147,7 +13147,143 @@ static bool setting_append_list(
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 1, 0.01, true, true);
|
||||
menu_settings_list_current_add_range(list, list_info, -2.0f, 2.0f, 0.005f, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_y_separation_landscape,
|
||||
MENU_ENUM_LABEL_OVERLAY_Y_SEPARATION_LANDSCAPE,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_Y_SEPARATION_LANDSCAPE,
|
||||
DEFAULT_INPUT_OVERLAY_Y_SEPARATION_LANDSCAPE,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, -2.0f, 2.0f, 0.005f, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_x_offset_landscape,
|
||||
MENU_ENUM_LABEL_OVERLAY_X_OFFSET_LANDSCAPE,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_X_OFFSET_LANDSCAPE,
|
||||
DEFAULT_INPUT_OVERLAY_X_OFFSET_LANDSCAPE,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, -1.0f, 1.0f, 0.005f, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_y_offset_landscape,
|
||||
MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_LANDSCAPE,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_Y_OFFSET_LANDSCAPE,
|
||||
DEFAULT_INPUT_OVERLAY_Y_OFFSET_LANDSCAPE,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, -1.0f, 1.0f, 0.005f, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_scale_portrait,
|
||||
MENU_ENUM_LABEL_OVERLAY_SCALE_PORTRAIT,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE_PORTRAIT,
|
||||
DEFAULT_INPUT_OVERLAY_SCALE_PORTRAIT,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, 0.0f, 2.0f, 0.005, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_aspect_adjust_portrait,
|
||||
MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_PORTRAIT,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_ASPECT_ADJUST_PORTRAIT,
|
||||
DEFAULT_INPUT_OVERLAY_ASPECT_ADJUST_PORTRAIT,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, -2.0f, 2.0f, 0.005f, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_x_separation_portrait,
|
||||
MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_PORTRAIT,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_X_SEPARATION_PORTRAIT,
|
||||
DEFAULT_INPUT_OVERLAY_X_SEPARATION_PORTRAIT,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, -2.0f, 2.0f, 0.005f, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_x_offset_portrait,
|
||||
MENU_ENUM_LABEL_OVERLAY_X_OFFSET_PORTRAIT,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_X_OFFSET_PORTRAIT,
|
||||
DEFAULT_INPUT_OVERLAY_X_OFFSET_PORTRAIT,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, -1.0f, 1.0f, 0.005f, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.input_overlay_y_offset_portrait,
|
||||
MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_PORTRAIT,
|
||||
MENU_ENUM_LABEL_VALUE_OVERLAY_Y_OFFSET_PORTRAIT,
|
||||
DEFAULT_INPUT_OVERLAY_Y_OFFSET_PORTRAIT,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_OVERLAY_SET_SCALE_FACTOR);
|
||||
menu_settings_list_current_add_range(list, list_info, -1.0f, 1.0f, 0.005f, true, true);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_CMD_APPLY_AUTO);
|
||||
|
||||
END_SUB_GROUP(list, list_info, parent_group);
|
||||
|
20
msg_hash.h
20
msg_hash.h
@ -1771,11 +1771,27 @@ enum msg_hash_enums
|
||||
MENU_LABEL(NETPLAY_SPECTATE_PASSWORD),
|
||||
MENU_LABEL(NETPLAY_MODE),
|
||||
MENU_LABEL(PERFCNT_ENABLE),
|
||||
MENU_LABEL(OVERLAY_SCALE_LANDSCAPE),
|
||||
MENU_LABEL(OVERLAY_ASPECT_ADJUST_LANDSCAPE),
|
||||
MENU_LABEL(OVERLAY_X_SEPARATION_LANDSCAPE),
|
||||
MENU_LABEL(OVERLAY_Y_SEPARATION_LANDSCAPE),
|
||||
MENU_LABEL(OVERLAY_X_OFFSET_LANDSCAPE),
|
||||
MENU_LABEL(OVERLAY_Y_OFFSET_LANDSCAPE),
|
||||
MENU_LABEL(OVERLAY_SCALE_PORTRAIT),
|
||||
MENU_LABEL(OVERLAY_ASPECT_ADJUST_PORTRAIT),
|
||||
MENU_LABEL(OVERLAY_X_SEPARATION_PORTRAIT),
|
||||
MENU_LABEL(OVERLAY_X_OFFSET_PORTRAIT),
|
||||
MENU_LABEL(OVERLAY_Y_OFFSET_PORTRAIT),
|
||||
MENU_LABEL(OVERLAY_PRESET),
|
||||
MENU_LABEL(OVERLAY_OPACITY),
|
||||
|
||||
/* TODO/FIXME: These legacy enums are no longer
|
||||
* required, but we cannot delete them until the
|
||||
* corresponding translation file entries have
|
||||
* been removed via Crowdin... */
|
||||
MENU_LABEL(OVERLAY_SCALE),
|
||||
MENU_LABEL(OVERLAY_CENTER_X),
|
||||
MENU_LABEL(OVERLAY_CENTER_Y),
|
||||
MENU_LABEL(OVERLAY_PRESET),
|
||||
MENU_LABEL(OVERLAY_OPACITY),
|
||||
|
||||
MENU_LABEL(FASTFORWARD_RATIO),
|
||||
MENU_LABEL(VRR_RUNLOOP_ENABLE),
|
||||
|
221
retroarch.c
221
retroarch.c
@ -2830,8 +2830,8 @@ static void retroarch_overlay_init(struct rarch_state *p_rarch);
|
||||
static void retroarch_overlay_deinit(struct rarch_state *p_rarch);
|
||||
static void input_overlay_set_alpha_mod(struct rarch_state *p_rarch,
|
||||
input_overlay_t *ol, float mod);
|
||||
static void input_overlay_set_scale_factor(input_overlay_t *ol, float scale,
|
||||
float center_x, float center_y);
|
||||
static void input_overlay_set_scale_factor(struct rarch_state *p_rarch,
|
||||
input_overlay_t *ol, overlay_layout_t *layout);
|
||||
static void input_overlay_load_active(
|
||||
struct rarch_state *p_rarch,
|
||||
input_overlay_t *ol, float opacity);
|
||||
@ -16407,11 +16407,21 @@ bool command_event(enum event_command cmd, void *data)
|
||||
case CMD_EVENT_OVERLAY_SET_SCALE_FACTOR:
|
||||
#ifdef HAVE_OVERLAY
|
||||
{
|
||||
float input_overlay_scale = settings->floats.input_overlay_scale;
|
||||
float input_overlay_c_x = settings->floats.input_overlay_center_x;
|
||||
float input_overlay_c_y = settings->floats.input_overlay_center_y;
|
||||
input_overlay_set_scale_factor(p_rarch->overlay_ptr,
|
||||
input_overlay_scale, input_overlay_c_x, input_overlay_c_y);
|
||||
overlay_layout_t layout;
|
||||
|
||||
layout.scale_landscape = settings->floats.input_overlay_scale_landscape;
|
||||
layout.aspect_adjust_landscape = settings->floats.input_overlay_aspect_adjust_landscape;
|
||||
layout.x_separation_landscape = settings->floats.input_overlay_x_separation_landscape;
|
||||
layout.y_separation_landscape = settings->floats.input_overlay_y_separation_landscape;
|
||||
layout.x_offset_landscape = settings->floats.input_overlay_x_offset_landscape;
|
||||
layout.y_offset_landscape = settings->floats.input_overlay_y_offset_landscape;
|
||||
layout.scale_portrait = settings->floats.input_overlay_scale_portrait;
|
||||
layout.aspect_adjust_portrait = settings->floats.input_overlay_aspect_adjust_portrait;
|
||||
layout.x_separation_portrait = settings->floats.input_overlay_x_separation_portrait;
|
||||
layout.x_offset_portrait = settings->floats.input_overlay_x_offset_portrait;
|
||||
layout.y_offset_portrait = settings->floats.input_overlay_y_offset_portrait;
|
||||
|
||||
input_overlay_set_scale_factor(p_rarch, p_rarch->overlay_ptr, &layout);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
@ -22658,37 +22668,112 @@ static bool input_overlay_add_inputs(input_overlay_t *ol,
|
||||
/**
|
||||
* input_overlay_scale:
|
||||
* @ol : Overlay handle.
|
||||
* @scale : Scaling factor.
|
||||
* @layout : Scale + offset factors.
|
||||
* @is_landscape : True if current display has a
|
||||
* landscape orientation
|
||||
*
|
||||
* Scales overlay and all its associated descriptors
|
||||
* by a given scaling factor (@scale).
|
||||
* Scales the overlay and all its associated descriptors
|
||||
* and applies any aspect ratio/offset factors.
|
||||
**/
|
||||
static void input_overlay_scale(struct overlay *ol, float scale, float center_x,
|
||||
float center_y)
|
||||
static void input_overlay_scale(struct overlay *ol,
|
||||
overlay_layout_t *layout, bool is_landscape)
|
||||
{
|
||||
float scale_x = 1.0f;
|
||||
float scale_y = 1.0f;
|
||||
float x_separation;
|
||||
float y_separation;
|
||||
float x_offset;
|
||||
float y_offset;
|
||||
size_t i;
|
||||
|
||||
if (ol->block_scale)
|
||||
scale = 1.0f;
|
||||
if (is_landscape)
|
||||
{
|
||||
float scale = layout->scale_landscape;
|
||||
float aspect_adjust = layout->aspect_adjust_landscape;
|
||||
|
||||
ol->center_x = ol->x + center_x * ol->w;
|
||||
ol->center_y = ol->y + center_y * ol->h;
|
||||
/* Note: Y offsets have their sign inverted,
|
||||
* since from a usability perspective positive
|
||||
* values should move the overlay upwards */
|
||||
x_offset = layout->x_offset_landscape;
|
||||
y_offset = layout->y_offset_landscape * -1.0f;
|
||||
|
||||
ol->scale = scale;
|
||||
ol->mod_w = ol->w * scale;
|
||||
ol->mod_h = ol->h * scale;
|
||||
ol->mod_x = ol->center_x +
|
||||
(ol->x - ol->center_x) * scale;
|
||||
ol->mod_y = ol->center_y +
|
||||
(ol->y - ol->center_y) * scale;
|
||||
x_separation = layout->x_separation_landscape;
|
||||
y_separation = layout->y_separation_landscape;
|
||||
|
||||
if (!ol->block_scale)
|
||||
{
|
||||
/* In landscape orientations, aspect correction
|
||||
* adjusts the overlay width */
|
||||
scale_x = (aspect_adjust >= 0.0f) ?
|
||||
(scale * (aspect_adjust + 1.0f)) :
|
||||
(scale / ((aspect_adjust * -1.0f) + 1.0f));
|
||||
scale_y = scale;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float scale = layout->scale_portrait;
|
||||
float aspect_adjust = layout->aspect_adjust_portrait;
|
||||
|
||||
x_offset = layout->x_offset_portrait;
|
||||
y_offset = layout->y_offset_portrait * -1.0f;
|
||||
|
||||
/* Note: 'y separation' makes little sense when
|
||||
* dealing with portrait layouts, since UI
|
||||
* elements are typically always placed below
|
||||
* the centre line. Just set y_separation to
|
||||
* zero in this case... */
|
||||
x_separation = layout->x_separation_portrait;
|
||||
y_separation = 0.0f;
|
||||
|
||||
if (!ol->block_scale)
|
||||
{
|
||||
/* In portrait orientations, aspect correction
|
||||
* adjusts the overlay height */
|
||||
scale_x = scale;
|
||||
scale_y = (aspect_adjust >= 0.0f) ?
|
||||
(scale * (aspect_adjust + 1.0f)) :
|
||||
(scale / ((aspect_adjust * -1.0f) + 1.0f));
|
||||
}
|
||||
}
|
||||
|
||||
ol->mod_w = ol->w * scale_x;
|
||||
ol->mod_h = ol->h * scale_y;
|
||||
ol->mod_x = (ol->center_x +
|
||||
(ol->x - ol->center_x) * scale_x) + x_offset;
|
||||
ol->mod_y = (ol->center_y +
|
||||
(ol->y - ol->center_y) * scale_y) + y_offset;
|
||||
|
||||
for (i = 0; i < ol->size; i++)
|
||||
{
|
||||
struct overlay_desc *desc = &ol->descs[i];
|
||||
float scale_w = ol->mod_w * desc->range_x;
|
||||
float scale_h = ol->mod_h * desc->range_y;
|
||||
float adj_center_x = ol->mod_x + desc->x * ol->mod_w;
|
||||
float adj_center_y = ol->mod_y + desc->y * ol->mod_h;
|
||||
float x_shift_offset = 0.0f;
|
||||
float y_shift_offset = 0.0f;
|
||||
float scale_w;
|
||||
float scale_h;
|
||||
float adj_center_x;
|
||||
float adj_center_y;
|
||||
|
||||
/* Apply 'x separation' factor */
|
||||
if (desc->x < (0.5f - 0.0001f))
|
||||
x_shift_offset = x_separation * -1.0f;
|
||||
else if (desc->x > (0.5f + 0.0001f))
|
||||
x_shift_offset = x_separation;
|
||||
|
||||
desc->x_shift = desc->x + x_shift_offset;
|
||||
|
||||
/* Apply 'y separation' factor */
|
||||
if (desc->y < (0.5f - 0.0001f))
|
||||
y_shift_offset = y_separation * -1.0f;
|
||||
else if (desc->y > (0.5f + 0.0001f))
|
||||
y_shift_offset = y_separation;
|
||||
|
||||
desc->y_shift = desc->y + y_shift_offset;
|
||||
|
||||
scale_w = ol->mod_w * desc->range_x;
|
||||
scale_h = ol->mod_h * desc->range_y;
|
||||
adj_center_x = ol->mod_x + desc->x_shift * ol->mod_w;
|
||||
adj_center_y = ol->mod_y + desc->y_shift * ol->mod_h;
|
||||
|
||||
desc->mod_w = 2.0f * scale_w;
|
||||
desc->mod_h = 2.0f * scale_h;
|
||||
@ -22722,20 +22807,24 @@ static void input_overlay_set_vertex_geom(input_overlay_t *ol)
|
||||
/**
|
||||
* input_overlay_set_scale_factor:
|
||||
* @ol : Overlay handle.
|
||||
* @scale : Factor of scale to apply.
|
||||
* @layout : Scale + offset factors.
|
||||
*
|
||||
* Scales the overlay by a factor of scale.
|
||||
* Scales the overlay and applies any aspect ratio/
|
||||
* offset factors.
|
||||
**/
|
||||
static void input_overlay_set_scale_factor(input_overlay_t *ol, float scale,
|
||||
float center_x, float center_y)
|
||||
static void input_overlay_set_scale_factor(struct rarch_state *p_rarch,
|
||||
input_overlay_t *ol, overlay_layout_t *layout)
|
||||
{
|
||||
bool is_landscape = p_rarch->video_driver_width >
|
||||
p_rarch->video_driver_height;
|
||||
size_t i;
|
||||
|
||||
if (!ol)
|
||||
if (!ol || !layout)
|
||||
return;
|
||||
|
||||
for (i = 0; i < ol->size; i++)
|
||||
input_overlay_scale(&ol->overlays[i], scale, center_x, center_y);
|
||||
input_overlay_scale(&ol->overlays[i],
|
||||
layout, is_landscape);
|
||||
|
||||
input_overlay_set_vertex_geom(ol);
|
||||
}
|
||||
@ -22941,16 +23030,16 @@ static bool inside_hitbox(const struct overlay_desc *desc, float x, float y)
|
||||
case OVERLAY_HITBOX_RADIAL:
|
||||
{
|
||||
/* Ellipsis. */
|
||||
float x_dist = (x - desc->x) / desc->range_x_mod;
|
||||
float y_dist = (y - desc->y) / desc->range_y_mod;
|
||||
float x_dist = (x - desc->x_shift) / desc->range_x_mod;
|
||||
float y_dist = (y - desc->y_shift) / desc->range_y_mod;
|
||||
float sq_dist = x_dist * x_dist + y_dist * y_dist;
|
||||
return (sq_dist <= 1.0f);
|
||||
}
|
||||
|
||||
case OVERLAY_HITBOX_RECT:
|
||||
return
|
||||
(fabs(x - desc->x) <= desc->range_x_mod) &&
|
||||
(fabs(y - desc->y) <= desc->range_y_mod);
|
||||
(fabs(x - desc->x_shift) <= desc->range_x_mod) &&
|
||||
(fabs(y - desc->y_shift) <= desc->range_y_mod);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -22993,8 +23082,8 @@ static void input_overlay_poll(
|
||||
continue;
|
||||
|
||||
desc->updated = true;
|
||||
x_dist = x - desc->x;
|
||||
y_dist = y - desc->y;
|
||||
x_dist = x - desc->x_shift;
|
||||
y_dist = y - desc->y_shift;
|
||||
|
||||
switch (desc->type)
|
||||
{
|
||||
@ -23215,8 +23304,7 @@ static void input_overlay_loaded(retro_task_t *task,
|
||||
if (ol->iface->enable)
|
||||
ol->iface->enable(ol->iface_data, data->overlay_enable);
|
||||
|
||||
input_overlay_set_scale_factor(ol, data->overlay_scale,
|
||||
data->overlay_center_x, data->overlay_center_y);
|
||||
input_overlay_set_scale_factor(p_rarch, ol, &data->layout);
|
||||
|
||||
ol->next_index = (unsigned)((ol->index + 1) % ol->size);
|
||||
ol->state = OVERLAY_STATUS_NONE;
|
||||
@ -23487,9 +23575,17 @@ static void retroarch_overlay_init(struct rarch_state *p_rarch)
|
||||
bool input_overlay_enable = settings->bools.input_overlay_enable;
|
||||
const char *path_overlay = settings->paths.path_overlay;
|
||||
float overlay_opacity = settings->floats.input_overlay_opacity;
|
||||
float overlay_scale = settings->floats.input_overlay_scale;
|
||||
float overlay_center_x = settings->floats.input_overlay_center_x;
|
||||
float overlay_center_y = settings->floats.input_overlay_center_y;
|
||||
float overlay_scale_landscape = settings->floats.input_overlay_scale_landscape;
|
||||
float overlay_aspect_adjust_landscape = settings->floats.input_overlay_aspect_adjust_landscape;
|
||||
float overlay_x_separation_landscape = settings->floats.input_overlay_x_separation_landscape;
|
||||
float overlay_y_separation_landscape = settings->floats.input_overlay_y_separation_landscape;
|
||||
float overlay_x_offset_landscape = settings->floats.input_overlay_x_offset_landscape;
|
||||
float overlay_y_offset_landscape = settings->floats.input_overlay_y_offset_landscape;
|
||||
float overlay_scale_portrait = settings->floats.input_overlay_scale_portrait;
|
||||
float overlay_aspect_adjust_portrait = settings->floats.input_overlay_aspect_adjust_portrait;
|
||||
float overlay_x_separation_portrait = settings->floats.input_overlay_x_separation_portrait;
|
||||
float overlay_x_offset_portrait = settings->floats.input_overlay_x_offset_portrait;
|
||||
float overlay_y_offset_portrait = settings->floats.input_overlay_y_offset_portrait;
|
||||
bool load_enabled = input_overlay_enable;
|
||||
#ifdef HAVE_MENU
|
||||
bool overlay_hide_in_menu = settings->bools.input_overlay_hide_in_menu;
|
||||
@ -23519,17 +23615,31 @@ static void retroarch_overlay_init(struct rarch_state *p_rarch)
|
||||
load_enabled = load_enabled && (input_config_get_device_name(0) == NULL);
|
||||
|
||||
if (load_enabled)
|
||||
{
|
||||
overlay_layout_t layout;
|
||||
|
||||
layout.scale_landscape = overlay_scale_landscape;
|
||||
layout.aspect_adjust_landscape = overlay_aspect_adjust_landscape;
|
||||
layout.x_separation_landscape = overlay_x_separation_landscape;
|
||||
layout.y_separation_landscape = overlay_y_separation_landscape;
|
||||
layout.x_offset_landscape = overlay_x_offset_landscape;
|
||||
layout.y_offset_landscape = overlay_y_offset_landscape;
|
||||
layout.scale_portrait = overlay_scale_portrait;
|
||||
layout.aspect_adjust_portrait = overlay_aspect_adjust_portrait;
|
||||
layout.x_separation_portrait = overlay_x_separation_portrait;
|
||||
layout.x_offset_portrait = overlay_x_offset_portrait;
|
||||
layout.y_offset_portrait = overlay_y_offset_portrait;
|
||||
|
||||
task_push_overlay_load_default(input_overlay_loaded,
|
||||
path_overlay,
|
||||
overlay_hide_in_menu,
|
||||
overlay_hide_when_gamepad_connected,
|
||||
input_overlay_enable,
|
||||
overlay_opacity,
|
||||
overlay_scale,
|
||||
overlay_center_x,
|
||||
overlay_center_y,
|
||||
&layout,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* INPUT REMOTE */
|
||||
@ -38861,6 +38971,8 @@ static enum runloop_state runloop_check_state(
|
||||
static char prev_overlay_restore = false;
|
||||
static unsigned last_width = 0;
|
||||
static unsigned last_height = 0;
|
||||
unsigned video_driver_width = p_rarch->video_driver_width;
|
||||
unsigned video_driver_height = p_rarch->video_driver_height;
|
||||
bool check_next_rotation = true;
|
||||
bool input_overlay_hide_in_menu = settings->bools.input_overlay_hide_in_menu;
|
||||
bool input_overlay_hide_when_gamepad_connected = settings->bools.input_overlay_hide_when_gamepad_connected;
|
||||
@ -38897,23 +39009,22 @@ static enum runloop_state runloop_check_state(
|
||||
prev_overlay_restore = false;
|
||||
}
|
||||
|
||||
/* If video aspect ratio has changed, check overlay
|
||||
* rotation (if required) */
|
||||
if (input_overlay_auto_rotate)
|
||||
{
|
||||
unsigned video_driver_width = p_rarch->video_driver_width;
|
||||
unsigned video_driver_height = p_rarch->video_driver_height;
|
||||
|
||||
/* Check whether video aspect has changed */
|
||||
if ((video_driver_width != last_width) ||
|
||||
(video_driver_height != last_height))
|
||||
{
|
||||
/* Update scaling/offset factors */
|
||||
command_event(CMD_EVENT_OVERLAY_SET_SCALE_FACTOR, NULL);
|
||||
|
||||
/* Check overlay rotation, if required */
|
||||
if (input_overlay_auto_rotate)
|
||||
input_overlay_auto_rotate_(p_rarch,
|
||||
p_rarch->overlay_ptr);
|
||||
|
||||
last_width = video_driver_width;
|
||||
last_height = video_driver_height;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Check quit key */
|
||||
|
@ -46,9 +46,7 @@ struct overlay_loader
|
||||
unsigned pos_increment;
|
||||
|
||||
float overlay_opacity;
|
||||
float overlay_scale;
|
||||
float overlay_center_x;
|
||||
float overlay_center_y;
|
||||
overlay_layout_t layout;
|
||||
|
||||
enum overlay_status state;
|
||||
enum overlay_image_transfer_status loading_status;
|
||||
@ -225,6 +223,8 @@ static bool task_overlay_load_desc(
|
||||
|
||||
desc->x = (float)strtod(x, NULL) * width_mod;
|
||||
desc->y = (float)strtod(y, NULL) * height_mod;
|
||||
desc->x_shift = desc->x;
|
||||
desc->y_shift = desc->y;
|
||||
|
||||
if (string_is_equal(box, "radial"))
|
||||
desc->hitbox = OVERLAY_HITBOX_RADIAL;
|
||||
@ -709,13 +709,12 @@ static void task_overlay_handler(retro_task_t *task)
|
||||
data->active = loader->active;
|
||||
data->size = loader->size;
|
||||
data->overlay_opacity = loader->overlay_opacity;
|
||||
data->overlay_scale = loader->overlay_scale;
|
||||
data->overlay_center_x = loader->overlay_center_x;
|
||||
data->overlay_center_y = loader->overlay_center_y;
|
||||
data->overlay_enable = loader->overlay_enable;
|
||||
data->hide_in_menu = loader->overlay_hide_in_menu;
|
||||
data->hide_when_gamepad_connected = loader->overlay_hide_when_gamepad_connected;
|
||||
|
||||
memcpy(&data->layout, &loader->layout, sizeof(overlay_layout_t));
|
||||
|
||||
task_set_data(task, data);
|
||||
}
|
||||
}
|
||||
@ -744,9 +743,7 @@ bool task_push_overlay_load_default(
|
||||
bool overlay_hide_when_gamepad_connected,
|
||||
bool input_overlay_enable,
|
||||
float input_overlay_opacity,
|
||||
float input_overlay_scale,
|
||||
float input_overlay_center_x,
|
||||
float input_overlay_center_y,
|
||||
overlay_layout_t *layout,
|
||||
void *user_data)
|
||||
{
|
||||
task_finder_data_t find_data;
|
||||
@ -754,7 +751,7 @@ bool task_push_overlay_load_default(
|
||||
config_file_t *conf = NULL;
|
||||
overlay_loader_t *loader = NULL;
|
||||
|
||||
if (string_is_empty(overlay_path))
|
||||
if (string_is_empty(overlay_path) || !layout)
|
||||
return false;
|
||||
|
||||
/* Prevent overlay from being loaded if it already is being loaded */
|
||||
@ -797,15 +794,15 @@ bool task_push_overlay_load_default(
|
||||
loader->overlay_hide_when_gamepad_connected = overlay_hide_when_gamepad_connected;
|
||||
loader->overlay_enable = input_overlay_enable;
|
||||
loader->overlay_opacity = input_overlay_opacity;
|
||||
loader->overlay_scale = input_overlay_scale;
|
||||
loader->overlay_center_x = input_overlay_center_x;
|
||||
loader->overlay_center_y = input_overlay_center_y;
|
||||
loader->conf = conf;
|
||||
loader->state = OVERLAY_STATUS_DEFERRED_LOAD;
|
||||
loader->pos_increment = (loader->size / 4) ? (loader->size / 4) : 4;
|
||||
#ifdef RARCH_INTERNAL
|
||||
loader->driver_rgba_support = video_driver_supports_rgba();
|
||||
#endif
|
||||
|
||||
memcpy(&loader->layout, layout, sizeof(overlay_layout_t));
|
||||
|
||||
t = task_init();
|
||||
|
||||
if (!t)
|
||||
|
@ -37,6 +37,10 @@
|
||||
/* Required for task_push_core_backup() */
|
||||
#include "../core_backup.h"
|
||||
|
||||
#if defined(HAVE_OVERLAY)
|
||||
#include "../input/input_overlay.h"
|
||||
#endif
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct nbio_buf
|
||||
@ -170,9 +174,7 @@ bool task_push_overlay_load_default(
|
||||
bool overlay_hide_when_gamepad_connected,
|
||||
bool input_overlay_enable,
|
||||
float input_overlay_opacity,
|
||||
float input_overlay_scale,
|
||||
float input_overlay_center_x,
|
||||
float input_overlay_center_y,
|
||||
overlay_layout_t *layout,
|
||||
void *user_data);
|
||||
#endif
|
||||
|
||||
|
@ -105,9 +105,17 @@ QWidget *OverlayPage::widget()
|
||||
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_PRESET);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_OPACITY);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_SCALE);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_CENTER_X);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_CENTER_Y);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_SCALE_LANDSCAPE);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_LANDSCAPE);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_LANDSCAPE);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_Y_SEPARATION_LANDSCAPE);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_X_OFFSET_LANDSCAPE);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_LANDSCAPE);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_SCALE_PORTRAIT);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_ASPECT_ADJUST_PORTRAIT);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_X_SEPARATION_PORTRAIT);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_X_OFFSET_PORTRAIT);
|
||||
overlayGroup->add(MENU_ENUM_LABEL_OVERLAY_Y_OFFSET_PORTRAIT);
|
||||
|
||||
layout->addWidget(overlayGroup);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user