From df45ed7b1c6efa67e93a498495ad48d4d42e2eef Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 19 Feb 2013 02:33:12 -0500 Subject: Make demo smoother. --- diff --git a/src/main.c b/src/main.c index 6d521be..6a1100f 100644 --- a/src/main.c +++ b/src/main.c @@ -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); -- cgit v0.9.1