From 5294ea7acb86de460e2426a6dac1d281979d0c3b Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Thu, 4 Sep 2025 19:16:32 -0700 Subject: Rename isogfx -> gfx2d --- demos/isomap/isomap.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'demos/isomap') diff --git a/demos/isomap/isomap.c b/demos/isomap/isomap.c index bca27f6..471ef57 100644 --- a/demos/isomap/isomap.c +++ b/demos/isomap/isomap.c @@ -22,13 +22,13 @@ static const R CAMERA_SPEED = 800; uint8_t MEMORY[MEMORY_SIZE]; typedef struct GfxAppState { - IsoBackend* backend; - IsoGfx* iso; - int xpick; - int ypick; - vec2 camera; - SpriteSheet stag_sheet; - Sprite stag; + Gfx2dBackend* backend; + Gfx2d* gfx; + int xpick; + int ypick; + vec2 camera; + SpriteSheet stag_sheet; + Sprite stag; } GfxAppState; static bool init(GfxApp* app, GfxAppState* state, int argc, const char** argv) { @@ -37,31 +37,31 @@ static bool init(GfxApp* app, GfxAppState* state, int argc, const char** argv) { (void)argc; (void)argv; - if (!((state->iso = - isogfx_new(&(IsoGfxDesc){.memory = MEMORY, - .memory_size = MEMORY_SIZE, - .screen_width = SCREEN_WIDTH, - .screen_height = SCREEN_HEIGHT})))) { + if (!((state->gfx = + gfx2d_new(&(Gfx2dDesc){.memory = MEMORY, + .memory_size = MEMORY_SIZE, + .screen_width = SCREEN_WIDTH, + .screen_height = SCREEN_HEIGHT})))) { return false; } - IsoGfx* iso = state->iso; + Gfx2d* iso = state->gfx; - if (!isogfx_load_map( + if (!gfx2d_load_map( iso, "/home/jeanne/Nextcloud/assets/tilemaps/scrabling1.tm")) { return false; } - if (!((state->stag_sheet = isogfx_load_sprite_sheet( + if (!((state->stag_sheet = gfx2d_load_sprite_sheet( iso, "/home/jeanne/Nextcloud/assets/tilesets/scrabling/critters/stag/" "stag.ss")))) { return false; } - state->stag = isogfx_make_sprite(iso, state->stag_sheet); - isogfx_set_sprite_position(iso, state->stag, 0, 0); + state->stag = gfx2d_make_sprite(iso, state->stag_sheet); + gfx2d_set_sprite_position(iso, state->stag, 0, 0); - if (!((state->backend = iso_backend_init(iso)))) { + if (!((state->backend = gfx2d_backend_init(iso)))) { return false; } @@ -101,25 +101,25 @@ static void update(GfxApp* app, GfxAppState* state, double t, double dt) { state->camera = vec2_add(state->camera, get_camera_movement(app, (R)dt)); - IsoGfx* iso = state->iso; - isogfx_set_camera(iso, (int)state->camera.x, (int)state->camera.y); - isogfx_update(iso, t); + Gfx2d* iso = state->gfx; + gfx2d_set_camera(iso, (int)state->camera.x, (int)state->camera.y); + gfx2d_update(iso, t); } static void render(const GfxApp* app, GfxAppState* state) { assert(app); assert(state); - IsoGfx* iso = state->iso; - isogfx_render(iso); - iso_backend_render(state->backend, iso); + Gfx2d* iso = state->gfx; + gfx2d_render(iso); + gfx2d_backend_render(state->backend, iso); } static void resize(GfxApp* app, GfxAppState* state, int width, int height) { assert(app); assert(state); - iso_backend_resize_window(state->backend, state->iso, width, height); + gfx2d_backend_resize_window(state->backend, state->gfx, width, height); } int main(int argc, const char** argv) { -- cgit v1.2.3