(task_image.c) Refactor code

This commit is contained in:
twinaphex 2017-05-18 01:31:14 +02:00
parent 9a90477c6d
commit 668813cca9

View File

@ -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;
}