Improve redefining sleep time in 2000/thadgavin
Now one can do instead
make SLEEP=555 SDL_SLEEP=555 alt
where SLEEP is the variable for the curses version and SDL_SLEEP is for
the SDL version. One need not specify both if they do not want to
redefine one or the other and of course one doesn't have to specify a
sleep time at all either.
This commit is contained in:
1 parent
1041382f68
commit
515105864d
2 files changed
+13
-6
No files matched your search
@@ -56,9 +56,13 @@ CSTD= -std=gnu99
|
|||||||
#
|
#
|
||||||
ARCH=
|
ARCH=
|
||||||
|
|
||||||
|
# variables for redefining the time to sleep, primarily for alt code
|
||||||
|
#
|
||||||
|
SLEEP= 30
|
||||||
|
SDL_SLEEP= 150000
|
||||||
# Defines that are needed to compile
|
# Defines that are needed to compile
|
||||||
#
|
#
|
||||||
CDEFINE= -DZ=30 -DZS=150000
|
CDEFINE= -DZ=${SLEEP} -DZS=${SDL_SLEEP}
|
||||||
|
|
||||||
# Include files that are needed to compile
|
# Include files that are needed to compile
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -37,8 +37,10 @@ You might also care to reconfigure the speed at which the programs run. The code
|
|||||||
calls `usleep(3)` with two default values, one for SDL and one for curses. The
|
calls `usleep(3)` with two default values, one for SDL and one for curses. The
|
||||||
curses and SDL macros are defined respectively in the Makefile:
|
curses and SDL macros are defined respectively in the Makefile:
|
||||||
|
|
||||||
```
|
```make
|
||||||
-DZ=30 -DZS=150000
|
SLEEP= 30
|
||||||
|
SDL_SLEEP= 150000
|
||||||
|
CDEFINE= -DZ=${SLEEP} -DZS=${SDL_SLEEP}
|
||||||
```
|
```
|
||||||
|
|
||||||
which corresponds to how long the program sleeps (in microseconds) between
|
which corresponds to how long the program sleeps (in microseconds) between
|
||||||
@@ -47,19 +49,20 @@ to the defaults as above so that you don't have to specify both just to
|
|||||||
configure one. To change the SDL one to something like `15000` you can do:
|
configure one. To change the SDL one to something like `15000` you can do:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make CDEFINE="-DZS=15000" clobber alt
|
make SDL_SLEEP=15000 clobber alt
|
||||||
```
|
```
|
||||||
|
|
||||||
and to change the curses one to `40`:
|
and to change the curses one to `40`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make CDEFINE="-DZ=40" clobber alt
|
make SLEEP=40 clobber alt
|
||||||
```
|
```
|
||||||
|
|
||||||
Then use the program(s) in the same way.
|
Then use the program(s) in the same way.
|
||||||
|
|
||||||
The different macros is because the curses version is already much slower and so
|
The different macros is because the curses version is already much slower and so
|
||||||
it's better to not tie the two values together.
|
it's better to not tie the two values together. You may of course combine them
|
||||||
|
in one command.
|
||||||
|
|
||||||
|
|
||||||
## Original code:
|
## Original code:
|
||||||
|
|||||||
Reference in new issue
Block a user