diff options
Diffstat (limited to 'gfx-iso/app')
| -rw-r--r-- | gfx-iso/app/isogfx-demo.c | 15 | ||||
| -rw-r--r-- | gfx-iso/app/main.c | 2 |
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 | ||
| 11 | typedef struct State { | 11 | typedef 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 | ||
| 16 | static void shutdown(IsoGfx* iso, void* app_state) { | 18 | static 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 | } |
