mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
video_driver_ctl - avoid cost of grabbing the pointers for actions
where it isn't needed
This commit is contained in:
parent
5cea9e5400
commit
0d5c928e68
@ -1181,15 +1181,21 @@ void video_driver_set_pixel_format(enum retro_pixel_format fmt)
|
|||||||
|
|
||||||
bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
|
bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
|
||||||
{
|
{
|
||||||
driver_t *driver = driver_get_ptr();
|
|
||||||
const video_driver_t *video = video_driver_ctx_get_ptr(driver);
|
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case RARCH_DISPLAY_CTL_IS_FOCUSED:
|
case RARCH_DISPLAY_CTL_IS_FOCUSED:
|
||||||
return video->focus(driver->video_data);
|
{
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
const video_driver_t *video = video_driver_ctx_get_ptr(driver);
|
||||||
|
return video->focus(driver->video_data);
|
||||||
|
}
|
||||||
case RARCH_DISPLAY_CTL_HAS_WINDOWED:
|
case RARCH_DISPLAY_CTL_HAS_WINDOWED:
|
||||||
return video->has_windowed(driver->video_data);
|
{
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
const video_driver_t *video = video_driver_ctx_get_ptr(driver);
|
||||||
|
return video->has_windowed(driver->video_data);
|
||||||
|
}
|
||||||
case RARCH_DISPLAY_CTL_GET_FRAME_COUNT:
|
case RARCH_DISPLAY_CTL_GET_FRAME_COUNT:
|
||||||
{
|
{
|
||||||
uint64_t **ptr = (uint64_t**)data;
|
uint64_t **ptr = (uint64_t**)data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user