Skip to content

Commit

Permalink
Fix icon and cursor rgba order
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Nov 1, 2024
1 parent 819d9b7 commit a93eb5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/mouse/sdl/Cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Cursor::Cursor(image::ImageData *data, int hotx, int hoty)
int h = data->getHeight();
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)
throw love::Exception("Cannot create cursor: out of memory.");

Expand Down
2 changes: 1 addition & 1 deletion src/modules/window/sdl/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ bool Window::setIcon(love::image::ImageData *imgd)
int bytesperpixel = (int) getPixelFormatBlockSize(imgd->getFormat());
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)
return false;
Expand Down

0 comments on commit a93eb5a

Please sign in to comment.