-
-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
retroarch: fix vertical fade (patch)
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
packages/libretro/retroarch/patches/retroarch-01-vertical_fade_corrections.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
From e8995ca9df823eca7322819ac8ae209cf9633e8e Mon Sep 17 00:00:00 2001 | ||
From: sonninnos <[email protected]> | ||
Date: Fri, 11 Mar 2022 20:59:22 +0200 | ||
Subject: [PATCH] (XMB) Vertical Fade corrections | ||
|
||
--- | ||
menu/drivers/xmb.c | 13 +++++++------ | ||
menu/menu_setting.c | 2 +- | ||
2 files changed, 8 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c | ||
index a1e5093e441..023dddca3cb 100644 | ||
--- a/menu/drivers/xmb.c | ||
+++ b/menu/drivers/xmb.c | ||
@@ -3394,19 +3394,20 @@ static int xmb_draw_item( | ||
|
||
if (menu_xmb_vertical_fade_factor) | ||
{ | ||
- float factor = menu_xmb_vertical_fade_factor / 100.0f / 0.004f; | ||
float min_alpha = 0.1f; | ||
float max_alpha = (i == current) ? xmb->items_active_alpha : xmb->items_passive_alpha; | ||
float new_alpha = node->alpha; | ||
- float top_margin = xmb->margins_screen_top; | ||
float icon_space = xmb->icon_spacing_vertical; | ||
+ float icon_ratio = icon_space / height / icon_space * 4; | ||
+ float scr_margin = xmb->margins_screen_top + (icon_space / icon_ratio / 400); | ||
+ float factor = menu_xmb_vertical_fade_factor / 100.0f / icon_ratio; | ||
|
||
/* Top */ | ||
- if (node->y < 0) | ||
- new_alpha = (node->y + top_margin + (icon_space / 4)) / factor; | ||
+ if (i < current) | ||
+ new_alpha = (node->y + scr_margin) / factor; | ||
/* Bottom */ | ||
- else if (node->y > (height - (top_margin * 2)) && node->y < (height - top_margin + icon_space)) | ||
- new_alpha = (height - node->y - top_margin + (icon_space / 4)) / factor; | ||
+ else if (i > current) | ||
+ new_alpha = (height - node->y - scr_margin + icon_space) / factor; | ||
/* Rest need to reset after vertical wrap-around */ | ||
else if (node->x == 0 && node->alpha > 0 && node->alpha != max_alpha) | ||
new_alpha = max_alpha; | ||
diff --git a/menu/menu_setting.c b/menu/menu_setting.c | ||
index 10458eee750..812cc834de7 100644 | ||
--- a/menu/menu_setting.c | ||
+++ b/menu/menu_setting.c | ||
@@ -16136,7 +16136,7 @@ static bool setting_append_list( | ||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint; | ||
(*list)[list_info->index - 1].action_left = &setting_uint_action_left_with_refresh; | ||
(*list)[list_info->index - 1].action_right = &setting_uint_action_right_with_refresh; | ||
- menu_settings_list_current_add_range(list, list_info, 0, 300, 1, true, true); | ||
+ menu_settings_list_current_add_range(list, list_info, 0, 500, 1, true, true); | ||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED); | ||
|
||
CONFIG_PATH( |