diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/checkerboard/checkerboard.c | 5 | ||||
-rw-r--r-- | demos/isomap/isomap.c | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/demos/checkerboard/checkerboard.c b/demos/checkerboard/checkerboard.c index 467da61..f9631d8 100644 --- a/demos/checkerboard/checkerboard.c +++ b/demos/checkerboard/checkerboard.c | |||
@@ -86,7 +86,8 @@ static bool init(GfxApp* app, GfxAppState* state, int argc, const char** argv) { | |||
86 | .tile_height = TILE_HEIGHT, | 86 | .tile_height = TILE_HEIGHT, |
87 | .world_width = WORLD_WIDTH, | 87 | .world_width = WORLD_WIDTH, |
88 | .world_height = WORLD_HEIGHT, | 88 | .world_height = WORLD_HEIGHT, |
89 | .num_tiles = NUM_TILES}); | 89 | .num_tiles = NUM_TILES, |
90 | .orientation = MapIsometric}); | ||
90 | 91 | ||
91 | const Tile black = gfx2d_make_tile(iso, &tile_set[Black]); | 92 | const Tile black = gfx2d_make_tile(iso, &tile_set[Black]); |
92 | const Tile white = gfx2d_make_tile(iso, &tile_set[White]); | 93 | const Tile white = gfx2d_make_tile(iso, &tile_set[White]); |
@@ -136,7 +137,7 @@ static void render(const GfxApp* app, GfxAppState* state) { | |||
136 | 137 | ||
137 | Gfx2d* iso = state->gfx; | 138 | Gfx2d* iso = state->gfx; |
138 | 139 | ||
139 | gfx2d_render(iso); | 140 | gfx2d_render(iso, 0, 0); |
140 | 141 | ||
141 | if ((state->xpick != -1) && (state->ypick != -1)) { | 142 | if ((state->xpick != -1) && (state->ypick != -1)) { |
142 | gfx2d_draw_tile(iso, state->xpick, state->ypick, state->red); | 143 | gfx2d_draw_tile(iso, state->xpick, state->ypick, state->red); |
diff --git a/demos/isomap/isomap.c b/demos/isomap/isomap.c index 471ef57..e66d14d 100644 --- a/demos/isomap/isomap.c +++ b/demos/isomap/isomap.c | |||
@@ -47,7 +47,7 @@ static bool init(GfxApp* app, GfxAppState* state, int argc, const char** argv) { | |||
47 | Gfx2d* iso = state->gfx; | 47 | Gfx2d* iso = state->gfx; |
48 | 48 | ||
49 | if (!gfx2d_load_map( | 49 | if (!gfx2d_load_map( |
50 | iso, "/home/jeanne/Nextcloud/assets/tilemaps/scrabling1.tm")) { | 50 | iso, "/home/jeanne/Nextcloud/assets/tilemaps/desert1.tm")) { |
51 | return false; | 51 | return false; |
52 | } | 52 | } |
53 | 53 | ||
@@ -100,9 +100,9 @@ static void update(GfxApp* app, GfxAppState* state, double t, double dt) { | |||
100 | assert(state); | 100 | assert(state); |
101 | 101 | ||
102 | state->camera = vec2_add(state->camera, get_camera_movement(app, (R)dt)); | 102 | state->camera = vec2_add(state->camera, get_camera_movement(app, (R)dt)); |
103 | gfx2d_clip_camera(state->gfx, &state->camera.x, &state->camera.y); | ||
103 | 104 | ||
104 | Gfx2d* iso = state->gfx; | 105 | Gfx2d* iso = state->gfx; |
105 | gfx2d_set_camera(iso, (int)state->camera.x, (int)state->camera.y); | ||
106 | gfx2d_update(iso, t); | 106 | gfx2d_update(iso, t); |
107 | } | 107 | } |
108 | 108 | ||
@@ -111,7 +111,7 @@ static void render(const GfxApp* app, GfxAppState* state) { | |||
111 | assert(state); | 111 | assert(state); |
112 | 112 | ||
113 | Gfx2d* iso = state->gfx; | 113 | Gfx2d* iso = state->gfx; |
114 | gfx2d_render(iso); | 114 | gfx2d_render(iso, (int)state->camera.x, (int)state->camera.y); |
115 | gfx2d_backend_render(state->backend, iso); | 115 | gfx2d_backend_render(state->backend, iso); |
116 | } | 116 | } |
117 | 117 | ||