
Originally Posted by
mahlzeit
Obviously you do the conversion once after loading, not for every blit... Not sure why the new version would slow this down, though. Of course, you can always revert to an older version: they still work fine.
I was describing the process taking place once you call blitting to a different format surface. Obvoiusly its best getting EVERY calculation you can outside the main loop.
@Robert Cummings:
I use this code, i think ive posted it before, but since it might help you sort your problem... i'd thought id post it again:
Code:
SDL_Surface *LoadSpriteDF(const char *FileName)
{
SDL_Surface *tempSurface;
SDL_Surface *AnotherSurface;
tempSurface = SDL_LoadBMP(FileName);
if (tempSurface == NULL) {
fprintf(stderr, "|%s,%d| Error Loading %s: %s\n", __FILE__,__LINE__,FileName, SDL_GetError());
return NULL;
}
SDL_SetColorKey(tempSurface,SDL_SRCCOLORKEY|SDL_RLEACCEL,SDL_MapRGB(tempSurface->format,255,128,0));
AnotherSurface = SDL_DisplayFormat(tempSurface);
SDL_FreeSurface(tempSurface);
if (AnotherSurface == NULL) {
fprintf(stderr, "|%s,%d| Error Loading %s: %s\n", __FILE__,__LINE__,FileName, SDL_GetError());
return NULL;
}
return AnotherSurface;
}