Replace SDL_SWSURFACE with 0 as per SDL2 recommendations
The flags were part of the old SDL1.2 API and shouldn't be used.
This commit is contained in:
parent
2f7165d061
commit
d0a36ec41c
2 changed files with 6 additions and 6 deletions
|
@ -46,7 +46,7 @@ static SDL_PixelFormat& get_neutral_pixel_format()
|
|||
|
||||
if(first_time) {
|
||||
first_time = false;
|
||||
surface surf(SDL_CreateRGBSurface(SDL_SWSURFACE,1,1,32,SDL_RED_MASK,SDL_GREEN_MASK,
|
||||
surface surf(SDL_CreateRGBSurface(0,1,1,32,SDL_RED_MASK,SDL_GREEN_MASK,
|
||||
SDL_BLUE_MASK,SDL_ALPHA_MASK));
|
||||
format = *surf->format;
|
||||
format.palette = nullptr;
|
||||
|
@ -62,7 +62,7 @@ surface make_neutral_surface(const surface &surf)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
surface result = SDL_ConvertSurface(surf,&get_neutral_pixel_format(),SDL_SWSURFACE);
|
||||
surface result = SDL_ConvertSurface(surf,&get_neutral_pixel_format(),0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ surface create_neutral_surface(int w, int h)
|
|||
}
|
||||
|
||||
SDL_PixelFormat format = get_neutral_pixel_format();
|
||||
surface result = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h,
|
||||
surface result = SDL_CreateRGBSurface(0, w, h,
|
||||
format.BitsPerPixel,
|
||||
format.Rmask,
|
||||
format.Gmask,
|
||||
|
@ -1924,7 +1924,7 @@ surface create_compatible_surface(const surface &surf, int width, int height)
|
|||
if(height == -1)
|
||||
height = surf->h;
|
||||
|
||||
surface s = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, surf->format->BitsPerPixel,
|
||||
surface s = SDL_CreateRGBSurface(0, width, height, surf->format->BitsPerPixel,
|
||||
surf->format->Rmask, surf->format->Gmask, surf->format->Bmask, surf->format->Amask);
|
||||
if (surf->format->palette) {
|
||||
SDL_SetPaletteColors(s->format->palette, surf->format->palette->colors, 0, surf->format->palette->ncolors);
|
||||
|
|
|
@ -172,13 +172,13 @@ void CVideo::blit_surface(int x, int y, surface surf, SDL_Rect* srcrect, SDL_Rec
|
|||
void CVideo::make_fake()
|
||||
{
|
||||
fake_screen_ = true;
|
||||
frameBuffer = SDL_CreateRGBSurface(SDL_SWSURFACE, 16, 16, 24, 0xFF0000, 0xFF00, 0xFF, 0);
|
||||
frameBuffer = SDL_CreateRGBSurface(0, 16, 16, 24, 0xFF0000, 0xFF00, 0xFF, 0);
|
||||
image::set_pixel_format(frameBuffer->format);
|
||||
}
|
||||
|
||||
void CVideo::make_test_fake(const unsigned width, const unsigned height, const unsigned bpp)
|
||||
{
|
||||
frameBuffer = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, bpp, 0xFF0000, 0xFF00, 0xFF, 0);
|
||||
frameBuffer = SDL_CreateRGBSurface(0, width, height, bpp, 0xFF0000, 0xFF00, 0xFF, 0);
|
||||
image::set_pixel_format(frameBuffer->format);
|
||||
|
||||
fake_interactive = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue