mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +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;
|
global->system.rotation = rotation;
|
||||||
|
|
||||||
if (driver->video && driver->video->set_rotation)
|
if (!video_driver_set_rotation(rotation))
|
||||||
{
|
|
||||||
if (driver->video_data)
|
|
||||||
driver->video->set_rotation(driver->video_data, rotation);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -543,8 +543,7 @@ void init_video(void)
|
|||||||
driver->video->viewport_info(driver->video_data, custom_vp);
|
driver->video->viewport_info(driver->video_data, custom_vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driver->video->set_rotation)
|
video_driver_set_rotation(
|
||||||
driver->video->set_rotation(driver->video_data,
|
|
||||||
(settings->video.rotation + global->system.rotation) % 4);
|
(settings->video.rotation + global->system.rotation) % 4);
|
||||||
|
|
||||||
if (driver->video->suppress_screensaver)
|
if (driver->video->suppress_screensaver)
|
||||||
@ -595,3 +594,17 @@ void video_driver_set_nonblock_state(bool toggle)
|
|||||||
if (driver->video->set_nonblock_state)
|
if (driver->video->set_nonblock_state)
|
||||||
driver->video->set_nonblock_state(driver->video_data, toggle);
|
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);
|
void video_driver_set_nonblock_state(bool toggle);
|
||||||
|
|
||||||
|
bool video_driver_set_rotation(unsigned rotation);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -3051,8 +3051,7 @@ static void general_write_handler(void *data)
|
|||||||
}
|
}
|
||||||
else if (!strcmp(setting->name, "video_rotation"))
|
else if (!strcmp(setting->name, "video_rotation"))
|
||||||
{
|
{
|
||||||
if (driver->video && driver->video->set_rotation)
|
video_driver_set_rotation(
|
||||||
driver->video->set_rotation(driver->video_data,
|
|
||||||
(*setting->value.unsigned_integer +
|
(*setting->value.unsigned_integer +
|
||||||
global->system.rotation) % 4);
|
global->system.rotation) % 4);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user