Commit ab6d66d8 authored by Hanspeter Portner's avatar Hanspeter Portner

Merge commit '61707393'

parents 723c91bb 61707393
......@@ -655,10 +655,14 @@ d2tk_cairo_process(void *data, d2tk_core_t *core, const d2tk_com_t *com,
if(!*sprite)
{
char *img_path = NULL;
assert(asprintf(&img_path, "%s%s", backend->bundle_path, body->path) != -1);
assert(img_path);
int W, H, N;
stbi_set_unpremultiply_on_load(1);
stbi_convert_iphone_png_to_rgb(1);
uint8_t *pixels = stbi_load(body->path, &W, &H, &N, 4);
uint8_t *pixels = stbi_load(img_path, &W, &H, &N, 4);
assert(pixels );
// bitswap and premultiply pixel data
......
......@@ -729,7 +729,11 @@ d2tk_nanovg_process(void *data, d2tk_core_t *core, const d2tk_com_t *com,
if(!*sprite)
{
*sprite = nvgCreateImage(ctx, body->path, NVG_IMAGE_GENERATE_MIPMAPS);
char *img_path = NULL;
assert(asprintf(&img_path, "%s%s", backend->bundle_path, body->path) != -1);
assert(img_path);
*sprite = nvgCreateImage(ctx, img_path, NVG_IMAGE_GENERATE_MIPMAPS);
}
const int img = *sprite;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment