diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -8,11 +8,11 @@ #define DEMO() \ do { \ - vp->x = x * map->tilewidth + map->tilewidth / 2 - vp->w / 2; \ - vp->y = y * map->tileheight + map->tileheight / 2 - vp->h / 2; \ + vp->x = x + map->tilewidth / 2 - vp->w / 2; \ + vp->y = y + map->tileheight / 2 - vp->h / 2; \ render_area_to_viewport(a, vp); \ SDL_Flip(vp->screen); \ - SDL_Delay(100); \ + SDL_Delay(10); \ } while (0) int @@ -71,19 +71,19 @@ main(void) } /* Demo */ - x = 19; - y = 38; - for (; y > 34; y -= 1) DEMO(); /* Up */ - for (; x < 23; x += 1) DEMO(); /* Right */ - for (; y > 16; y -= 1) DEMO(); /* Up */ - for (; x > 15; x -= 1) DEMO(); /* Left */ - for (; y < 25; y += 1) DEMO(); /* Down */ - for (; x > 4; x -= 1) DEMO(); /* Left */ - for (; y > 18; y -= 1) DEMO(); /* Up */ - for (; x < 9; x += 1) DEMO(); /* Right */ - for (; y > 5; y -= 1) DEMO(); /* Up */ - for (; x < 15; x += 1) DEMO(); /* Right */ - for (; y > 1; y -= 1) DEMO(); /* Up */ + x = 19 * map->tilewidth ; + y = 38 * map->tileheight; + for (; y > 34 * map->tileheight; y -= 2) DEMO(); /* Up */ + for (; x < 23 * map->tilewidth ; x += 2) DEMO(); /* Right */ + for (; y > 16 * map->tileheight; y -= 2) DEMO(); /* Up */ + for (; x > 15 * map->tilewidth ; x -= 2) DEMO(); /* Left */ + for (; y < 25 * map->tileheight; y += 2) DEMO(); /* Down */ + for (; x > 4 * map->tilewidth ; x -= 2) DEMO(); /* Left */ + for (; y > 18 * map->tileheight; y -= 2) DEMO(); /* Up */ + for (; x < 9 * map->tilewidth ; x += 2) DEMO(); /* Right */ + for (; y > 5 * map->tileheight; y -= 2) DEMO(); /* Up */ + for (; x < 15 * map->tilewidth ; x += 2) DEMO(); /* Right */ + for (; y > 1 * map->tileheight; y -= 2) DEMO(); /* Up */ quit(0); |