diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index db6cef1d..874a4813 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -3250,12 +3250,12 @@ void Graphics::drawtele(int x, int y, int t, Uint32 c) Uint32 Graphics::getRGBA(Uint8 r, Uint8 g, Uint8 b, Uint8 a) { - return SDL_MapRGBA(backBuffer->format, b, g, r, a); + return SDL_MapRGBA(backBuffer->format, r, g, b, a); } Uint32 Graphics::getRGB(Uint8 r, Uint8 g, Uint8 b) { - return SDL_MapRGB(backBuffer->format, b, g, r); + return SDL_MapRGB(backBuffer->format, r, g, b); } Uint32 Graphics::getBGR(Uint8 r, Uint8 g, Uint8 b) diff --git a/desktop_version/src/GraphicsResources.cpp b/desktop_version/src/GraphicsResources.cpp index f16c6cb9..379cef3c 100644 --- a/desktop_version/src/GraphicsResources.cpp +++ b/desktop_version/src/GraphicsResources.cpp @@ -50,23 +50,20 @@ static SDL_Surface* LoadImage(const char *filename, bool noBlend = true, bool no } FILESYSTEM_freeMemory(&fileIn); - loadedImage = SDL_CreateRGBSurfaceFrom( + loadedImage = SDL_CreateRGBSurfaceWithFormatFrom( data, width, height, noAlpha ? 24 : 32, width * (noAlpha ? 3 : 4), - 0x000000FF, - 0x0000FF00, - 0x00FF0000, - noAlpha ? 0x00000000 : 0xFF000000 + noAlpha ? SDL_PIXELFORMAT_RGB24 : SDL_PIXELFORMAT_ABGR8888 ); if (loadedImage != NULL) { optimizedImage = SDL_ConvertSurfaceFormat( loadedImage, - SDL_PIXELFORMAT_ABGR8888, // FIXME: Format? -flibit + SDL_PIXELFORMAT_ARGB8888, 0 ); SDL_FreeSurface( loadedImage ); diff --git a/desktop_version/src/Screen.cpp b/desktop_version/src/Screen.cpp index 5fa5bf15..d6183190 100644 --- a/desktop_version/src/Screen.cpp +++ b/desktop_version/src/Screen.cpp @@ -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);