diff --git a/media-libs/libsdl2/libsdl2-2.0.20.recipe b/media-libs/libsdl2/libsdl2-2.0.20.recipe index 7f9efbce4..6f6ec84b6 100644 --- a/media-libs/libsdl2/libsdl2-2.0.20.recipe +++ b/media-libs/libsdl2/libsdl2-2.0.20.recipe @@ -6,7 +6,7 @@ software, emulators, and popular games." HOMEPAGE="https://www.libsdl.org/" COPYRIGHT="1997-2021 Sam Lantinga" LICENSE="Zlib" -REVISION="1" +REVISION="2" SOURCE_URI="https://www.libsdl.org/release/SDL2-$portVersion.tar.gz" CHECKSUM_SHA256="c56aba1d7b5b0e7e999e4a7698c70b63a3394ff9704b5f6e1c57e0c16f04dd06" SOURCE_DIR="SDL2-$portVersion" diff --git a/media-libs/libsdl2/patches/libsdl2-2.0.20.patchset b/media-libs/libsdl2/patches/libsdl2-2.0.20.patchset index 5c299eee2..1d6083b31 100644 --- a/media-libs/libsdl2/patches/libsdl2-2.0.20.patchset +++ b/media-libs/libsdl2/patches/libsdl2-2.0.20.patchset @@ -1212,3 +1212,56 @@ index 12cc2da..bc46aec 100644 -- 2.30.2 + +From 61510a4a211bc7b3fe8006d3c16447cef07e11a0 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sun, 12 Dec 2021 10:07:47 +1000 +Subject: Add bitmap cursor support + + +diff --git a/src/video/haiku/SDL_bvideo.cc b/src/video/haiku/SDL_bvideo.cc +index c5026de..868512e 100644 +--- a/src/video/haiku/SDL_bvideo.cc ++++ b/src/video/haiku/SDL_bvideo.cc +@@ -190,6 +190,31 @@ HAIKU_FreeCursor(SDL_Cursor * cursor) + SDL_free(cursor); + } + ++static SDL_Cursor * ++HAIKU_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) ++{ ++ SDL_Cursor *cursor; ++ SDL_Surface *converted; ++ ++ converted = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ARGB8888, 0); ++ if (!converted) { ++ return NULL; ++ } ++ ++ BBitmap *cursorBitmap = new BBitmap(BRect(0, 0, surface->w - 1, surface->h - 1), B_RGBA32); ++ cursorBitmap->SetBits(converted->pixels, converted->h * converted->pitch, 0, B_RGBA32); ++ SDL_FreeSurface(converted); ++ ++ cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor)); ++ if (cursor) { ++ cursor->driverdata = (void *)new BCursor(cursorBitmap, BPoint(hot_x, hot_y)); ++ } else { ++ return NULL; ++ } ++ ++ return cursor; ++} ++ + static int HAIKU_ShowCursor(SDL_Cursor *cursor) + { + SDL_Mouse *mouse = SDL_GetMouse(); +@@ -235,6 +260,7 @@ static void HAIKU_MouseInit(_THIS) + SDL_Mouse *mouse = SDL_GetMouse(); + if (!mouse) + return; ++ mouse->CreateCursor = HAIKU_CreateCursor; + mouse->CreateSystemCursor = HAIKU_CreateSystemCursor; + mouse->ShowCursor = HAIKU_ShowCursor; + mouse->FreeCursor = HAIKU_FreeCursor; +-- +2.30.2