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 2821 c4eccbd21d16
parent 2820 33ddad305f3d
child 2822 cf271ff76061
You can't use memset() on screen formats with an alpha channel
test/testwin.c
--- a/test/testwin.c	Mon Dec 01 23:09:09 2008 +0000
+++ b/test/testwin.c	Tue Dec 02 16:09:58 2008 +0000
@@ -75,21 +75,6 @@
                 "         (colormap fading will suffer - try the -warp option)\n");
     }
 
-    /* Set the screen to black (not really necessary) */
-    if (SDL_LockSurface(screen) == 0) {
-        Uint32 black;
-        Uint8 *pixels;
-
-        black = SDL_MapRGB(screen->format, 0, 0, 0);
-        pixels = (Uint8 *) screen->pixels;
-        for (i = 0; i < screen->h; ++i) {
-            memset(pixels, black, screen->w * screen->format->BytesPerPixel);
-            pixels += screen->pitch;
-        }
-        SDL_UnlockSurface(screen);
-        SDL_UpdateRect(screen, 0, 0, 0, 0);
-    }
-
     /* Display the picture */
     if (speedy) {
         SDL_Surface *displayfmt;