diff --git a/README.md b/README.md index ab70650..49f76a1 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ This project is licensed under the GNU GPLv3. See LICENSE.md for details. Additi # Credits The following people contributed to Anemone3DS in some way. Without these people, Anemone3DS wouldn't exist, or wouldn't be as good as it is: [CONTRIBUTORS.md](CONTRIBUTORS.md) +Most of the icons under `romfs` are from the site [icons8.com](https://icons8.com) and are licensed under the [CC-BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/3.0/) + Special thanks go to these people who, whilst not directly contributing, helped immensely: * [Rinnegatamante](https://github.com/Rinnegatamante), whose code served as reference on theme installation. * [SteveIce10](https://github.com/SteveIce10), whose QR code in FBI was essential. diff --git a/include/common.h b/include/common.h index 75429e9..95d088a 100644 --- a/include/common.h +++ b/include/common.h @@ -60,6 +60,7 @@ enum TextureID { TEXTURE_ARROW, TEXTURE_ARROW_SIDE, TEXTURE_SHUFFLE, + TEXTURE_SHUFFLE_NO_BGM, TEXTURE_INSTALLED, TEXTURE_PREVIEW_ICON, TEXTURE_SORT, diff --git a/include/loading.h b/include/loading.h index 68d4b00..a1fbcee 100644 --- a/include/loading.h +++ b/include/loading.h @@ -71,6 +71,7 @@ typedef struct { bool is_zip; bool in_shuffle; + bool no_bgm_shuffle; bool installed; json_int_t tp_download_id; diff --git a/romfs/shuffle_no_bgm.png b/romfs/shuffle_no_bgm.png new file mode 100644 index 0000000..d5ff732 Binary files /dev/null and b/romfs/shuffle_no_bgm.png differ diff --git a/source/draw.c b/source/draw.c index 49a3105..01aef7e 100644 --- a/source/draw.c +++ b/source/draw.c @@ -42,6 +42,7 @@ void init_screens(void) pp2d_load_texture_png(TEXTURE_ARROW, "romfs:/arrow.png"); pp2d_load_texture_png(TEXTURE_ARROW_SIDE, "romfs:/arrow_side.png"); pp2d_load_texture_png(TEXTURE_SHUFFLE, "romfs:/shuffle.png"); + pp2d_load_texture_png(TEXTURE_SHUFFLE_NO_BGM, "romfs:/shuffle_no_bgm.png"); pp2d_load_texture_png(TEXTURE_INSTALLED, "romfs:/installed.png"); pp2d_load_texture_png(TEXTURE_PREVIEW_ICON, "romfs:/preview.png"); pp2d_load_texture_png(TEXTURE_SORT, "romfs:/sort.png"); @@ -478,8 +479,11 @@ void draw_interface(Entry_List_s* list, Instructions_s instructions) pp2d_draw_wtext(list->entry_size+6, vertical_offset + 16, 0.55, 0.55, font_color, name); - if(current_entry->in_shuffle) + if(current_entry->no_bgm_shuffle) + pp2d_draw_texture_blend(TEXTURE_SHUFFLE_NO_BGM, 320-24-4, vertical_offset, font_color); + else if(current_entry->in_shuffle) pp2d_draw_texture_blend(TEXTURE_SHUFFLE, 320-24-4, vertical_offset, font_color); + if(current_entry->installed) pp2d_draw_texture_blend(TEXTURE_INSTALLED, 320-24-4, vertical_offset + 22, font_color); diff --git a/source/main.c b/source/main.c index 14d732f..0c9590d 100644 --- a/source/main.c +++ b/source/main.c @@ -286,9 +286,24 @@ static void change_selected(Entry_List_s * list, int change_value) static void toggle_shuffle(Entry_List_s * list) { Entry_s * current_entry = &list->entries[list->selected_entry]; - if(current_entry->in_shuffle) list->shuffle_count--; - else list->shuffle_count++; - current_entry->in_shuffle = !current_entry->in_shuffle; + if(current_entry->in_shuffle) + { + if(current_entry->no_bgm_shuffle) + { + current_entry->in_shuffle = false; + current_entry->no_bgm_shuffle = false; + list->shuffle_count--; + } + else + { + current_entry->no_bgm_shuffle = true; + } + } + else + { + current_entry->in_shuffle = true; + list->shuffle_count++; + } } int main(void) diff --git a/source/themes.c b/source/themes.c index 6fd1290..ee45fe5 100644 --- a/source/themes.c +++ b/source/themes.c @@ -100,13 +100,22 @@ static Result install_theme_internal(Entry_List_s themes, int installmode) { char bgm_cache_path[26] = {0}; sprintf(bgm_cache_path, "/BgmCache_%.2i.bin", shuffle_count); - music_size = load_data("/bgm.bcstm", *current_theme, &music); - if(music_size > BGM_MAX_SIZE) + if(current_theme->no_bgm_shuffle) { - free(music); - DEBUG("bgm too big\n"); - return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_TOO_LARGE); + music = NULL; + music_size = 0; + } + else + { + music_size = load_data("/bgm.bcstm", *current_theme, &music); + + if(music_size > BGM_MAX_SIZE) + { + free(music); + DEBUG("bgm too big\n"); + return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_TOO_LARGE); + } } shuffle_music_sizes[shuffle_count] = music_size; @@ -116,8 +125,11 @@ static Result install_theme_internal(Entry_List_s themes, int installmode) FSUSER_OpenFile(&bgm_cache_handle, ArchiveThemeExt, fsMakePath(PATH_ASCII, bgm_cache_path), FS_OPEN_WRITE, 0); padded = calloc(BGM_MAX_SIZE, sizeof(char)); - memcpy(padded, music, music_size); - free(music); + if(!current_theme->no_bgm_shuffle) + { + memcpy(padded, music, music_size); + free(music); + } FSFILE_Write(bgm_cache_handle, NULL, 0, padded, BGM_MAX_SIZE, FS_WRITE_FLUSH);