mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user