Skip to content

Commit

Permalink
Add support for GIF/BMP images
Browse files Browse the repository at this point in the history
Static gifs only. Animated gifs will be displayed without any animation.
  • Loading branch information
joel16 committed Jun 4, 2018
1 parent e966d7b commit 04092ee
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions source/dirbrowse.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,19 +280,19 @@ void Dirbrowse_DisplayFiles(void)
if (file->isDir)
SDL_DrawImage(RENDERER, config_dark_theme? icon_dir_dark : icon_dir, 80, 141 + (73 * printed), 72, 72);
else if ((strncasecmp(FS_GetFileExt(file->name), "nro", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "elf", 3) == 0)
|| (strncasecmp(FS_GetFileExt(file->name), "bin", 3) == 0))
|| (strncasecmp(FS_GetFileExt(file->name), "bin", 3) == 0))
SDL_DrawImage(RENDERER, icon_app, 80, 141 + (73 * printed), 72, 72);
else if ((strncasecmp(FS_GetFileExt(file->name), "zip", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "tar", 3) == 0)
|| (strncasecmp(FS_GetFileExt(file->name), "lz4", 3) == 0))
|| (strncasecmp(FS_GetFileExt(file->name), "lz4", 3) == 0))
SDL_DrawImage(RENDERER, icon_archive, 80, 141 + (73 * printed), 72, 72);
else if ((strncasecmp(FS_GetFileExt(file->name), "mp3", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "wav", 3) == 0)
|| (strncasecmp(FS_GetFileExt(file->name), "ogg", 3) == 0))
|| (strncasecmp(FS_GetFileExt(file->name), "ogg", 3) == 0))
SDL_DrawImage(RENDERER, icon_audio, 80, 141 + (73 * printed), 72, 72);
else if ((strncasecmp(FS_GetFileExt(file->name), "bmp", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "gif", 3) == 0)
|| (strncasecmp(FS_GetFileExt(file->name), "jpg", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "png", 3) == 0))
else if ((strncasecmp(FS_GetFileExt(file->name), "png", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "jpg", 3) == 0) ||
(strncasecmp(FS_GetFileExt(file->name), "bmp", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "gif", 3) == 0))
SDL_DrawImage(RENDERER, icon_image, 80, 141 + (73 * printed), 72, 72);
else if ((strncasecmp(FS_GetFileExt(file->name), "txt", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "lua", 3) == 0)
|| (strncasecmp(FS_GetFileExt(file->name), "cfg", 3) == 0))
|| (strncasecmp(FS_GetFileExt(file->name), "cfg", 3) == 0))
SDL_DrawImage(RENDERER, icon_text, 80, 141 + (73 * printed), 72, 72);
else
SDL_DrawImage(RENDERER, icon_file, 80, 141 + (73 * printed), 72, 72);
Expand Down Expand Up @@ -369,7 +369,8 @@ void Dirbrowse_OpenFile(void)
Dirbrowse_PopulateFiles(true);
}
}
else if ((strncasecmp(FS_GetFileExt(file->name), "png", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "jpg", 3) == 0))
else if ((strncasecmp(FS_GetFileExt(file->name), "png", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "jpg", 3) == 0) ||
(strncasecmp(FS_GetFileExt(file->name), "bmp", 3) == 0) || (strncasecmp(FS_GetFileExt(file->name), "gif", 3) == 0))
Gallery_DisplayImage(path);
else if (strncasecmp(FS_GetFileExt(file->name), "zip", 3) == 0)
{
Expand Down

0 comments on commit 04092ee

Please sign in to comment.