summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. 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)
commitdf45ed7b1c6efa67e93a498495ad48d4d42e2eef (patch)
tree38d662d892bb9193cfe31fe48ee9d3759945c83e /src
parent3804573d65c9aef27f212dcece16fdb8f57b5f7d (diff)
downloadoverworld-rpg-df45ed7b1c6efa67e93a498495ad48d4d42e2eef.zip
overworld-rpg-df45ed7b1c6efa67e93a498495ad48d4d42e2eef.tar.gz
overworld-rpg-df45ed7b1c6efa67e93a498495ad48d4d42e2eef.tar.bz2
Make demo smoother.
Diffstat (limited to 'src')
-rw-r--r--src/main.c32
1 files changed, 16 insertions, 16 deletions
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);