mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Rename get_rotation to retroarch_get_rotation
This commit is contained in:
parent
ddd9fbf6ae
commit
63e437d58f
@ -4255,11 +4255,11 @@ static void setting_get_string_representation_uint_custom_viewport_width(rarch_s
|
||||
av_info = video_viewport_get_system_av_info();
|
||||
geom = (struct retro_game_geometry*)&av_info->geometry;
|
||||
|
||||
if (!(get_rotation() % 2) && (*setting->value.target.unsigned_integer%geom->base_width == 0))
|
||||
if (!(retroarch_get_rotation() % 2) && (*setting->value.target.unsigned_integer%geom->base_width == 0))
|
||||
snprintf(s, len, "%u (%ux)",
|
||||
*setting->value.target.unsigned_integer,
|
||||
*setting->value.target.unsigned_integer / geom->base_width);
|
||||
else if ((get_rotation() % 2) && (*setting->value.target.unsigned_integer%geom->base_height == 0))
|
||||
else if ((retroarch_get_rotation() % 2) && (*setting->value.target.unsigned_integer%geom->base_height == 0))
|
||||
snprintf(s, len, "%u (%ux)",
|
||||
*setting->value.target.unsigned_integer,
|
||||
*setting->value.target.unsigned_integer / geom->base_height);
|
||||
@ -4279,11 +4279,11 @@ static void setting_get_string_representation_uint_custom_viewport_height(rarch_
|
||||
av_info = video_viewport_get_system_av_info();
|
||||
geom = (struct retro_game_geometry*)&av_info->geometry;
|
||||
|
||||
if (!(get_rotation() % 2) && (*setting->value.target.unsigned_integer%geom->base_height == 0))
|
||||
if (!(retroarch_get_rotation() % 2) && (*setting->value.target.unsigned_integer%geom->base_height == 0))
|
||||
snprintf(s, len, "%u (%ux)",
|
||||
*setting->value.target.unsigned_integer,
|
||||
*setting->value.target.unsigned_integer / geom->base_height);
|
||||
else if ((get_rotation() % 2) && (*setting->value.target.unsigned_integer%geom->base_width == 0))
|
||||
else if ((retroarch_get_rotation() % 2) && (*setting->value.target.unsigned_integer%geom->base_width == 0))
|
||||
snprintf(s, len, "%u (%ux)",
|
||||
*setting->value.target.unsigned_integer,
|
||||
*setting->value.target.unsigned_integer / geom->base_width);
|
||||
@ -4690,16 +4690,20 @@ static int setting_uint_action_left_custom_viewport_width(
|
||||
|
||||
if (custom->width <= 1)
|
||||
custom->width = 1;
|
||||
else if (settings->bools.video_scale_integer) {
|
||||
if (get_rotation() % 2)
|
||||
else if (settings->bools.video_scale_integer)
|
||||
{
|
||||
if (retroarch_get_rotation() % 2)
|
||||
{
|
||||
if (custom->width > geom->base_height)
|
||||
custom->width -= geom->base_height;
|
||||
} else {
|
||||
if (custom->width > geom->base_width)
|
||||
custom->width -= geom->base_width;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (custom->width > geom->base_width)
|
||||
custom->width -= geom->base_width;
|
||||
}
|
||||
}
|
||||
} else
|
||||
else
|
||||
custom->width -= 1;
|
||||
|
||||
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
|
||||
@ -4727,14 +4731,16 @@ static int setting_uint_action_left_custom_viewport_height(
|
||||
custom->height = 1;
|
||||
else if (settings->bools.video_scale_integer)
|
||||
{
|
||||
if (get_rotation() % 2)
|
||||
if (retroarch_get_rotation() % 2)
|
||||
{
|
||||
if (custom->height > geom->base_width)
|
||||
custom->height -= geom->base_width;
|
||||
} else {
|
||||
if (custom->height > geom->base_height)
|
||||
custom->height -= geom->base_height;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (custom->height > geom->base_height)
|
||||
custom->height -= geom->base_height;
|
||||
}
|
||||
}
|
||||
else
|
||||
custom->height -= 1;
|
||||
@ -4931,13 +4937,14 @@ static int setting_uint_action_right_custom_viewport_width(
|
||||
|
||||
video_driver_get_viewport_info(&vp);
|
||||
|
||||
if (settings->bools.video_scale_integer) {
|
||||
if (get_rotation() % 2){
|
||||
if (settings->bools.video_scale_integer)
|
||||
{
|
||||
if (retroarch_get_rotation() % 2)
|
||||
custom->width += geom->base_height;
|
||||
} else {
|
||||
custom->width += geom->base_width;
|
||||
}
|
||||
} else
|
||||
else
|
||||
custom->width += geom->base_width;
|
||||
}
|
||||
else
|
||||
custom->width += 1;
|
||||
|
||||
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
|
||||
@ -4961,13 +4968,14 @@ static int setting_uint_action_right_custom_viewport_height(
|
||||
|
||||
video_driver_get_viewport_info(&vp);
|
||||
|
||||
if (settings->bools.video_scale_integer){
|
||||
if (get_rotation() % 2){
|
||||
if (settings->bools.video_scale_integer)
|
||||
{
|
||||
if (retroarch_get_rotation() % 2)
|
||||
custom->height += geom->base_width;
|
||||
} else {
|
||||
custom->height += geom->base_height;
|
||||
}
|
||||
} else
|
||||
else
|
||||
custom->height += geom->base_height;
|
||||
}
|
||||
else
|
||||
custom->height += 1;
|
||||
|
||||
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
|
||||
@ -5895,14 +5903,18 @@ static int setting_action_start_custom_viewport_width(rarch_setting_t *setting)
|
||||
|
||||
video_driver_get_viewport_info(&vp);
|
||||
|
||||
if (settings->bools.video_scale_integer){
|
||||
if (get_rotation() % 2){
|
||||
if (settings->bools.video_scale_integer)
|
||||
{
|
||||
if (retroarch_get_rotation() % 2)
|
||||
{
|
||||
custom->width = ((custom->width + geom->base_height - 1) /
|
||||
geom->base_height) * geom->base_height;
|
||||
} else
|
||||
custom->width = ((custom->width + geom->base_width - 1) /
|
||||
geom->base_width) * geom->base_width;
|
||||
} else
|
||||
geom->base_height) * geom->base_height;
|
||||
}
|
||||
else
|
||||
custom->width = ((custom->width + geom->base_width - 1) /
|
||||
geom->base_width) * geom->base_width;
|
||||
}
|
||||
else
|
||||
custom->width = vp.full_width - custom->x;
|
||||
|
||||
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
|
||||
@ -5924,14 +5936,19 @@ static int setting_action_start_custom_viewport_height(rarch_setting_t *setting)
|
||||
return -1;
|
||||
|
||||
video_driver_get_viewport_info(&vp);
|
||||
if (settings->bools.video_scale_integer){
|
||||
if (get_rotation() % 2){
|
||||
|
||||
if (settings->bools.video_scale_integer)
|
||||
{
|
||||
if (retroarch_get_rotation() % 2)
|
||||
{
|
||||
custom->height = ((custom->height + geom->base_width - 1) /
|
||||
geom->base_width) * geom->base_width;
|
||||
} else
|
||||
custom->height = ((custom->height + geom->base_height - 1) /
|
||||
geom->base_height) * geom->base_height;
|
||||
} else
|
||||
}
|
||||
else
|
||||
custom->height = ((custom->height + geom->base_height - 1) /
|
||||
geom->base_height) * geom->base_height;
|
||||
}
|
||||
else
|
||||
custom->height = vp.full_height - custom->y;
|
||||
|
||||
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
|
||||
@ -6311,12 +6328,15 @@ void general_write_handler(rarch_setting_t *setting)
|
||||
{
|
||||
custom->x = 0;
|
||||
custom->y = 0;
|
||||
if (get_rotation() %2){
|
||||
if (retroarch_get_rotation() %2)
|
||||
{
|
||||
custom->width = ((custom->width + geom->base_height - 1) / geom->base_height) * geom->base_height;
|
||||
custom->height = ((custom->height + geom->base_width - 1) / geom->base_width) * geom->base_width;
|
||||
} else {
|
||||
custom->width = ((custom->width + geom->base_width - 1) / geom->base_width) * geom->base_width;
|
||||
custom->height = ((custom->height + geom->base_height - 1) / geom->base_height) * geom->base_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
custom->width = ((custom->width + geom->base_width - 1) / geom->base_width) * geom->base_width;
|
||||
custom->height = ((custom->height + geom->base_height - 1) / geom->base_height) * geom->base_height;
|
||||
}
|
||||
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
|
||||
(float)custom->width / custom->height;
|
||||
@ -6451,10 +6471,13 @@ void general_write_handler(rarch_setting_t *setting)
|
||||
custom->y = 0;
|
||||
/* Round down when rotation is "horizontal", round up when rotation is "vertical"
|
||||
to avoid expanding viewport each time user rotates */
|
||||
if (get_rotation() %2){
|
||||
if (retroarch_get_rotation() %2)
|
||||
{
|
||||
custom->width = MAX(1,(custom->width / geom->base_height)) * geom->base_height;
|
||||
custom->height = MAX(1,(custom->height/ geom->base_width )) * geom->base_width;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
custom->width = ((custom->width + geom->base_width - 1) / geom->base_width) * geom->base_width;
|
||||
custom->height = ((custom->height + geom->base_height - 1) / geom->base_height) * geom->base_height;
|
||||
}
|
||||
|
17
retroarch.c
17
retroarch.c
@ -20000,10 +20000,13 @@ static void video_driver_set_viewport_square_pixel(void)
|
||||
highest = i;
|
||||
}
|
||||
|
||||
if (get_rotation() % 2) {
|
||||
if (retroarch_get_rotation() % 2)
|
||||
{
|
||||
aspect_x = height / highest;
|
||||
aspect_y = width / highest;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
aspect_x = width / highest;
|
||||
aspect_y = height / highest;
|
||||
}
|
||||
@ -20180,7 +20183,7 @@ static bool video_driver_init_internal(bool *video_is_threaded)
|
||||
video_driver_get_viewport_info(custom_vp);
|
||||
}
|
||||
|
||||
video_driver_set_rotation(get_rotation() % 4);
|
||||
video_driver_set_rotation(retroarch_get_rotation() % 4);
|
||||
|
||||
current_video->suppress_screensaver(video_driver_data,
|
||||
settings->bools.ui_suspend_screensaver_enable);
|
||||
@ -21091,7 +21094,7 @@ void video_viewport_get_scaled_integer(struct video_viewport *vp,
|
||||
* geometry for the "normal" case. */
|
||||
unsigned base_height;
|
||||
|
||||
if (get_rotation() % 2)
|
||||
if (retroarch_get_rotation() % 2)
|
||||
base_height = video_driver_av_info.geometry.base_width;
|
||||
else
|
||||
base_height = video_driver_av_info.geometry.base_height;
|
||||
@ -28799,6 +28802,8 @@ static void core_free_retro_game_info(struct retro_game_info *dest)
|
||||
dest->meta = NULL;
|
||||
}
|
||||
|
||||
unsigned int get_rotation(){
|
||||
return configuration_settings->uints.video_rotation + runloop_system.rotation;
|
||||
unsigned int retroarch_get_rotation(void)
|
||||
{
|
||||
settings_t *settings = configuration_settings;
|
||||
return settings->uints.video_rotation + runloop_system.rotation;
|
||||
}
|
||||
|
@ -2020,7 +2020,7 @@ bool menu_driver_is_toggled(void);
|
||||
|
||||
bool menu_widgets_ready(void);
|
||||
|
||||
unsigned int get_rotation(void);
|
||||
unsigned int retroarch_get_rotation(void);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user