Skip to content

Commit 33e814f

Browse files
committed
rg_gui: small tweaks for transparency support
1 parent 7a11bde commit 33e814f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

components/retro-go/rg_gui.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,17 @@ void rg_gui_copy_buffer(rg_surface_t *dest_surface, int left, int top, int width
273273
uint16_t *dst = target_buffer + (top + y) * target_width + left;
274274
const uint16_t *src = (void *)buffer + y * stride;
275275
for (int x = 0; x < width; ++x)
276-
if (src[x] != C_TRANSPARENT)
276+
// FIXME: this is a bit wanky but basically it is used to make the difference between
277+
// drawings to the OSD and to the gui buffer wich C_TRANSPARENT are handled differently
278+
if (dest_surface)
279+
{
277280
dst[x] = src[x];
281+
}
282+
else
283+
{
284+
if (src[x] != C_TRANSPARENT)
285+
dst[x] = src[x];
286+
}
278287
}
279288
}
280289
else
@@ -1931,5 +1940,6 @@ void rg_gui_draw_status_bars_osd(rg_surface_t *osd)
19311940
(int)app->frameskip,
19321941
(int)round(stats.busyPercent));
19331942

1934-
rg_gui_draw_text(osd, 0, RG_GUI_TOP, osd->width, header, C_WHITE, C_BLACK, 0);
1943+
rg_gui_draw_rect(osd, 0, RG_GUI_TOP, osd->width, osd->height, 0, 0, C_TRANSPARENT);
1944+
rg_gui_draw_text(osd, 0, RG_GUI_TOP, osd->width, header, C_WHITE, C_TRANSPARENT, 0);
19351945
}

0 commit comments

Comments
 (0)