JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
platform-independent arg parsing
[vor.git] / main.c
diff --git a/main.c b/main.c
index 11ebba6..3f4486b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#include <argp.h>
 #include <math.h>
 #include <SDL.h>
 #include <SDL_image.h>
@@ -391,12 +390,12 @@ init(void) {
        }
 
        // Load the banners
-       NULLERROR(surf_b_variations = load_image("variations.png"));
-       NULLERROR(surf_b_on = load_image("on.png"));
-       NULLERROR(surf_b_rockdodger = load_image("rockdodger.png"));
+       NULLERROR(surf_b_variations = load_image("b_variations.png"));
+       NULLERROR(surf_b_on = load_image("b_on.png"));
+       NULLERROR(surf_b_rockdodger = load_image("b_rockdodger.png"));
 
-       NULLERROR(surf_b_game = load_image("game.png"));
-       NULLERROR(surf_b_over = load_image("over.png"));
+       NULLERROR(surf_b_game = load_image("b_game.png"));
+       NULLERROR(surf_b_over = load_image("b_over.png"));
 
        // Load the life indicator (small ship) graphic.
        NULLERROR(surf_life = load_image("life.png"));
@@ -588,12 +587,15 @@ init_score_entry(void)
 
 void
 gameloop() {
-       Uint8 *keystate = SDL_GetKeyState(NULL);
+       SDL_Event e;
+       Uint8 *keystate;
        float tmp;
 
 
        for(;;) {
-               SDL_PumpEvents();
+               while(SDL_PollEvent(&e)) {
+                       if(e.type == SDL_QUIT) return;
+               }
                keystate = SDL_GetKeyState(NULL);
 
                if(!paused) {
@@ -764,8 +766,7 @@ gameloop() {
 
 int
 main(int argc, char **argv) {
-       init_opts();
-       argp_parse(&argp, argc, argv, 0, 0, 0);
+       if(!parse_opts(argc, argv)) return 1;
 
        if(init()) {
                printf ("ta: '%s'\n",initerror);