mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
Swap SDL color masks for icon
So at least colors in the icon are displayed correctly
This commit is contained in:
parent
fa6fdd7cce
commit
cfee178f2f
|
@ -41,7 +41,7 @@ namespace Renderer
|
||||||
}
|
}
|
||||||
|
|
||||||
//ATM it is best to just leave the window icon alone on windows.
|
//ATM it is best to just leave the window icon alone on windows.
|
||||||
//When compiled as a Windows application, ES at least has an icon int the taskbar
|
//When compiled as a Windows application, ES at least has an icon in the taskbar
|
||||||
//The method below looks pretty shite as alpha isn't taken into account...
|
//The method below looks pretty shite as alpha isn't taken into account...
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
//try loading PNG from memory
|
//try loading PNG from memory
|
||||||
|
@ -51,9 +51,9 @@ namespace Renderer
|
||||||
if (!rawData.empty()) {
|
if (!rawData.empty()) {
|
||||||
//SDL interprets each pixel as a 32-bit number, so our masks must depend on the endianness (byte order) of the machine
|
//SDL interprets each pixel as a 32-bit number, so our masks must depend on the endianness (byte order) of the machine
|
||||||
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
||||||
Uint32 rmask = 0xff000000; Uint32 gmask = 0x00ff0000; Uint32 bmask = 0x0000ff00; Uint32 amask = 0x000000ff;
|
Uint32 rmask = 0xff000000; Uint32 gmask = 0x0000ff00; Uint32 bmask = 0x00ff0000; Uint32 amask = 0x000000ff;
|
||||||
#else
|
#else
|
||||||
Uint32 rmask = 0x000000ff; Uint32 gmask = 0x0000ff00; Uint32 bmask = 0x00ff0000;Uint32 amask = 0xff000000;
|
Uint32 rmask = 0x000000ff; Uint32 gmask = 0x00ff0000; Uint32 bmask = 0x0000ff00; Uint32 amask = 0xff000000;
|
||||||
#endif
|
#endif
|
||||||
//try creating SDL surface from logo data
|
//try creating SDL surface from logo data
|
||||||
SDL_Surface * logoSurface = SDL_CreateRGBSurfaceFrom((void *)rawData.data(), width, height, 32, width*4, rmask, gmask, bmask, amask);
|
SDL_Surface * logoSurface = SDL_CreateRGBSurfaceFrom((void *)rawData.data(), width, height, 32, width*4, rmask, gmask, bmask, amask);
|
||||||
|
|
Loading…
Reference in a new issue