You can't use memset() on screen formats with an alpha channel
authorSam Lantinga <slouken@libsdl.org>
Tue, 02 Dec 2008 16:09:58 +0000
changeset 2821c4eccbd21d16
parent 2820 33ddad305f3d
child 2822 cf271ff76061
You can't use memset() on screen formats with an alpha channel
test/testwin.c
     1.1 --- a/test/testwin.c	Mon Dec 01 23:09:09 2008 +0000
     1.2 +++ b/test/testwin.c	Tue Dec 02 16:09:58 2008 +0000
     1.3 @@ -75,21 +75,6 @@
     1.4                  "         (colormap fading will suffer - try the -warp option)\n");
     1.5      }
     1.6  
     1.7 -    /* Set the screen to black (not really necessary) */
     1.8 -    if (SDL_LockSurface(screen) == 0) {
     1.9 -        Uint32 black;
    1.10 -        Uint8 *pixels;
    1.11 -
    1.12 -        black = SDL_MapRGB(screen->format, 0, 0, 0);
    1.13 -        pixels = (Uint8 *) screen->pixels;
    1.14 -        for (i = 0; i < screen->h; ++i) {
    1.15 -            memset(pixels, black, screen->w * screen->format->BytesPerPixel);
    1.16 -            pixels += screen->pitch;
    1.17 -        }
    1.18 -        SDL_UnlockSurface(screen);
    1.19 -        SDL_UpdateRect(screen, 0, 0, 0, 0);
    1.20 -    }
    1.21 -
    1.22      /* Display the picture */
    1.23      if (speedy) {
    1.24          SDL_Surface *displayfmt;