summaryrefslogtreecommitdiff
path: root/gfx-iso/app/isogfx-demo.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2023-07-19 08:35:00 -0700
committer3gg <3gg@shellblade.net>2023-07-19 08:35:00 -0700
commit48cef82988d6209987ae27fe29b72d7d5e402b3c (patch)
treefe5df57729a61839322ae8c1226d134e317b049f /gfx-iso/app/isogfx-demo.c
parent2c668763a1d6e645dcfaa713b924de26260542d0 (diff)
Add sprites.
Diffstat (limited to 'gfx-iso/app/isogfx-demo.c')
-rw-r--r--gfx-iso/app/isogfx-demo.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gfx-iso/app/isogfx-demo.c b/gfx-iso/app/isogfx-demo.c
index d463d1c..9889275 100644
--- a/gfx-iso/app/isogfx-demo.c
+++ b/gfx-iso/app/isogfx-demo.c
@@ -9,8 +9,10 @@
9#include <stdlib.h> 9#include <stdlib.h>
10 10
11typedef struct State { 11typedef struct State {
12 int xpick; 12 int xpick;
13 int ypick; 13 int ypick;
14 SpriteSheet stag_sheet;
15 Sprite stag;
14} State; 16} State;
15 17
16static void shutdown(IsoGfx* iso, void* app_state) { 18static void shutdown(IsoGfx* iso, void* app_state) {
@@ -54,6 +56,15 @@ bool make_demo_app(IsoGfx* iso, IsoGfxApp* app) {
54 goto cleanup; 56 goto cleanup;
55 } 57 }
56 58
59 if (!isogfx_load_sprite_sheet(
60 iso, "/home/jeanne/assets/tilesets/scrabling/critters/stag/stag.ss",
61 &state->stag_sheet)) {
62 goto cleanup;
63 }
64
65 state->stag = isogfx_make_sprite(iso, state->stag_sheet);
66 isogfx_set_sprite_position(iso, state->stag, 5, 4);
67
57 app->pixel_scale = 2; 68 app->pixel_scale = 2;
58 app->state = state; 69 app->state = state;
59 app->shutdown = shutdown; 70 app->shutdown = shutdown;