99% working. Only issues are: data aborts when installing a theme after viewing a preview, bgm only works when installed as part of a theme shuffle. Single themes are silent

This commit is contained in:
2017-07-28 23:12:22 -04:00
parent ac69ceda51
commit 0d59b5deea
7 changed files with 233 additions and 29 deletions

View File

@@ -6,6 +6,7 @@
#include "theme.h"
#include "unicode.h"
#include "minizip/unzip.h"
#include "ui.h"
Result prepare_archives()
{
@@ -246,13 +247,7 @@ Result prepare_themes(theme_data** themes_list)
atow(theme_path, "/Themes/");
strucat(theme_path, entry->name);
parseSmdh(theme_info, theme_path);
/*
FOR TESTING PURPOSES ONLY, REMOVE THIS LINE LATER!!!!
*/
theme_info->selected = true;
/*
FOR TESTING PURPOSES ONLY, REMOVE ABOVE LINE LATER!!!
*/
theme_info->selected = false;
themes_list[iter++] = theme_info;
}
free(entry);
@@ -573,18 +568,17 @@ Result themeInstall(theme_data theme_to_install)
Result shuffle_install(theme_data **themes, int len)
{
u8 count = 0;
theme_data *themes_to_be_shuffled[10] = {0};
u32 body_sizes[10] = {0};
u32 bgm_sizes[10] = {0};
// Load themes that are selected for shuffle
for (int iter = 0; iter < len; iter++)
{
if (themes[iter]->selected == true)
count++;
if (themes[iter]->selected) count++;
if (count > 10) return(MAKERESULT(RL_USAGE, RS_INVALIDARG, RM_COMMON, RD_INVALID_SELECTION));
themes_to_be_shuffled[iter] = themes[iter];
if (themes[iter]->selected) themes_to_be_shuffled[count - 1] = themes[iter];
}
// Load and edit SaveData