Add support for custom BMP icons and custom NDS banners for games and folders. Closes #53 and Closes #62

This commit is contained in:
Augusto Daniele
2026-07-05 11:27:48 -03:00
committed by GitHub
parent a845f03686
commit f90d0a1aae
40 changed files with 841 additions and 187 deletions

View File

@@ -0,0 +1,49 @@
#include "common.h"
#include <string.h>
#include "core/StringUtil.h"
#include "FileType/NullFileTypeProvider.h"
#include "SdFolderFactory.h"
#include "RepositoryBase.h"
void RepositoryBase::InitializeFolders(const char* basePath)
{
NullFileTypeProvider fileTypeProvider;
SdFolderFactory folderFactory(&fileTypeProvider);
char path[64];
u32 len = StringUtil::Copy(path, basePath, sizeof(path));
StringUtil::Copy(path + len, "nds", sizeof(path) - len);
_ndsFolder = folderFactory.CreateFromPath(path);
if (_ndsFolder)
{
_ndsFolder->SortByNameInPlace();
}
StringUtil::Copy(path + len, "gba", sizeof(path) - len);
_gbaFolder = folderFactory.CreateFromPath(path);
if (_gbaFolder)
{
_gbaFolder->SortByNameInPlace();
}
StringUtil::Copy(path + len, "user", sizeof(path) - len);
_userFolder = folderFactory.CreateFromPath(path);
if (_userFolder)
{
_userFolder->SortByNameInPlace();
}
}
const SdFolder* RepositoryBase::GetFileTypeFolder(const char* shortName) const
{
if (!strcmp(shortName, "nds"))
{
return _ndsFolder.get();
}
if (!strcmp(shortName, "gba"))
{
return _gbaFolder.get();
}
return nullptr;
}