* Fixed label "Genre" in game info. It should now always the show right genre (issue 10)

This commit is contained in:
overjoy.psm 2012-02-13 00:22:56 +00:00
parent 08c018539d
commit 128254c489
3 changed files with 9 additions and 7 deletions

View File

@ -30,6 +30,7 @@
#include "video.hpp" #include "video.hpp"
#include "gecko.h" #include "gecko.h"
#include "defines.h" #include "defines.h"
#include "text.hpp"
#define NAME_OFFSET_DB "gametdb_offsets.bin" #define NAME_OFFSET_DB "gametdb_offsets.bin"
#define MAXREADSIZE 1024*1024 // Cache size only for parsing the offsets: 1MB #define MAXREADSIZE 1024*1024 // Cache size only for parsing the offsets: 1MB
@ -638,8 +639,10 @@ unsigned int GameTDB::GetPublishDate(const char * id)
return ((year & 0xFFFF) << 16 | (month & 0xFF) << 8 | (day & 0xFF)); return ((year & 0xFFFF) << 16 | (month & 0xFF) << 8 | (day & 0xFF));
} }
bool GameTDB::GetGenres(const char * id, safe_vector<string> & genre) bool GameTDB::GetGenres(const char * id, string & gen)
{ {
safe_vector<string> genre;
if(!id) return false; if(!id) return false;
char * data = GetGameNode(id); char * data = GetGameNode(id);
@ -679,6 +682,8 @@ bool GameTDB::GetGenres(const char * id, safe_vector<string> & genre)
genre[genre_num].push_back('\0'); genre[genre_num].push_back('\0');
delete [] data; delete [] data;
gen = vectorToString(genre, ", ");
return true; return true;
} }

View File

@ -44,7 +44,7 @@ typedef struct _GameXMLInfo
string Developer; string Developer;
string Publisher; string Publisher;
unsigned int PublishDate; unsigned int PublishDate;
safe_vector<string> Genres; string Genres;
int RatingType; int RatingType;
string RatingValue; string RatingValue;
safe_vector<string> RatingDescriptors; safe_vector<string> RatingDescriptors;
@ -99,7 +99,7 @@ class GameTDB
//! year = (return >> 16), month = (return >> 8) & 0xFF, day = return & 0xFF //! year = (return >> 16), month = (return >> 8) & 0xFF, day = return & 0xFF
unsigned int GetPublishDate(const char * id); unsigned int GetPublishDate(const char * id);
//! Get the genre list of a game for a specific game id //! Get the genre list of a game for a specific game id
bool GetGenres(const char * id, safe_vector<string> & genre); bool GetGenres(const char * id, string & gen);
//! Get the rating type for a specific game id //! Get the rating type for a specific game id
//! The rating type can be converted to a string with GameTDB::RatingToString(rating) //! The rating type can be converted to a string with GameTDB::RatingToString(rating)
int GetRating(const char * id); int GetRating(const char * id);

View File

@ -313,10 +313,7 @@ void CMenu::_textGameInfo(void)
m_btnMgr.setText(m_gameinfoLblDev, wfmt(_fmt("gameinfo1",L"Developer: %s"), gameinfo.Developer.c_str()), true); m_btnMgr.setText(m_gameinfoLblDev, wfmt(_fmt("gameinfo1",L"Developer: %s"), gameinfo.Developer.c_str()), true);
m_btnMgr.setText(m_gameinfoLblPublisher, wfmt(_fmt("gameinfo2",L"Publisher: %s"), gameinfo.Publisher.c_str()), true); m_btnMgr.setText(m_gameinfoLblPublisher, wfmt(_fmt("gameinfo2",L"Publisher: %s"), gameinfo.Publisher.c_str()), true);
m_btnMgr.setText(m_gameinfoLblRegion, wfmt(_fmt("gameinfo3",L"Region: %s"), gameinfo.Region.c_str()), true); m_btnMgr.setText(m_gameinfoLblRegion, wfmt(_fmt("gameinfo3",L"Region: %s"), gameinfo.Region.c_str()), true);
m_btnMgr.setText(m_gameinfoLblGenre, wfmt(_fmt("gameinfo5",L"Genre: %s"), gameinfo.Genres.c_str()), true);
string wGenres = vectorToString(gameinfo.Genres, ", ");
m_btnMgr.setText(m_gameinfoLblGenre, wfmt(_fmt("gameinfo5",L"Genre: %s"), wGenres.c_str()), true);
// m_btnMgr.setText(m_gameinfoLblGenre, wfmt(_fmt("gameinfo5",L"Genre: %s"), gameinfo.Genre.c_str()), true);
int year = gameinfo.PublishDate >> 16; int year = gameinfo.PublishDate >> 16;
int day = gameinfo.PublishDate & 0xFF; int day = gameinfo.PublishDate & 0xFF;