1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 06:28:30 +02:00

Whiten texture only after loading surface

This fixes a regression where the red channel 0 glitch didn't work,
because the surface was always whitened, because LoadSprites would
whiten the image before converting it to surface.

This regression happened because of #923.

Fixes #962.
This commit is contained in:
Misa 2023-03-30 19:54:46 -07:00
parent 78128222e9
commit 8f23261134

View File

@ -237,15 +237,15 @@ static void LoadSprites(const char* filename, SDL_Texture** texture, SDL_Surface
unsigned char* data;
SDL_Surface* loadedImage = LoadImageRaw(filename, &data);
*texture = LoadTextureFromRaw(filename, loadedImage, TEX_WHITE);
if (*texture == NULL)
*surface = LoadSurfaceFromRaw(loadedImage);
if (*surface == NULL)
{
vlog_error("Image not found: %s", filename);
SDL_assert(0 && "Image not found! See stderr.");
}
*surface = LoadSurfaceFromRaw(loadedImage);
if (*surface == NULL)
*texture = LoadTextureFromRaw(filename, loadedImage, TEX_WHITE);
if (*texture == NULL)
{
vlog_error("Image not found: %s", filename);
SDL_assert(0 && "Image not found! See stderr.");