test/testsprite.c
changeset 663 8bedd6d61642
parent 587 f00ccf8d8edc
child 753 b14fdadd8311
     1.1 --- a/test/testsprite.c	Mon Jul 28 01:47:55 2003 +0000
     1.2 +++ b/test/testsprite.c	Mon Aug 04 00:52:42 2003 +0000
     1.3 @@ -54,10 +54,6 @@
     1.4  
     1.5  void MoveSprites(SDL_Surface *screen, Uint32 background)
     1.6  {
     1.7 -#if DEBUG_FLIP
     1.8 -    static int t = 0;
     1.9 -#endif
    1.10 -
    1.11  	int i, nupdates;
    1.12  	SDL_Rect area, *position, *velocity;
    1.13  
    1.14 @@ -90,15 +86,19 @@
    1.15  
    1.16  #if DEBUG_FLIP
    1.17      {
    1.18 -        Uint32 color = SDL_MapRGB (screen->format, 255, 0, 0);
    1.19 -        SDL_Rect r;
    1.20 -        r.x = (sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20);
    1.21 -        r.y = 0;
    1.22 -        r.w = 20;
    1.23 -        r.h = screen->h;
    1.24 +	if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
    1.25 +            static int t = 0;
    1.26 +
    1.27 +            Uint32 color = SDL_MapRGB (screen->format, 255, 0, 0);
    1.28 +            SDL_Rect r;
    1.29 +            r.x = (sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20);
    1.30 +            r.y = 0;
    1.31 +            r.w = 20;
    1.32 +            r.h = screen->h;
    1.33          
    1.34 -        SDL_FillRect (screen, &r, color);
    1.35 -        t+=2;
    1.36 +            SDL_FillRect (screen, &r, color);
    1.37 +            t+=2;
    1.38 +        }
    1.39      }
    1.40  #endif
    1.41