video_driver_ctl - avoid cost of grabbing the pointers for actions

where it isn't needed
This commit is contained in:
twinaphex 2015-11-20 15:25:25 +01:00
parent 5cea9e5400
commit 0d5c928e68

View File

@ -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)
{
driver_t *driver = driver_get_ptr();
const video_driver_t *video = video_driver_ctx_get_ptr(driver);
switch (state)
{
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:
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:
{
uint64_t **ptr = (uint64_t**)data;