diff options
author | P. J. McDermott <pjm@nac.net> | 2013-02-19 02:33:12 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-02-19 02:33:12 (EST) |
commit | df45ed7b1c6efa67e93a498495ad48d4d42e2eef (patch) | |
tree | 38d662d892bb9193cfe31fe48ee9d3759945c83e | |
parent | 3804573d65c9aef27f212dcece16fdb8f57b5f7d (diff) | |
download | overworld-rpg-df45ed7b1c6efa67e93a498495ad48d4d42e2eef.zip overworld-rpg-df45ed7b1c6efa67e93a498495ad48d4d42e2eef.tar.gz overworld-rpg-df45ed7b1c6efa67e93a498495ad48d4d42e2eef.tar.bz2 |
Make demo smoother.
-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); |