Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
buf[i] = (buf[i] < amount) ? 0 : buf[i] - amount;
}
+static void clear_buf(SDL_Surface *screen)
+{
+ int i;
+ unsigned int *buf = screen->pixels;
+
+ for(i = 0; i < screen->pitch * screen->h / 4; i++)
+ buf[i] = 0;
+}
+
static void loop(SDL_Surface *screen)
{
int num_of_planets = 100;
SDL_LockSurface(screen);
+ clear_buf(screen);
+
for (i = 0; i < num_of_planets; i++)
draw_planet(screen, &planet[i]);
- if (!(framecount % 64))
- fade_buf(screen, 1);
-
SDL_UnlockSurface(screen);
SDL_Flip(screen);