mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-26 05:24:21 +01:00
Add a score associated with updating the game info
This commit is contained in:
parent
b3a33134aa
commit
0f6cc25ae5
@ -34,6 +34,7 @@ GameInfo::GameInfo(const char *filename,
|
||||
this->name = xstrdup(name);
|
||||
this->author = xstrdup(author);
|
||||
this->screenshot = image;
|
||||
this->score = 0;
|
||||
}
|
||||
|
||||
GameInfo::GameInfo(GameInfo *gi)
|
||||
@ -203,17 +204,22 @@ void GameInfo::setAuthor(const char *author)
|
||||
{
|
||||
free((void*)this->author);
|
||||
this->author = xstrdup(author);
|
||||
if (strcmp(author, " ") != 0)
|
||||
this->score++;
|
||||
}
|
||||
|
||||
void GameInfo::setName(const char *name)
|
||||
{
|
||||
free((void*)this->name);
|
||||
this->name = xstrdup(name);
|
||||
if (strcmp(name, " ") != 0)
|
||||
this->score++;
|
||||
}
|
||||
|
||||
|
||||
void GameInfo::setScreenshot(SDL_Surface *scr)
|
||||
{
|
||||
SDL_FreeSurface(this->screenshot);
|
||||
this->screenshot = scr;
|
||||
if (scr != NULL)
|
||||
this->score++;
|
||||
}
|
||||
|
@ -50,6 +50,8 @@ public:
|
||||
const char *author;
|
||||
const char *filename;
|
||||
SDL_Surface *screenshot;
|
||||
|
||||
Uint16 score;
|
||||
};
|
||||
|
||||
#endif /*__GAME_INFO_HH__ */
|
||||
|
Loading…
Reference in New Issue
Block a user