Added audio (mp3) and SFO file icons

This commit is contained in:
littlebalup 2016-09-03 23:35:34 +02:00
parent 09ddb32d90
commit db86470e93
7 changed files with 39 additions and 11 deletions

View File

@ -4,10 +4,11 @@ OBJS = main.o init.o io_process.o package_installer.o archive.o photo.o file
uncommon_dialog.o message_dialog.o ime_dialog.o config.o theme.o language.o utils.o sha1.o \
audioplayer.o minizip/unzip.o minizip/ioapi.o
RESOURCES_PNG = resources/folder_icon.png resources/file_icon.png resources/archive_icon.png resources/image_icon.png resources/ftp.png \
resources/battery.png resources/battery_bar_green.png resources/battery_bar_red.png resources/battery_bar_charge.png \
resources/headphone.png resources/audio_previous.png resources/audio_pause.png resources/audio_play.png \
resources/audio_next.png
RESOURCES_PNG = resources/folder_icon.png resources/file_icon.png resources/archive_icon.png resources/image_icon.png \
resources/audio_icon.png resources/sfo_icon.png \
resources/ftp.png resources/battery.png resources/battery_bar_green.png resources/battery_bar_red.png \
resources/battery_bar_charge.png resources/headphone.png resources/audio_previous.png resources/audio_pause.png \
resources/audio_play.png resources/audio_next.png
RESOURCES_TXT = resources/theme.txt resources/colors.txt resources/english_us.txt
OBJS += $(RESOURCES_PNG:.png=.o) $(RESOURCES_TXT:.txt=.o)

6
init.c
View File

