Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

You can't use memset() on screen formats with an alpha channel

  • Loading branch information
slouken committed Dec 2, 2008
1 parent 8bf06a1 commit d885b123060f491d5c49365f1191ec1b03358e82

File 1 of 1 in d885b12

@@ -75,21 +75,6 @@ DrawPict(SDL_Surface * screen, char *bmpfile,
" (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;

0 comments on commit d885b12

Please sign in to comment.