Permalink
Browse files

Now exposing the speed of the animation via a cpp definition.

This closes #7. Thanks to Pedro Barbosa.
  • Loading branch information...
rwos committed Sep 9, 2012
1 parent dddc585 commit babe68be2676095cc6d08e2ec1b5a46c041dd685
Showing with 10 additions and 1 deletion.
  1. +5 −0 README.md
  2. +5 −1 gti.c
View
@@ -11,6 +11,11 @@ Build and Install
The default install PREFIX is `/usr/bin`.
+You can change the speed of the car at compile time via a cpp-define.
+For example:
+
+ $ make CFLAGS=-DGTI_SPEED=100 # default is 50
+
Usage
-----
View
6 gti.c
@@ -20,6 +20,10 @@
#define GIT_NAME "git"
+#ifndef GTI_SPEED
+#define GTI_SPEED 50
+#endif
+
int term_width(void);
void init_space(void);
void move_to_top(void);
@@ -35,7 +39,7 @@ int main(int argc, char **argv)
(void) argc;
int i;
TERM_WIDTH = term_width();
- SLEEP_DELAY = 500000 / (TERM_WIDTH + 20);
+ SLEEP_DELAY = 1000000 / (TERM_WIDTH + GTI_SPEED);
init_space();
for (i = -20; i < TERM_WIDTH; i++) {

0 comments on commit babe68b

Please sign in to comment.