mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Fix surface color masks
This fixes the color ordering of every SDL_Surface in the game. Basically, images need to be loaded in ABGR format (except if they don't have alpha, then you use RGB? I'm not sure what's going on here), and then they will be converted to RGB/RGBA afterwards. Due to the surfaces actually being BGR/BGRA, the game used to use getRGBA/getRGB to swap the colors back around to BGRA/BGR, but I've fixed those too.
This commit is contained in:
@@ -135,16 +135,13 @@ void Screen::LoadIcon(void)
|
||||
FILESYSTEM_loadAssetToMemory("VVVVVV.png", &fileIn, &length, false);
|
||||
lodepng_decode24(&data, &width, &height, fileIn, length);
|
||||
FILESYSTEM_freeMemory(&fileIn);
|
||||
SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(
|
||||
SDL_Surface *icon = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
data,
|
||||
width,
|
||||
height,
|
||||
24,
|
||||
width * 3,
|
||||
0x000000FF,
|
||||
0x0000FF00,
|
||||
0x00FF0000,
|
||||
0x00000000
|
||||
SDL_PIXELFORMAT_RGB24
|
||||
);
|
||||
SDL_SetWindowIcon(m_window, icon);
|
||||
SDL_FreeSurface(icon);
|
||||
|
||||
Reference in New Issue
Block a user