summaryrefslogtreecommitdiff
path: root/gfx-iso/app
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
parent2c668763a1d6e645dcfaa713b924de26260542d0 (diff)
Add sprites.
Diffstat (limited to 'gfx-iso/app')
-rw-r--r--gfx-iso/app/isogfx-demo.c15
-rw-r--r--gfx-iso/app/main.c2
2 files changed, 15 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;
diff --git a/gfx-iso/app/main.c b/gfx-iso/app/main.c
index 5b441d3..ff8a266 100644
--- a/gfx-iso/app/main.c
+++ b/gfx-iso/app/main.c
@@ -138,6 +138,8 @@ static void update(void* app_state, double t, double dt) {
138 assert(app_state); 138 assert(app_state);
139 State* state = (State*)(app_state); 139 State* state = (State*)(app_state);
140 140
141 isogfx_update(state->iso, t);
142
141 assert(state->app.update); 143 assert(state->app.update);
142 (*state->app.update)(state->iso, state->app.state, t, dt); 144 (*state->app.update)(state->iso, state->app.state, t, dt);
143} 145}