Browse Source

Fix icon and cursor rgba order

Sasha Szpakowski 9 months ago
parent
commit
a93eb5abc6
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/modules/mouse/sdl/Cursor.cpp
  2. 1 1
      src/modules/window/sdl/Window.cpp

+ 1 - 1
src/modules/mouse/sdl/Cursor.cpp

@@ -38,7 +38,7 @@ Cursor::Cursor(image::ImageData *data, int hotx, int hoty)
 	int h = data->getHeight();
 	int h = data->getHeight();
 	int pitch = w * 4;
 	int pitch = w * 4;
 
 
-	SDL_Surface *surface = SDL_CreateSurfaceFrom(w, h, SDL_PIXELFORMAT_RGBA8888, data->getData(), pitch);
+	SDL_Surface *surface = SDL_CreateSurfaceFrom(w, h, SDL_PIXELFORMAT_ABGR8888, data->getData(), pitch);
 	if (!surface)
 	if (!surface)
 		throw love::Exception("Cannot create cursor: out of memory.");
 		throw love::Exception("Cannot create cursor: out of memory.");
 
 

+ 1 - 1
src/modules/window/sdl/Window.cpp

@@ -1085,7 +1085,7 @@ bool Window::setIcon(love::image::ImageData *imgd)
 	int bytesperpixel = (int) getPixelFormatBlockSize(imgd->getFormat());
 	int bytesperpixel = (int) getPixelFormatBlockSize(imgd->getFormat());
 	int pitch = w * bytesperpixel;
 	int pitch = w * bytesperpixel;
 
 
-	SDL_Surface *sdlicon = SDL_CreateSurfaceFrom(w, h, SDL_PIXELFORMAT_RGBA8888, imgd->getData(), pitch);
+	SDL_Surface *sdlicon = SDL_CreateSurfaceFrom(w, h, SDL_PIXELFORMAT_ABGR8888, imgd->getData(), pitch);
 
 
 	if (!sdlicon)
 	if (!sdlicon)
 		return false;
 		return false;