From eb343ca82e20a92554cefd6ce996f1c6e0758e2a Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 11 Oct 2020 01:07:20 +1100 Subject: [PATCH] [obs] added masked color cursor support --- obs/lg.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/obs/lg.c b/obs/lg.c index 1022dc97..d05e7a95 100644 --- a/obs/lg.c +++ b/obs/lg.c @@ -247,6 +247,15 @@ static void * pointerThread(void * data) memcpy(this->cursorData, data, dataSize); + if (cursor->type == CURSOR_TYPE_MASKED_COLOR) + { + for(int i = 0; i < dataSize; ++i) + { + const uint32_t c = ((uint32_t *)this->cursorData)[i]; + ((uint32_t *)this->cursorData)[i] = (c & ~0xFF000000) | (c & 0xFF000000 ? 0x0 : 0xFF000000); + } + } + this->cursor.width = cursor->width; this->cursor.height = cursor->height; this->cursor.hx = cursor->hx; @@ -348,6 +357,9 @@ static void lgVideoTick(void * data, float seconds) switch(this->cursor.type) { + case CURSOR_TYPE_MASKED_COLOR: + /* fallthrough */ + case CURSOR_TYPE_COLOR: this->cursorTex = gs_texture_create(