mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
Use video_driver_set_rotation
This commit is contained in:
parent
42cf31ef2c
commit
de8d41a0f8
@ -700,12 +700,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
|
||||
global->system.rotation = rotation;
|
||||
|
||||
if (driver->video && driver->video->set_rotation)
|
||||
{
|
||||
if (driver->video_data)
|
||||
driver->video->set_rotation(driver->video_data, rotation);
|
||||
}
|
||||
else
|
||||
if (!video_driver_set_rotation(rotation))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
@ -543,8 +543,7 @@ void init_video(void)
|
||||
driver->video->viewport_info(driver->video_data, custom_vp);
|
||||
}
|
||||
|
||||
if (driver->video->set_rotation)
|
||||
driver->video->set_rotation(driver->video_data,
|
||||
video_driver_set_rotation(
|
||||
(settings->video.rotation + global->system.rotation) % 4);
|
||||
|
||||
if (driver->video->suppress_screensaver)
|
||||
@ -595,3 +594,17 @@ void video_driver_set_nonblock_state(bool toggle)
|
||||
if (driver->video->set_nonblock_state)
|
||||
driver->video->set_nonblock_state(driver->video_data, toggle);
|
||||
}
|
||||
|
||||
bool video_driver_set_rotation(unsigned rotation)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
|
||||
if (!driver->video)
|
||||
return false;
|
||||
if (!driver->video->set_rotation)
|
||||
return false;
|
||||
|
||||
driver->video->set_rotation(driver->video_data, rotation);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -276,6 +276,8 @@ bool video_driver_has_windowed(void);
|
||||
|
||||
void video_driver_set_nonblock_state(bool toggle);
|
||||
|
||||
bool video_driver_set_rotation(unsigned rotation);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -3051,8 +3051,7 @@ static void general_write_handler(void *data)
|
||||
}
|
||||
else if (!strcmp(setting->name, "video_rotation"))
|
||||
{
|
||||
if (driver->video && driver->video->set_rotation)
|
||||
driver->video->set_rotation(driver->video_data,
|
||||
video_driver_set_rotation(
|
||||
(*setting->value.unsigned_integer +
|
||||
global->system.rotation) % 4);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user