mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
(task_image.c) Refactor code
This commit is contained in:
parent
9a90477c6d
commit
668813cca9
@ -267,12 +267,17 @@ bool task_image_load_handler(retro_task_t *task)
|
||||
&& (image && image->is_finished )
|
||||
&& (!task_get_cancelled(task)))
|
||||
{
|
||||
void *data = malloc(sizeof(image->ti));
|
||||
struct texture_image *img = (struct texture_image*)malloc(sizeof(struct texture_image));
|
||||
|
||||
if (data)
|
||||
memcpy(data, &image->ti, sizeof(image->ti));
|
||||
if (img)
|
||||
{
|
||||
img->width = image->ti.width;
|
||||
img->height = image->ti.height;
|
||||
img->pixels = image->ti.pixels;
|
||||
img->supports_rgba = image->ti.supports_rgba;
|
||||
}
|
||||
|
||||
task_set_data(task, data);
|
||||
task_set_data(task, img);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user