Skip to content

Commit 51c1bdc

Browse files
committed
retroarch: add patch to fix fade effect
remove this patch after upgrade to 1.10.2 or later
1 parent ce0e4f8 commit 51c1bdc

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
From e8995ca9df823eca7322819ac8ae209cf9633e8e Mon Sep 17 00:00:00 2001
2+
From: sonninnos <[email protected]>
3+
Date: Fri, 11 Mar 2022 20:59:22 +0200
4+
Subject: [PATCH] (XMB) Vertical Fade corrections
5+
6+
---
7+
menu/drivers/xmb.c | 13 +++++++------
8+
menu/menu_setting.c | 2 +-
9+
2 files changed, 8 insertions(+), 7 deletions(-)
10+
11+
diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c
12+
index a1e5093e441..023dddca3cb 100644
13+
--- a/menu/drivers/xmb.c
14+
+++ b/menu/drivers/xmb.c
15+
@@ -3394,19 +3394,20 @@ static int xmb_draw_item(
16+
17+
if (menu_xmb_vertical_fade_factor)
18+
{
19+
- float factor = menu_xmb_vertical_fade_factor / 100.0f / 0.004f;
20+
float min_alpha = 0.1f;
21+
float max_alpha = (i == current) ? xmb->items_active_alpha : xmb->items_passive_alpha;
22+
float new_alpha = node->alpha;
23+
- float top_margin = xmb->margins_screen_top;
24+
float icon_space = xmb->icon_spacing_vertical;
25+
+ float icon_ratio = icon_space / height / icon_space * 4;
26+
+ float scr_margin = xmb->margins_screen_top + (icon_space / icon_ratio / 400);
27+
+ float factor = menu_xmb_vertical_fade_factor / 100.0f / icon_ratio;
28+
29+
/* Top */
30+
- if (node->y < 0)
31+
- new_alpha = (node->y + top_margin + (icon_space / 4)) / factor;
32+
+ if (i < current)
33+
+ new_alpha = (node->y + scr_margin) / factor;
34+
/* Bottom */
35+
- else if (node->y > (height - (top_margin * 2)) && node->y < (height - top_margin + icon_space))
36+
- new_alpha = (height - node->y - top_margin + (icon_space / 4)) / factor;
37+
+ else if (i > current)
38+
+ new_alpha = (height - node->y - scr_margin + icon_space) / factor;
39+
/* Rest need to reset after vertical wrap-around */
40+
else if (node->x == 0 && node->alpha > 0 && node->alpha != max_alpha)
41+
new_alpha = max_alpha;
42+
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
43+
index 10458eee750..812cc834de7 100644
44+
--- a/menu/menu_setting.c
45+
+++ b/menu/menu_setting.c
46+
@@ -16136,7 +16136,7 @@ static bool setting_append_list(
47+
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
48+
(*list)[list_info->index - 1].action_left = &setting_uint_action_left_with_refresh;
49+
(*list)[list_info->index - 1].action_right = &setting_uint_action_right_with_refresh;
50+
- menu_settings_list_current_add_range(list, list_info, 0, 300, 1, true, true);
51+
+ menu_settings_list_current_add_range(list, list_info, 0, 500, 1, true, true);
52+
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED);
53+
54+
CONFIG_PATH(

0 commit comments

Comments
 (0)