Subject: selectable default penguin population From: Luotao Fu This one makes the default penguin population selectable though environment variable "PENGUIN". This way we can start the control this on boards without a keyboard. Signed-off-by: Luotao Fu --- src/df_andi.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) Index: src/df_andi.c =================================================================== --- src/df_andi.c.orig +++ src/df_andi.c @@ -566,6 +566,7 @@ int main( int argc, char *argv[] ) FPSData fps; int quit = 0; int clipping = 0; + unsigned long int default_population = 200; init_resources( argc, argv ); @@ -573,7 +574,18 @@ int main( int argc, char *argv[] ) initialize_animation(); - spawn_penguins( 200 ); + if (getenv("PENGUINS")) + default_population = strtoul(getenv("PENGUINS"), NULL, 10); + + if (default_population > 2000) { + fprintf(stderr, "ERR: %ld are more penguins than we can afford,", + default_population); + default_population = 200; + fprintf(stderr, " setting default population back to %ld\n", + default_population); + } + + spawn_penguins( default_population ); primary->SetDrawingFlags( primary, DSDRAW_BLEND );