support "-l NR" commandline argument

This commit is contained in:
Sebastian Krzyszkowiak 2012-04-09 16:41:10 +02:00
parent 3c3fc64d80
commit 1db3134175
3 changed files with 13 additions and 3 deletions

2
build
View file

@ -1,4 +1,4 @@
#!/bin/sh
echo run > gdb.tmp
echo run $@ > gdb.tmp
make -j10 && gdb bin/superderpy -x gdb.tmp
rm gdb.tmp

View file

@ -120,9 +120,9 @@ void About_Preload(struct Game *game) {
draw_text(" - Anna Karlik");
draw_text("");
draw_text("Music:");
draw_text(" - Dr Dissonance (\"Don Discord\")");
draw_text(" - Dr Dissonance");
draw_text(" http://dr-dissonance.tumblr.com/");
draw_text(" - Claire Anne Carr (\"A bubbles paradise\")");
draw_text(" - Claire Anne Carr");
draw_text(" http://claireannecarr.bandcamp.com/");
draw_text(" - Dan O'Connor");
draw_text(" http://www.danosongs.com/");

View file

@ -387,6 +387,16 @@ int main(int argc, char **argv){
PreloadGameState(&game);
LoadGameState(&game);
game.loadstate = GAMESTATE_MENU;
int c;
while ((c = getopt (argc, argv, "l:")) != -1)
switch (c) {
case 'l':
game.level.current_level = optarg[0]-'0';
game.loadstate = GAMESTATE_LEVEL;
break;
}
while(1) {
ALLEGRO_EVENT ev;
al_wait_for_event(game.event_queue, &ev);