1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 10:09:43 +01:00

Remove noBlend argument from LoadImage

This argument... doesn't do anything.

First off, setting it to true explicitly enables blending on the
resulting surface, which is kind of the exact opposite of the variable
name and is misleading to say the least? And secondly, SDL surfaces have
blending enabled by default anyways, so it still doesn't even do
anything.

It's also a default argument, and I'm not one to shy away from removing
such default arguments.
This commit is contained in:
Misa 2021-12-25 00:51:27 -08:00
parent a6b076e234
commit 3108178c53

View file

@ -23,7 +23,7 @@ extern "C"
extern const char* lodepng_error_text(unsigned code); extern const char* lodepng_error_text(unsigned code);
} }
static SDL_Surface* LoadImage(const char *filename, bool noBlend = true, bool noAlpha = false) static SDL_Surface* LoadImage(const char *filename, bool noAlpha = false)
{ {
//Temporary storage for the image that's loaded //Temporary storage for the image that's loaded
SDL_Surface* loadedImage = NULL; SDL_Surface* loadedImage = NULL;
@ -76,10 +76,7 @@ static SDL_Surface* LoadImage(const char *filename, bool noBlend = true, bool no
); );
SDL_FreeSurface( loadedImage ); SDL_FreeSurface( loadedImage );
SDL_free(data); SDL_free(data);
if (noBlend)
{
SDL_SetSurfaceBlendMode(optimizedImage, SDL_BLENDMODE_BLEND); SDL_SetSurfaceBlendMode(optimizedImage, SDL_BLENDMODE_BLEND);
}
return optimizedImage; return optimizedImage;
} }
else else
@ -102,14 +99,14 @@ void GraphicsResources::init(void)
im_bfont = LoadImage("graphics/font.png"); im_bfont = LoadImage("graphics/font.png");
im_teleporter = LoadImage("graphics/teleporter.png"); im_teleporter = LoadImage("graphics/teleporter.png");
im_image0 = LoadImage("graphics/levelcomplete.png", false); im_image0 = LoadImage("graphics/levelcomplete.png");
im_image1 = LoadImage("graphics/minimap.png", true, true); im_image1 = LoadImage("graphics/minimap.png", true);
im_image2 = LoadImage("graphics/covered.png", true, true); im_image2 = LoadImage("graphics/covered.png", true);
im_image3 = LoadImage("graphics/elephant.png"); im_image3 = LoadImage("graphics/elephant.png");
im_image4 = LoadImage("graphics/gamecomplete.png", false); im_image4 = LoadImage("graphics/gamecomplete.png");
im_image5 = LoadImage("graphics/fliplevelcomplete.png", false); im_image5 = LoadImage("graphics/fliplevelcomplete.png");
im_image6 = LoadImage("graphics/flipgamecomplete.png", false); im_image6 = LoadImage("graphics/flipgamecomplete.png");
im_image7 = LoadImage("graphics/site.png", false); im_image7 = LoadImage("graphics/site.png");
im_image8 = LoadImage("graphics/site2.png"); im_image8 = LoadImage("graphics/site2.png");
im_image9 = LoadImage("graphics/site3.png"); im_image9 = LoadImage("graphics/site3.png");
im_image10 = LoadImage("graphics/ending.png"); im_image10 = LoadImage("graphics/ending.png");