usbloadergx/source/usbloader/GetMissingGameFiles.cpp
strtoul 616b1bdf4c - add check for the covers of the currently inserted disc to the cover downloader (is checked with the other games in the list)
- fix booting wii discs when starting without a HDD (channel mode)
- add parental control option to block priiloader override on return to system menu
- add prompt asking for downloading new language files when trying to update and no language files exist yet
- reduced amount of checks for inserted disc (now every 100ms)
- fixed booting gamecube games (datatype bug for mount method)
- fix winnertag for gamecube games
- add per game nand emu path setting
2011-12-20 21:41:00 +00:00

74 lines
2.1 KiB
C++

#include <stdio.h>
#include <string>
#include <vector>
#include "FileOperations/fileops.h"
#include "usbloader/GameList.h"
#include "wstring.hpp"
#include "gecko.h"
extern struct discHdr *dvdheader;
/**************************************************************************************
* FindMissingFiles
* Inputs:
* path - Path to search in with. example "SD:/covers/"
* fileext - the file extension. example ".png"
* MissingFilesList - string vector where the IDs of missing game files will be put in.
**************************************************************************************/
int GetMissingGameFiles(const char * path, const char * fileext, std::vector<std::string> & MissingFilesList)
{
char gameID[7];
char filepath[512];
MissingFilesList.clear();
wString oldFilter(gameList.GetCurrentFilter());
//! make sure that all games are added to the gamelist
gameList.LoadUnfiltered();
for (int i = 0; i < gameList.size(); ++i)
{
struct discHdr* header = gameList[i];
snprintf(gameID, sizeof(gameID), "%s", (char *) header->id);
snprintf(filepath, sizeof(filepath), "%s/%s%s", path, gameID, fileext);
if (CheckFile(filepath))
continue;
//! Not found. Try 4 ID path.
gameID[4] = '\0';
snprintf(filepath, sizeof(filepath), "%s/%s%s", path, gameID, fileext);
if (CheckFile(filepath))
continue;
//! Not found. Try 3 ID path.
gameID[3] = '\0';
snprintf(filepath, sizeof(filepath), "%s/%s%s", path, gameID, fileext);
if (CheckFile(filepath))
continue;
//! Not found add to missing list
snprintf(gameID, sizeof(gameID), "%s", (char *) header->id);
MissingFilesList.push_back(std::string(gameID));
}
if(dvdheader)
{
snprintf(gameID, sizeof(gameID), "%s", (char *) dvdheader->id);
snprintf(filepath, sizeof(filepath), "%s/%s%s", path, gameID, fileext);
if (!CheckFile(filepath)) {
//! Not found, add missing dvd header to list
MissingFilesList.push_back(std::string(gameID));
}
}
//! Bring game list to the old state
gameList.FilterList(oldFilter.c_str());
gprintf(" = %i", MissingFilesList.size());
return MissingFilesList.size();
}