Skip to content

Commit

Permalink
Invert colors in the driver and add automatic-inverted theme
Browse files Browse the repository at this point in the history
  • Loading branch information
alfrix committed Feb 1, 2019
1 parent ba3c7c3 commit 69e7a2d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
5 changes: 3 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@
- UWP: Initial UWP port.
- VFS: Update to version 3.
- XBONE: Initial Xbox One port.
- XMB/OZONE: Add more icons.
- ???: Easter Egg.
- XMB/OZONE: Add more icons
- XMB: Add Automatic Inverted theme
- ???: Easter Egg

# 1.7.5
- CAMERA: Fix Video4Linux2 driver that broke years ago.
Expand Down
4 changes: 4 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -3602,6 +3602,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_AUTOMATIC,
"Automatic"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_AUTOMATIC_INVERTED,
"Automatic Inverted"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME,
"Menu Color Theme"
Expand Down
24 changes: 18 additions & 6 deletions menu/drivers/xmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,11 @@ const char* xmb_theme_ident(void)
case XMB_ICON_THEME_CUSTOM:
return "custom";
case XMB_ICON_THEME_MONOCHROME_INVERTED:
return "monochrome-inverted";
return "monochrome";
case XMB_ICON_THEME_AUTOMATIC:
return "automatic";
case XMB_ICON_THEME_AUTOMATIC_INVERTED:
return "automatic";
case XMB_ICON_THEME_MONOCHROME:
default:
break;
Expand Down Expand Up @@ -3754,7 +3756,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
}

/* Clock image */
menu_display_set_alpha(coord_white, MIN(xmb->alpha, 1.00f));
menu_display_set_alpha(item_color, MIN(xmb->alpha, 1.00f));

if (video_info->battery_level_enable)
{
Expand Down Expand Up @@ -3794,7 +3796,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
1,
0,
1,
&coord_white[0],
&item_color[0],
xmb->shadow_offset);

snprintf(msg, sizeof(msg), "%d%%", percent);
Expand Down Expand Up @@ -3834,7 +3836,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
1,
0,
1,
&coord_white[0],
&item_color[0],
xmb->shadow_offset);
}

Expand All @@ -3856,7 +3858,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
}

/* Arrow image */
menu_display_set_alpha(coord_white,
menu_display_set_alpha(item_color,
MIN(xmb->textures_arrow_alpha, xmb->alpha));

if (coord_white[3] != 0 && !xmb->assets_missing)
Expand All @@ -3875,7 +3877,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
xmb->textures_arrow_alpha,
0,
1,
&coord_white[0],
&item_color[0],
xmb->shadow_offset);

menu_display_blend_begin(video_info);
Expand Down Expand Up @@ -4978,6 +4980,16 @@ static void xmb_context_reset_textures(
xmb->netplay_tab_node.zoom = xmb->categories_active_zoom;
#endif

/* Recolor */
if (
(settings->uints.menu_xmb_theme == XMB_ICON_THEME_MONOCHROME_INVERTED) ||
(settings->uints.menu_xmb_theme == XMB_ICON_THEME_AUTOMATIC_INVERTED)
)
memcpy(item_color, coord_black, sizeof(item_color));
else
memcpy(item_color, coord_white, sizeof(item_color));


return;

error:
Expand Down
1 change: 1 addition & 0 deletions menu/menu_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ enum xmb_icon_theme
XMB_ICON_THEME_RETROSYSTEM,
XMB_ICON_THEME_MONOCHROME_INVERTED,
XMB_ICON_THEME_AUTOMATIC,
XMB_ICON_THEME_AUTOMATIC_INVERTED,
XMB_ICON_THEME_LAST
};

Expand Down
4 changes: 4 additions & 0 deletions menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,10 @@ static void setting_get_string_representation_uint_xmb_icon_theme(
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_AUTOMATIC), len);
break;
case XMB_ICON_THEME_AUTOMATIC_INVERTED:
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_AUTOMATIC_INVERTED), len);
break;
}
}

Expand Down
1 change: 1 addition & 0 deletions msg_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_DOTART,
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_AUTOMATIC,
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_AUTOMATIC_INVERTED,

MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_LEGACY_RED,
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_DARK_PURPLE,
Expand Down

0 comments on commit 69e7a2d

Please sign in to comment.