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;
|
unsigned char* data;
|
||||||
SDL_Surface* loadedImage = LoadImageRaw(filename, &data);
|
SDL_Surface* loadedImage = LoadImageRaw(filename, &data);
|
||||||
|
|
||||||
*texture = LoadTextureFromRaw(filename, loadedImage, TEX_WHITE);
|
*surface = LoadSurfaceFromRaw(loadedImage);
|
||||||
if (*texture == NULL)
|
if (*surface == NULL)
|
||||||
{
|
{
|
||||||
vlog_error("Image not found: %s", filename);
|
vlog_error("Image not found: %s", filename);
|
||||||
SDL_assert(0 && "Image not found! See stderr.");
|
SDL_assert(0 && "Image not found! See stderr.");
|
||||||
}
|
}
|
||||||
|
|
||||||
*surface = LoadSurfaceFromRaw(loadedImage);
|
*texture = LoadTextureFromRaw(filename, loadedImage, TEX_WHITE);
|
||||||
if (*surface == NULL)
|
if (*texture == NULL)
|
||||||
{
|
{
|
||||||
vlog_error("Image not found: %s", filename);
|
vlog_error("Image not found: %s", filename);
|
||||||
SDL_assert(0 && "Image not found! See stderr.");
|
SDL_assert(0 && "Image not found! See stderr.");
|
||||||
|
|||||||
Reference in New Issue
Block a user