mirror of
https://github.com/wiiu-env/launchiine.git
synced 2024-11-22 09:49:17 +01:00
GameList: Use MCP_TitleListByAppType to request specific app catergories
This commit is contained in:
parent
96fa65a5ff
commit
36c92744b7
@ -77,21 +77,39 @@ int32_t GameList::readGameList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<struct MCPTitleListType> titles(titleCount);
|
std::vector<struct MCPTitleListType> titles(titleCount);
|
||||||
uint32_t realTitleCount;
|
uint32_t realTitleCount = 0;
|
||||||
|
|
||||||
MCPError err = MCP_TitleList(mcp, &realTitleCount, titles.data(), titles.size() * sizeof(decltype(titles)::value_type));
|
static const std::vector<MCPAppType> menuAppTypes {
|
||||||
|
MCP_APP_TYPE_GAME,
|
||||||
|
MCP_APP_TYPE_GAME_WII,
|
||||||
|
MCP_APP_TYPE_SYSTEM_APPS,
|
||||||
|
MCP_APP_TYPE_SYSTEM_SETTINGS,
|
||||||
|
MCP_APP_TYPE_FRIEND_LIST,
|
||||||
|
MCP_APP_TYPE_MIIVERSE,
|
||||||
|
MCP_APP_TYPE_ESHOP,
|
||||||
|
MCP_APP_TYPE_BROWSER,
|
||||||
|
MCP_APP_TYPE_DOWNLOAD_MANAGEMENT,
|
||||||
|
MCP_APP_TYPE_ACCOUNT_APPS,
|
||||||
|
};
|
||||||
|
|
||||||
|
for (auto appType : menuAppTypes) {
|
||||||
|
uint32_t titleCountByType = 0;
|
||||||
|
MCPError err = MCP_TitleListByAppType(mcp, appType, &titleCountByType, titles.data() + realTitleCount,
|
||||||
|
(titles.size() - realTitleCount) * sizeof(decltype(titles)::value_type));
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
MCP_Close(mcp);
|
MCP_Close(mcp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
realTitleCount += titleCountByType;
|
||||||
|
}
|
||||||
if (realTitleCount != titles.size()) {
|
if (realTitleCount != titles.size()) {
|
||||||
titles.resize(realTitleCount);
|
titles.resize(realTitleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto title_candidate : titles) {
|
for (auto title_candidate : titles) {
|
||||||
if(true || (title_candidate.titleId & 0xFFFFFFFF00000000L) == 0x0005000000000000L) {
|
|
||||||
gameInfo* newGameInfo = new gameInfo;
|
gameInfo* newGameInfo = new gameInfo;
|
||||||
newGameInfo->titleId = title_candidate.titleId;
|
newGameInfo->titleId = title_candidate.titleId;
|
||||||
|
newGameInfo->appType = title_candidate.appType;
|
||||||
newGameInfo->gamePath = title_candidate.path;
|
newGameInfo->gamePath = title_candidate.path;
|
||||||
newGameInfo->name = "<unknown>";
|
newGameInfo->name = "<unknown>";
|
||||||
newGameInfo->imageData = NULL;
|
newGameInfo->imageData = NULL;
|
||||||
@ -101,7 +119,6 @@ int32_t GameList::readGameList() {
|
|||||||
titleAdded(newGameInfo);
|
titleAdded(newGameInfo);
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
AsyncExecutor::execute([this] {
|
AsyncExecutor::execute([this] {
|
||||||
lock();
|
lock();
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
typedef struct _gameInfo {
|
typedef struct _gameInfo {
|
||||||
uint64_t titleId;
|
uint64_t titleId;
|
||||||
|
MCPAppType appType;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string gamePath;
|
std::string gamePath;
|
||||||
GuiImageData * imageData;
|
GuiImageData * imageData;
|
||||||
|
Loading…
Reference in New Issue
Block a user