test/testpalette.c
changeset 2851 6c3fbeb04eca
parent 2735 204be4fc2726
child 2855 422452508c76
equal deleted inserted replaced
2850:43691ef70176 2851:6c3fbeb04eca
   187         sdlerr("loading sail.bmp");
   187         sdlerr("loading sail.bmp");
   188     /* We've chosen magenta (#ff00ff) as colour key for the boat */
   188     /* We've chosen magenta (#ff00ff) as colour key for the boat */
   189     SDL_SetColorKey(boat[0], SDL_SRCCOLORKEY | SDL_RLEACCEL,
   189     SDL_SetColorKey(boat[0], SDL_SRCCOLORKEY | SDL_RLEACCEL,
   190                     SDL_MapRGB(boat[0]->format, 0xff, 0x00, 0xff));
   190                     SDL_MapRGB(boat[0]->format, 0xff, 0x00, 0xff));
   191     boatcols = boat[0]->format->palette->ncolors;
   191     boatcols = boat[0]->format->palette->ncolors;
       
   192     if (boatcols >= 256)
       
   193         sdlerr("too many colors in sail.bmp");
   192     boat[1] = hflip(boat[0]);
   194     boat[1] = hflip(boat[0]);
   193     SDL_SetColorKey(boat[1], SDL_SRCCOLORKEY | SDL_RLEACCEL,
   195     SDL_SetColorKey(boat[1], SDL_SRCCOLORKEY | SDL_RLEACCEL,
   194                     SDL_MapRGB(boat[1]->format, 0xff, 0x00, 0xff));
   196                     SDL_MapRGB(boat[1]->format, 0xff, 0x00, 0xff));
   195 
   197 
   196     /*
   198     /*