diff examples/example-sprite/main.c @ 364:570ab19bf268

misc: start removing adventure from library
author David Demelier <markand@malikania.fr>
date Sun, 24 Oct 2021 11:29:04 +0200
parents cd8b87ddd1e7
children 19782ea1cf4a
line wrap: on
line diff
--- a/examples/example-sprite/main.c	Sun Oct 24 09:55:12 2021 +0200
+++ b/examples/example-sprite/main.c	Sun Oct 24 11:29:04 2021 +0200
@@ -37,9 +37,10 @@
 #include <ui/label.h>
 #include <ui/ui.h>
 
+#include <assets/sprites/people.h>
+
 #define W       1280
 #define H       720
-#define PATH(r) util_pathf("%s/%s", sys_dir(SYS_DIR_DATA), r)
 #define HEADER "Keys: <Left>/<Right> and <Up/Down> to select a column/row. Current: %u, %u (total %u/%u)"
 
 static char msg[512];
@@ -67,7 +68,7 @@
 		panic();
 	if (window_open("Example - Sprite", W, H) < 0)
 		panic();
-	if (image_open(&texture, PATH("sprites/people.png")) < 0)
+	if (image_openmem(&texture, assets_sprites_people, sizeof (assets_sprites_people)) < 0)
 		panic();
 
 	sprite_init(&sprite, &texture, 48, 48);