X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=main.c;h=ad3ab56930e833f72170b39de65a98959d18b2a1;hp=aab0d71d9183e27f0a7ec6590968485d1bbe74ac;hb=2bea0659b8edff14f1554d2540780f54ccdc21c9;hpb=8193e09e49bc571f9c61e6e3adf45010271c08d5;ds=sidebyside diff --git a/main.c b/main.c index aab0d71..ad3ab56 100644 --- a/main.c +++ b/main.c @@ -113,6 +113,7 @@ struct spacedot sdot[MAXSPACEDOTS]; char topline[1024]; char *initerror = ""; +struct shape shipshape; float shipx,shipy = 240.0; // X position, 0..XSIZE float shipdx,shipdy; // Change in X position per tick. float rockrate,rockspeed; @@ -543,6 +544,7 @@ init(int fullscreen) { // Load the spaceship graphic. NULLERROR(temp = IMG_Load(add_path("sprites/ship.png"))); NULLERROR(surf_ship = SDL_DisplayFormat(temp)); + get_shape(surf_ship, &shipshape); // Load the life indicator (small ship) graphic. NULLERROR(temp = IMG_Load(add_path("indicators/life.png"))); @@ -734,6 +736,13 @@ draw() { } if(!gameover && state == GAMEPLAY) { + for(i=0; ipixels; // Check that the black points on the ship are @@ -746,6 +755,7 @@ draw() { } } SDL_UnlockSurface(surf_screen); + */ } // Draw all the little ships @@ -886,6 +896,7 @@ gameloop() { rockptr->dy = rnd()-0.5; rockptr->type_number = random() % NROCKS; rockptr->image = surf_rock[rockptr->type_number];// [random()%NROCKS]; + rockptr->shape = &rock_shapes[rockptr->type_number]; rockptr->active = 1; rockptr->y = rnd()*(YSIZE + rockptr->image->h); }