(video_thread_wrapper) Call video_driver_get_data instead of

video_driver_get_ptr - last parameter passed to video_driver_get_ptr
was hardcoded
This commit is contained in:
twinaphex 2021-03-20 15:15:21 +01:00
parent 76c4f12089
commit f1330f3c98
3 changed files with 11 additions and 2 deletions

View File

@ -1259,7 +1259,8 @@ bool video_thread_font_init(const void **font_driver, void **font_handle,
bool is_threaded)
{
thread_packet_t pkt;
thread_video_t *thr = (thread_video_t*)video_driver_get_ptr(true);
thread_video_t *thr = (thread_video_t*)
video_driver_get_data();
if (!thr)
return false;
@ -1283,7 +1284,7 @@ unsigned video_thread_texture_load(void *data,
custom_command_method_t func)
{
thread_packet_t pkt;
thread_video_t *thr = (thread_video_t*)video_driver_get_ptr(true);
thread_video_t *thr = (thread_video_t*)video_driver_get_data();
if (!thr)
return 0;

View File

@ -435,6 +435,12 @@ void *video_driver_get_ptr(bool force_nonthreaded_data)
return VIDEO_DRIVER_GET_PTR_INTERNAL(p_rarch, force_nonthreaded_data);
}
void *video_driver_get_data(void)
{
struct rarch_state *p_rarch = &rarch_st;
return p_rarch->video_driver_data;
}
static int16_t input_state_wrap(
input_driver_t *current_input,
void *data,

View File

@ -1585,6 +1585,8 @@ const char* config_get_video_driver_options(void);
**/
void *video_driver_get_ptr(bool force_nonthreaded_data);
void *video_driver_get_data(void);
bool video_driver_set_rotation(unsigned rotation);
bool video_driver_set_video_mode(unsigned width,