channges to populate and apply badges.

This commit is contained in:
GameDragon2k 2017-10-21 17:48:26 -04:00
parent ec2808685d
commit 8b9ad28ecb
2 changed files with 10 additions and 22 deletions

View File

@ -35,6 +35,7 @@
#include "../menu/menu_entries.h" #include "../menu/menu_entries.h"
#endif #endif
#include "badges.h"
#include "cheevos.h" #include "cheevos.h"
#include "var.h" #include "var.h"
#include "cond.h" #include "cond.h"
@ -2157,16 +2158,17 @@ void cheevos_populate_menu(void *data, bool hardcore)
{ {
menu_entries_append_enum(info->list, cheevo->title, menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY, cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, atoi(cheevo->badge)); MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++; items_found++;
} }
else else
{ {
menu_entries_append_enum(info->list, cheevo->title, menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY, cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, atoi(cheevo->badge)); MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++; items_found++;
} }
set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_SOFTCORE));
} }
else else
{ {
@ -2184,6 +2186,7 @@ void cheevos_populate_menu(void *data, bool hardcore)
MENU_SETTINGS_CHEEVOS_START + i, 0, 0); MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++; items_found++;
} }
set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_HARDCORE));
} }
} }

View File

@ -61,6 +61,8 @@
#include "../../tasks/tasks_internal.h" #include "../../tasks/tasks_internal.h"
#include "../../cheevos/badges.h"
#define XMB_RIBBON_ROWS 64 #define XMB_RIBBON_ROWS 64
#define XMB_RIBBON_COLS 64 #define XMB_RIBBON_COLS 64
#define XMB_RIBBON_VERTICES 2*XMB_RIBBON_COLS*XMB_RIBBON_ROWS-2*XMB_RIBBON_COLS #define XMB_RIBBON_VERTICES 2*XMB_RIBBON_COLS*XMB_RIBBON_ROWS-2*XMB_RIBBON_COLS
@ -252,15 +254,6 @@ typedef struct xmb_handle
menu_texture_item list[XMB_TEXTURE_LAST]; menu_texture_item list[XMB_TEXTURE_LAST];
} textures; } textures;
#ifdef HAVE_CHEEVOS
struct
{
size_t current_badge;
menu_texture_item test;
menu_texture_item list[XMB_TEXTURE_LAST];
} badges;
#endif
xmb_node_t main_menu_node; xmb_node_t main_menu_node;
#ifdef HAVE_IMAGEVIEWER #ifdef HAVE_IMAGEVIEWER
xmb_node_t images_tab_node; xmb_node_t images_tab_node;
@ -2252,13 +2245,9 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
if ((type >= MENU_SETTINGS_CHEEVOS_START) && if ((type >= MENU_SETTINGS_CHEEVOS_START) &&
(type < MENU_SETTINGS_NETPLAY_ROOMS_START)) (type < MENU_SETTINGS_NETPLAY_ROOMS_START))
{ {
unsigned new_id = type - MENU_SETTINGS_CHEEVOS_START; //return badges_ctx.menu_texture_list[type - MENU_SETTINGS_CHEEVOS_START];
int bufferSize = 16; int new_id = type - MENU_SETTINGS_CHEEVOS_START;
char new_str[bufferSize]; return get_badge_texture( new_id );
snprintf(new_str, bufferSize, "%05d", (int)xmb->badges.current_badge);
strcat(new_str, ".png");
menu_display_reset_textures_list(new_str, "badges", &xmb->badges.list[new_id], TEXTURE_FILTER_MIPMAP_LINEAR);
return xmb->badges.list[new_id];
} }
#endif #endif
@ -2489,10 +2478,6 @@ static int xmb_draw_item(
if (color[3] != 0) if (color[3] != 0)
{ {
#ifdef HAVE_CHEEVOS
xmb->badges.current_badge = entry->entry_idx;
#endif
math_matrix_4x4 mymat_tmp; math_matrix_4x4 mymat_tmp;
menu_display_ctx_rotate_draw_t rotate_draw; menu_display_ctx_rotate_draw_t rotate_draw;
uintptr_t texture = xmb_icon_get_id(xmb, core_node, node, uintptr_t texture = xmb_icon_get_id(xmb, core_node, node,