mirror of
https://github.com/libretro/RetroArch
synced 2025-02-22 12:40:09 +00:00
video_thread_wrapper.c - cleanups
This commit is contained in:
parent
e078e1d379
commit
b7f7b1f3b7
@ -360,8 +360,6 @@ static bool thread_handle_packet(thread_video_t *thr, const thread_packet_t *inc
|
|||||||
static void thread_loop(void *data)
|
static void thread_loop(void *data)
|
||||||
{
|
{
|
||||||
thread_video_t *thr = (thread_video_t*)data;
|
thread_video_t *thr = (thread_video_t*)data;
|
||||||
unsigned i = 0;
|
|
||||||
(void)i;
|
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@ -427,9 +425,6 @@ static void thread_loop(void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static bool thread_alive(void *data)
|
static bool thread_alive(void *data)
|
||||||
{
|
{
|
||||||
bool ret;
|
bool ret;
|
||||||
@ -613,24 +608,22 @@ static bool thread_init(thread_video_t *thr, const video_info_t *info,
|
|||||||
max_size = info->input_scale * RARCH_SCALE_BASE;
|
max_size = info->input_scale * RARCH_SCALE_BASE;
|
||||||
max_size *= max_size;
|
max_size *= max_size;
|
||||||
max_size *= info->rgb32 ? sizeof(uint32_t) : sizeof(uint16_t);
|
max_size *= info->rgb32 ? sizeof(uint32_t) : sizeof(uint16_t);
|
||||||
thr->frame.buffer = (uint8_t*)malloc(max_size);
|
thr->frame.buffer = (uint8_t*)malloc(max_size);
|
||||||
|
|
||||||
if (!thr->frame.buffer)
|
if (!thr->frame.buffer)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
memset(thr->frame.buffer, 0x80, max_size);
|
memset(thr->frame.buffer, 0x80, max_size);
|
||||||
|
|
||||||
thr->last_time = retro_get_time_usec();
|
thr->last_time = retro_get_time_usec();
|
||||||
thr->thread = sthread_create(thread_loop, thr);
|
thr->thread = sthread_create(thread_loop, thr);
|
||||||
|
|
||||||
if (!thr->thread)
|
if (!thr->thread)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
thread_send_and_wait(thr, &pkt);
|
thread_send_and_wait(thr, &pkt);
|
||||||
|
|
||||||
/* thr->send_cmd_func = thread_send_cmd; */
|
thr->send_and_wait = thread_send_and_wait;
|
||||||
/* thr->wait_reply_func = thread_wait_reply; */
|
|
||||||
|
|
||||||
thr->send_and_wait = thread_send_and_wait;
|
|
||||||
return pkt.data.b;
|
return pkt.data.b;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -823,6 +816,7 @@ static void thread_overlay_set_alpha(void *data, unsigned idx, float mod)
|
|||||||
|
|
||||||
if (!thr)
|
if (!thr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
slock_lock(thr->alpha_lock);
|
slock_lock(thr->alpha_lock);
|
||||||
thr->alpha_mod[idx] = mod;
|
thr->alpha_mod[idx] = mod;
|
||||||
thr->alpha_update = true;
|
thr->alpha_update = true;
|
||||||
|
@ -199,8 +199,6 @@ typedef struct thread_video
|
|||||||
bool alpha_update;
|
bool alpha_update;
|
||||||
slock_t *alpha_lock;
|
slock_t *alpha_lock;
|
||||||
|
|
||||||
/* void (*send_cmd_func)(struct thread_video *, enum thread_cmd); */
|
|
||||||
/* void (*wait_reply_func)(struct thread_video *, enum thread_cmd); */
|
|
||||||
void (*send_and_wait)(struct thread_video *, thread_packet_t*);
|
void (*send_and_wait)(struct thread_video *, thread_packet_t*);
|
||||||
enum thread_cmd send_cmd;
|
enum thread_cmd send_cmd;
|
||||||
enum thread_cmd reply_cmd;
|
enum thread_cmd reply_cmd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user