aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2020-01-14 23:21:41 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2020-01-14 23:21:41 +0100
commit61707393733d32a273bd65b65f2fb86b67943d51 (patch)
tree0a8384f0e43db927a2affad79fb42dad6d39c19c
parenteb521cfa1947417ac732850c03976b052b7bec4e (diff)
downloadmephisto.lv2-61707393733d32a273bd65b65f2fb86b67943d51.tar.xz
Squashed 'subprojects/d2tk/' changes from b145662..e7d28dd
e7d28dd backend: load images relative to bundle_path. git-subtree-dir: subprojects/d2tk git-subtree-split: e7d28dd34687a815e893ae7e0a228f378d4efc86
-rw-r--r--VERSION2
-rw-r--r--src/backend_cairo.c6
-rw-r--r--src/backend_nanovg.c6
3 files changed, 11 insertions, 3 deletions
diff --git a/VERSION b/VERSION
index b004e03..cd63bdd 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.947
+0.1.949
diff --git a/src/backend_cairo.c b/src/backend_cairo.c
index 0a39638..14d3d81 100644
--- a/src/backend_cairo.c
+++ b/src/backend_cairo.c
@@ -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
diff --git a/src/backend_nanovg.c b/src/backend_nanovg.c
index 1086d94..247e4eb 100644
--- a/src/backend_nanovg.c
+++ b/src/backend_nanovg.c
@@ -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;