- // This line is disgusting
- SDL_Surface * save = SDL_CreateRGBSurfaceFrom(pixels, info->w, info->h, info->format->BitsPerPixel, info->w * info->format->BytesPerPixel,
- info->format->Rmask, info->format->Gmask, info->format->Bmask, info->format->Amask);
- if (save == NULL)
- {
- Fatal("Couldn't create SDL_Surface from renderer pixel data - %s", SDL_GetError());
- }
- if (SDL_SaveBMP(save, filename) != 0)
- {
- Fatal("SDL_SaveBMP to %s failed - %s", filename, SDL_GetError());
- }
+ SDL_Surface * surf = SDL_CreateRGBSurfaceFrom(pixels, w, h, 8*4, w*4, 0,0,0,0);
+ if (surf == NULL)
+ Fatal("Failed to create SDL_Surface from pixel data - %s", SDL_GetError());