SDL_InvalidateAllBlitMap(SDL_Surface *surface)
{
    SDL_ListNode *l = surface->list_blitmap;

    surface->list_blitmap = NULL;

    while (l) {
        SDL_ListNode *tmp = l;
        SDL_InvalidateMap((SDL_BlitMap *)l->entry);
        l = l->next;
        SDL_free(tmp);
    }
}
SDL_InvalidateAllBlitMap(SDL_Surface *surface)
{
    SDL_ListNode *l = surface->list_blitmap;

    surface->list_blitmap = NULL;

    while (l) {
        SDL_ListNode *tmp = l;
        SDL_InvalidateMap((SDL_BlitMap *)l->entry);
        l = l->next;
        SDL_free(tmp);
    }
}