mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 10:20:41 +00:00
(Lakka) Fix global opacity transition
This commit is contained in:
parent
05a34b21bb
commit
ae01143c18
@ -219,6 +219,9 @@ static void lakka_draw_text(const char *str, float x, float y, float scale, floa
|
|||||||
|
|
||||||
if (alpha > global_alpha)
|
if (alpha > global_alpha)
|
||||||
alpha = global_alpha;
|
alpha = global_alpha;
|
||||||
|
// Workaround https://github.com/libretro/RetroArch/blob/master/gfx/fonts/gl_raster_font.c#L216
|
||||||
|
if (alpha < 0.05)
|
||||||
|
alpha = 0.05;
|
||||||
|
|
||||||
params.scale = scale;
|
params.scale = scale;
|
||||||
params.color = FONT_COLOR_RGBA(255, 255, 255, (uint8_t)(255 * alpha));
|
params.color = FONT_COLOR_RGBA(255, 255, 255, (uint8_t)(255 * alpha));
|
||||||
@ -264,6 +267,9 @@ void lakka_draw_background(void)
|
|||||||
|
|
||||||
void lakka_draw_icon(GLuint texture, float x, float y, float alpha, float rotation, float scale)
|
void lakka_draw_icon(GLuint texture, float x, float y, float alpha, float rotation, float scale)
|
||||||
{
|
{
|
||||||
|
if (alpha > global_alpha)
|
||||||
|
alpha = global_alpha;
|
||||||
|
|
||||||
GLfloat color[] = {
|
GLfloat color[] = {
|
||||||
1.0f, 1.0f, 1.0f, alpha,
|
1.0f, 1.0f, 1.0f, alpha,
|
||||||
1.0f, 1.0f, 1.0f, alpha,
|
1.0f, 1.0f, 1.0f, alpha,
|
||||||
@ -275,9 +281,6 @@ void lakka_draw_icon(GLuint texture, float x, float y, float alpha, float rotati
|
|||||||
|
|
||||||
if (!gl)
|
if (!gl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (alpha > global_alpha)
|
|
||||||
alpha = global_alpha;
|
|
||||||
|
|
||||||
glViewport(x, gl->win_height - y, dim, dim);
|
glViewport(x, gl->win_height - y, dim, dim);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user