@ -29,6 +29,10 @@ extern unsigned char _binary_resources_archive_icon_png_start;
extern unsigned char _binary_resources_archive_icon_png_size;
extern unsigned char _binary_resources_image_icon_png_start;
extern unsigned char _binary_resources_image_icon_png_size;
extern unsigned char _binary_resources_audio_icon_png_start;
extern unsigned char _binary_resources_audio_icon_png_size;
extern unsigned char _binary_resources_sfo_icon_png_start;
extern unsigned char _binary_resources_sfo_icon_png_size;
extern unsigned char _binary_resources_ftp_png_start;
extern unsigned char _binary_resources_ftp_png_size;
extern unsigned char _binary_resources_battery_png_start;
@ -63,6 +67,8 @@ static DefaultFile default_files[] = {
{ "ux0:VitaShell/theme/Default/file_icon.png", (void *)&_binary_resources_file_icon_png_start, (int)&_binary_resources_file_icon_png_size },
{ "ux0:VitaShell/theme/Default/archive_icon.png", (void *)&_binary_resources_archive_icon_png_start, (int)&_binary_resources_archive_icon_png_size },
{ "ux0:VitaShell/theme/Default/image_icon.png", (void *)&_binary_resources_image_icon_png_start, (int)&_binary_resources_image_icon_png_size },
{ "ux0:VitaShell/theme/Default/audio_icon.png", (void *)&_binary_resources_audio_icon_png_start, (int)&_binary_resources_audio_icon_png_size },
{ "ux0:VitaShell/theme/Default/sfo_icon.png", (void *)&_binary_resources_sfo_icon_png_start, (int)&_binary_resources_sfo_icon_png_size },
{ "ux0:VitaShell/theme/Default/ftp.png", (void *)&_binary_resources_ftp_png_start, (int)&_binary_resources_ftp_png_size },
{ "ux0:VitaShell/theme/Default/battery.png", (void *)&_binary_resources_battery_png_start, (int)&_binary_resources_battery_png_size },
{ "ux0:VitaShell/theme/Default/battery_bar_red.png", (void *)&_binary_resources_battery_bar_red_png_start, (int)&_binary_resources_battery_bar_red_png_size },

8
main.c
View File

@ -1138,12 +1138,18 @@ int shellMain() {
color = FOLDER_COLOR;
vita2d_draw_texture(folder_icon, SHELL_MARGIN_X, y + 3.0f);
} else {
if (file_entry->type == FILE_TYPE_BMP || file_entry->type == FILE_TYPE_PNG || file_entry->type == FILE_TYPE_JPEG || file_entry->type == FILE_TYPE_MP3) { // Images
if (file_entry->type == FILE_TYPE_BMP || file_entry->type == FILE_TYPE_PNG || file_entry->type == FILE_TYPE_JPEG) { // Images
color = IMAGE_COLOR;
vita2d_draw_texture(image_icon, SHELL_MARGIN_X, y + 3.0f);
} else if (file_entry->type == FILE_TYPE_VPK || file_entry->type == FILE_TYPE_ZIP) { // Archive
color = ARCHIVE_COLOR;
vita2d_draw_texture(archive_icon, SHELL_MARGIN_X, y + 3.0f);
} else if (file_entry->type == FILE_TYPE_MP3) { // Audio
color = IMAGE_COLOR;
vita2d_draw_texture(audio_icon, SHELL_MARGIN_X, y + 3.0f);
} else if (file_entry->type == FILE_TYPE_SFO) { // SFO
// note: specific color to be determined
vita2d_draw_texture(sfo_icon, SHELL_MARGIN_X, y + 3.0f);
} else { // Other files
vita2d_draw_texture(file_icon, SHELL_MARGIN_X, y + 3.0f);
}

BIN
resources/audio_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

BIN
resources/sfo_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

21
theme.c
View File

@ -26,6 +26,8 @@ extern unsigned char _binary_resources_folder_icon_png_start;
extern unsigned char _binary_resources_file_icon_png_start;
extern unsigned char _binary_resources_archive_icon_png_start;
extern unsigned char _binary_resources_image_icon_png_start;
extern unsigned char _binary_resources_audio_icon_png_start;
extern unsigned char _binary_resources_sfo_icon_png_start;
extern unsigned char _binary_resources_ftp_png_start;
extern unsigned char _binary_resources_battery_png_start;
extern unsigned char _binary_resources_battery_bar_red_png_start;
@ -55,9 +57,10 @@ int PROGRESS_BAR_BG_COLOR;
int HEX_OFFSET_COLOR;
int HEX_NIBBLE_COLOR;
vita2d_texture *folder_icon = NULL, *file_icon = NULL, *archive_icon = NULL, *image_icon = NULL, *ftp_image = NULL, *dialog_image = NULL, *context_image = NULL,
*battery_image = NULL, *battery_bar_red_image = NULL, *battery_bar_green_image = NULL, *battery_bar_charge_image = NULL,
*bg_browser_image = NULL, *bg_hex_image = NULL, *bg_text_image = NULL, *bg_photo_image = NULL;
vita2d_texture *folder_icon = NULL, *file_icon = NULL, *archive_icon = NULL, *image_icon = NULL, *audio_icon = NULL, *sfo_icon = NULL,
*ftp_image = NULL, *dialog_image = NULL, *context_image = NULL, *battery_image = NULL, *battery_bar_red_image = NULL,
*battery_bar_green_image = NULL, *battery_bar_charge_image = NULL, *bg_browser_image = NULL, *bg_hex_image = NULL,
*bg_text_image = NULL, *bg_photo_image = NULL;
vita2d_texture *wallpaper_image[MAX_WALLPAPERS];
@ -122,6 +125,12 @@ void loadTheme() {
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/image_icon.png", theme_name);
image_icon = vita2d_load_PNG_file(path);
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/audio_icon.png", theme_name);
audio_icon = vita2d_load_PNG_file(path);
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/sfo_icon.png", theme_name);
sfo_icon = vita2d_load_PNG_file(path);
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/ftp.png", theme_name);
ftp_image = vita2d_load_PNG_file(path);
@ -190,6 +199,12 @@ void loadTheme() {
if (!image_icon)
image_icon = vita2d_load_PNG_buffer(&_binary_resources_image_icon_png_start);
if (!audio_icon)
audio_icon = vita2d_load_PNG_buffer(&_binary_resources_audio_icon_png_start);
if (!sfo_icon)
sfo_icon = vita2d_load_PNG_buffer(&_binary_resources_sfo_icon_png_start);
if (!ftp_image)
ftp_image = vita2d_load_PNG_buffer(&_binary_resources_ftp_png_start);

View File

@ -41,9 +41,9 @@ extern int PROGRESS_BAR_BG_COLOR;
extern int HEX_OFFSET_COLOR;
extern int HEX_NIBBLE_COLOR;
extern vita2d_texture *folder_icon, *file_icon, *archive_icon, *image_icon, *ftp_image, *dialog_image, *context_image,
*battery_image, *battery_bar_red_image, *battery_bar_green_image, *battery_bar_charge_image,
*bg_browser_image, *bg_hex_image, *bg_text_image, *bg_photo_image;
extern vita2d_texture *folder_icon, *file_icon, *archive_icon, *image_icon, *audio_icon, *sfo_icon,
*ftp_image, *dialog_image, *context_image, *battery_image, *battery_bar_red_image, *battery_bar_green_image,
*battery_bar_charge_image, *bg_browser_image, *bg_hex_image, *bg_text_image, *bg_photo_image;
extern vita2d_texture *wallpaper_image[MAX_WALLPAPERS];
extern vita2d_texture *previous_wallpaper_image, *current_wallpaper_image;