Turn off transparent pixels for grayscale

Hi, using an 8-bit gray palette, is there a way of stopping zero valued
pixels being treated as transparent? so this example program would display
black. Setting the color key seems to have no effect so i’m doing something
wrong?

I’m using SDL-1.2.9 (comes with fedora 5).

thanks

zach

#include <stdlib.h>
#include <string.h>
#include <SDL.h>

void
event_loop()
{
SDL_Event event;
while(1) {
SDL_WaitEvent(&event);
switch (event.type) {
case SDL_QUIT:
exit(0);
}
}
}

int
main(int argc, char *argv[])
{
SDL_Surface *screen;
SDL_Color colors[256];
int i;

for (i = 0; i<256; ++i) {
    colors[i].r = i;
    colors[i].g = i;
    colors[i].b = i;
}

if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
    fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
    exit(1);
}

atexit(SDL_Quit);

screen = SDL_SetVideoMode(640, 480, 8, SDL_HWSURFACE | SDL_HWPALETTE);
if ( screen == NULL ) {
    fprintf(stderr, "Unable to set 640x480 video: %s\n",

SDL_GetError());
exit(1);
}
SDL_SetPalette(screen, /SDL_LOGPAL |/ SDL_PHYSPAL, colors, 0, 256);
SDL_SetColorKey(screen, SDL_SRCCOLORKEY,100);
{
if (SDL_MUSTLOCK(screen)) {
if (SDL_LockSurface(screen) < 0) return 1;
}
memset(screen->pixels, 0, screen->pitch*480);

    if (SDL_MUSTLOCK(screen)) SDL_UnlockSurface(screen);

    SDL_UpdateRect(screen, 0,0,0,0);
}

event_loop();
return 0;

}