mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 18:58:21 +00:00
Create rpng_set_buf_ptr
This commit is contained in:
parent
d5837f4b7c
commit
511b2c6d83
@ -254,6 +254,9 @@ bool rpng_nbio_load_image_argb_start(struct rpng_t *rpng)
|
||||
|
||||
bool rpng_is_valid(struct rpng_t *rpng)
|
||||
{
|
||||
if (!rpng)
|
||||
return false;
|
||||
|
||||
if (rpng->has_ihdr)
|
||||
return true;
|
||||
if (rpng->has_idat)
|
||||
@ -262,3 +265,11 @@ bool rpng_is_valid(struct rpng_t *rpng)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void rpng_set_buf_ptr(struct rpng_t *rpng, uint8_t *data)
|
||||
{
|
||||
if (!rpng)
|
||||
return false;
|
||||
|
||||
rpng->buff_data = data;
|
||||
}
|
||||
|
@ -107,6 +107,8 @@ struct rpng_t *rpng_nbio_load_image_argb_init(const char *path);
|
||||
|
||||
bool rpng_is_valid(struct rpng_t *rpng);
|
||||
|
||||
void rpng_set_buf_ptr(struct rpng_t *rpng, uint8_t *data);
|
||||
|
||||
void rpng_nbio_load_image_free(struct rpng_t *rpng);
|
||||
|
||||
bool rpng_nbio_load_image_argb_iterate(struct rpng_t *rpng);
|
||||
|
@ -434,6 +434,7 @@ static int cb_nbio_generic(nbio_handle_t *nbio, size_t *len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
rpng_set_buf_ptr(nbio->image.handle, (uint8_t*)ptr);
|
||||
nbio->image.handle->buff_data = (uint8_t*)ptr;
|
||||
nbio->image.pos_increment = (*len / 2) ? (*len / 2) : 1;
|
||||
nbio->image.processing_pos_increment = (*len / 4) ? (*len / 4) : 1;
|
||||
|
Loading…
Reference in New Issue
Block a user