Skip to content

Commit

Permalink
Fixed some circuitous logic
Browse files Browse the repository at this point in the history
By using a surface object here I ran the rick of a logic loop. The ctor would try to refor the surface using
the neutral pixel format while trying to set up the neutral pixel format.
  • Loading branch information
Vultraz committed Jul 22, 2019
1 parent fb1e62c commit 0d1519e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sdl/surface.cpp
Expand Up @@ -22,11 +22,11 @@ const SDL_PixelFormat surface::neutral_pixel_format = []() {
SDL_PixelFormat format;

#if SDL_VERSION_ATLEAST(2, 0, 6)
surface surf(
SDL_CreateRGBSurfaceWithFormat(0, 1, 1, 32, SDL_PIXELFORMAT_ARGB8888));
SDL_Surface* surf =
SDL_CreateRGBSurfaceWithFormat(0, 1, 1, 32, SDL_PIXELFORMAT_ARGB8888);
#else
surface surf(
SDL_CreateRGBSurface(0, 1, 1, 32, SDL_RED_MASK, SDL_GREEN_MASK, SDL_BLUE_MASK, SDL_ALPHA_MASK));
SDL_Surface* surf =
SDL_CreateRGBSurface(0, 1, 1, 32, SDL_RED_MASK, SDL_GREEN_MASK, SDL_BLUE_MASK, SDL_ALPHA_MASK);
#endif

format = *surf->format;
Expand Down

0 comments on commit 0d1519e

Please sign in to comment.