aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2020-01-15 07:59:42 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2020-01-15 07:59:42 +0100
commit600e480af340d8fb462d7909440d839bc82a428a (patch)
tree810770ee56560bb1274e1b7ef7b5f8378a6f3783
parent08777a5e7b2707f48489e5dcbd7618b93f9d5cee (diff)
parente7d28dd34687a815e893ae7e0a228f378d4efc86 (diff)
downloadd2tk-600e480af340d8fb462d7909440d839bc82a428a.tar.xz
Merge branch 'master' of /media/sdext/omk/d2tk
-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;