2011-10-21 20:48:10 +02:00
|
|
|
#ifndef GAMETDB_TITLES_H_
|
|
|
|
#define GAMETDB_TITLES_H_
|
2010-10-28 11:00:52 +02:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <gctypes.h>
|
|
|
|
#include "usbloader/disc.h"
|
|
|
|
|
|
|
|
typedef struct _GameTitle
|
|
|
|
{
|
2011-07-26 00:28:22 +02:00
|
|
|
char GameID[7];
|
|
|
|
std::string Title;
|
|
|
|
int ParentalRating;
|
|
|
|
int PlayersCount;
|
2012-01-08 19:24:46 +01:00
|
|
|
char FromWiiTDB;
|
2010-10-28 11:00:52 +02:00
|
|
|
|
|
|
|
} GameTitle;
|
|
|
|
|
|
|
|
class CGameTitles
|
|
|
|
{
|
2011-07-26 00:28:22 +02:00
|
|
|
public:
|
2011-10-21 20:48:10 +02:00
|
|
|
//! Set a game title from GameTDB
|
2011-07-26 00:28:22 +02:00
|
|
|
void SetGameTitle(const char * id, const char * title);
|
|
|
|
//! Overload
|
|
|
|
void SetGameTitle(const u8 * id, const char * title) { SetGameTitle((const char *) id, title); };
|
|
|
|
|
|
|
|
//! Get a game title
|
|
|
|
const char * GetTitle(const char * id) const;
|
|
|
|
//! Overload
|
|
|
|
const char * GetTitle(const u8 * id) const { return GetTitle((const char *) id); };
|
|
|
|
//! Overload
|
|
|
|
const char * GetTitle(const struct discHdr *header) const;
|
|
|
|
|
|
|
|
//! Get game parental rating
|
|
|
|
int GetParentalRating(const char * id) const;
|
|
|
|
//! Get possible number of players for this game
|
|
|
|
int GetPlayersCount(const char * id) const;
|
2011-10-21 20:48:10 +02:00
|
|
|
//! Load Game Titles from GameTDB
|
2012-01-08 19:24:46 +01:00
|
|
|
void LoadTitlesFromGameTDB(const char * path, bool removeUnused = true);
|
2011-07-26 00:28:22 +02:00
|
|
|
//! Set default game titles
|
|
|
|
void SetDefault();
|
|
|
|
//! Free memory and remove all titles - Same as SetDefault()
|
|
|
|
void Clear() { SetDefault(); }
|
2012-01-08 19:24:46 +01:00
|
|
|
//! Cache titles functions
|
2011-07-26 00:28:22 +02:00
|
|
|
u32 ReadCachedTitles(const char * path);
|
|
|
|
void WriteCachedTitles(const char * path);
|
2012-01-08 19:24:46 +01:00
|
|
|
protected:
|
2011-12-22 23:44:48 +01:00
|
|
|
void GetMissingTitles(std::vector<std::string> &MissingTitles, bool removeUnused);
|
2011-07-26 00:28:22 +02:00
|
|
|
|
|
|
|
std::vector<GameTitle> TitleList;
|
2010-10-28 11:00:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern CGameTitles GameTitles;
|
|
|
|
|
|
|
|
#endif
|