mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Move video_data_own to gfx/video_driver.c
This commit is contained in:
parent
d181870caa
commit
c62150c2a2
2
driver.c
2
driver.c
@ -359,7 +359,7 @@ void init_drivers(int flags)
|
|||||||
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
||||||
|
|
||||||
if (flags & DRIVER_VIDEO)
|
if (flags & DRIVER_VIDEO)
|
||||||
driver->video_data_own = false;
|
video_driver_ctl(RARCH_DISPLAY_CTL_UNSET_OWN_DRIVER, NULL);
|
||||||
if (flags & DRIVER_AUDIO)
|
if (flags & DRIVER_AUDIO)
|
||||||
driver->audio_data_own = false;
|
driver->audio_data_own = false;
|
||||||
if (flags & DRIVER_INPUT)
|
if (flags & DRIVER_INPUT)
|
||||||
|
1
driver.h
1
driver.h
@ -249,7 +249,6 @@ typedef struct driver
|
|||||||
*
|
*
|
||||||
* Typically, if a driver intends to make use of this, it should
|
* Typically, if a driver intends to make use of this, it should
|
||||||
* set this to true at the end of its 'init' function. */
|
* set this to true at the end of its 'init' function. */
|
||||||
bool video_data_own;
|
|
||||||
bool audio_data_own;
|
bool audio_data_own;
|
||||||
bool input_data_own;
|
bool input_data_own;
|
||||||
bool camera_data_own;
|
bool camera_data_own;
|
||||||
|
@ -765,7 +765,7 @@ static void *d3d_init(const video_info_t *info,
|
|||||||
|
|
||||||
input_driver_set(input, input_data);
|
input_driver_set(input, input_data);
|
||||||
|
|
||||||
driver->video_data_own = true;
|
video_driver_ctl(RARCH_DISPLAY_CTL_SET_OWN_DRIVER, NULL);
|
||||||
return vid;
|
return vid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -806,7 +806,7 @@ static void *d3d_init(const video_info_t *info,
|
|||||||
vid->keep_aspect = info->force_aspect;
|
vid->keep_aspect = info->force_aspect;
|
||||||
|
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
driver->video_data_own = true;
|
video_driver_ctl(RARCH_DISPLAY_CTL_SET_OWN_DRIVER, NULL);
|
||||||
driver->input_data_own = true;
|
driver->input_data_own = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -94,6 +94,7 @@ static bool gfx_use_rgba;
|
|||||||
static uint64_t video_frame_count;
|
static uint64_t video_frame_count;
|
||||||
|
|
||||||
static void *video_data;
|
static void *video_data;
|
||||||
|
static bool video_data_own;
|
||||||
static const video_driver_t *current_video;
|
static const video_driver_t *current_video;
|
||||||
|
|
||||||
/* Interface for "poking". */
|
/* Interface for "poking". */
|
||||||
@ -533,7 +534,7 @@ static bool uninit_video_input(void)
|
|||||||
input_driver_ctl(RARCH_INPUT_CTL_DEINIT, NULL);
|
input_driver_ctl(RARCH_INPUT_CTL_DEINIT, NULL);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!driver->video_data_own &&
|
!video_data_own &&
|
||||||
video_data &&
|
video_data &&
|
||||||
current_video &&
|
current_video &&
|
||||||
current_video->free)
|
current_video->free)
|
||||||
@ -553,7 +554,7 @@ static bool uninit_video_input(void)
|
|||||||
video_driver_ctl(RARCH_DISPLAY_CTL_UNSET_RGBA, NULL);
|
video_driver_ctl(RARCH_DISPLAY_CTL_UNSET_RGBA, NULL);
|
||||||
current_video = NULL;
|
current_video = NULL;
|
||||||
|
|
||||||
if (!driver->video_data_own)
|
if (!video_data_own)
|
||||||
video_data = NULL;
|
video_data = NULL;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1618,6 +1619,14 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
|
|||||||
global->console.screen.flicker_filter_index);
|
global->console.screen.flicker_filter_index);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
case RARCH_DISPLAY_CTL_SET_OWN_DRIVER:
|
||||||
|
video_data_own = true;
|
||||||
|
break;
|
||||||
|
case RARCH_DISPLAY_CTL_UNSET_OWN_DRIVER:
|
||||||
|
video_data_own = false;
|
||||||
|
break;
|
||||||
|
case RARCH_DISPLAY_CTL_OWNS_DRIVER:
|
||||||
|
return video_data_own;
|
||||||
case RARCH_DISPLAY_CTL_NONE:
|
case RARCH_DISPLAY_CTL_NONE:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -313,7 +313,10 @@ enum rarch_display_ctl_state
|
|||||||
RARCH_DISPLAY_CTL_CACHED_FRAME_RENDER,
|
RARCH_DISPLAY_CTL_CACHED_FRAME_RENDER,
|
||||||
RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB,
|
RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB,
|
||||||
RARCH_DISPLAY_CTL_SHOW_MOUSE,
|
RARCH_DISPLAY_CTL_SHOW_MOUSE,
|
||||||
RARCH_DISPLAY_CTL_GET_FRAME_COUNT
|
RARCH_DISPLAY_CTL_GET_FRAME_COUNT,
|
||||||
|
RARCH_DISPLAY_CTL_SET_OWN_DRIVER,
|
||||||
|
RARCH_DISPLAY_CTL_UNSET_OWN_DRIVER,
|
||||||
|
RARCH_DISPLAY_CTL_OWNS_DRIVER
|
||||||
};
|
};
|
||||||
|
|
||||||
bool video_driver_ctl(enum rarch_display_ctl_state state, void *data);
|
bool video_driver_ctl(enum rarch_display_ctl_state state, void *data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user