Several improvements (#9)

* fix icon filename

* update pp2d to fix preview problem

* several improvements:
- rely on a single header for simple/common headers
- cleaned up main by putting the interface drawing function in its own file
- load previews from .zip themes (may cause some loading times when launching
- only need 1 shuffle image thanks to pp2d's blending abilities

* not needed anymore

* fix preview color and position

* forgot

* add proper icon loading
thanks steveice10 for bannertool which this was pretty much taken from

* only add proper themes to the list

* add slightly more space between the icon and the name

* not monospace, the little movement every blink is annoying

* fix typo
This commit is contained in:
LiquidFenrir
2017-08-31 13:55:00 +02:00
committed by Alex Taber
parent 9beae916b0
commit ebd2a9d6ae
14 changed files with 537 additions and 232 deletions

View File

@@ -24,12 +24,9 @@
* reasonable ways as different from the original version.
*/
#include <3ds.h>
#include <string.h>
#include <stdlib.h>
#include "fs.h"
#include "unicode.h"
#include "minizip/unzip.h"
Result open_archives(void)
@@ -80,6 +77,7 @@ Result open_archives(void)
theme.data = themePath;
retValue = FSUSER_OpenArchive(&ArchiveThemeExt, ARCHIVE_EXTDATA, theme);
if(R_FAILED(retValue)) return retValue;
romfsInit();
return 0;
}
@@ -98,27 +96,6 @@ Result close_archives(void)
return 0;
}
int get_number_entries(char *path)
{
int count = 0;
Handle dir_handle;
Result res = FSUSER_OpenDirectory(&dir_handle, ArchiveSD, fsMakePath(PATH_ASCII, path));
if (R_FAILED(res)) return -1;
bool done = false;
while (!done)
{
FS_DirectoryEntry *entry = malloc(sizeof(FS_DirectoryEntry));
u32 entries_read = 0;
FSDIR_Read(dir_handle, &entries_read, 1, entry);
free(entry);
if (entries_read) count++;
else if (!entries_read) break;
}
FSDIR_Close(dir_handle);
return count;
}
u64 file_to_buf(FS_Path path, FS_Archive archive, char** buf)
{
Handle file;