add: else { if (old && type != last_type) { TFB_DrawCanvas_Delete (old); old = NULL; } if (!old) { newsurf = SDL_CreateRGBSurface (SDL_SWSURFACE, src->w, src->h, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000); } }
context: TFB_DrawCanvas_New_ScaleTarget (TFB_Canvas canvas){	SDL_Surface *src = (SDL_Surface *)canvas;	SDL_Surface *newsurf = SDL_CreateRGBSurface (SDL_SWSURFACE, src->w,				src->h,				src->format->BitsPerPixel,				src->format->Rmask,				src->format->Gmask,				src->format->Bmask,				src->format->Amask);	if (src->format->palette)	{		TFB_DrawCanvas_SetTransparentIndex (newsurf, TFB_DrawCanvas_GetTransparentIndex (src));	}	return newsurf;}