From 5da2b11fcf69d12b93ea73938ababdb98a749e40 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Mon, 14 Jan 2019 21:17:47 -0500 Subject: bake assets into build --- src/sdl/sprites.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/sdl/sprites.c') diff --git a/src/sdl/sprites.c b/src/sdl/sprites.c index 9b9b42f..0aa96fc 100644 --- a/src/sdl/sprites.c +++ b/src/sdl/sprites.c @@ -5,16 +5,19 @@ #include "stb_image.h" #include "util.h" #include "sprites.h" +#include "assets.h" void sprites_init( SDL_Renderer * const renderer, - const char * const png_path, SDL_Texture **sprites ) { + // get asset + const asset_t * const asset = asset_get(ASSET_SPRITES_PNG); + // load image int im_w, im_h; - unsigned char *im_data = stbi_load(png_path, &im_w, &im_h, NULL, 4); + unsigned char *im_data = stbi_load_from_memory(asset->buf, asset->len, &im_w, &im_h, NULL, 4); if (!im_data) { die("stbi_load(): %s", stbi_failure_reason()); } -- cgit v1.2.3