mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-29 15:04:23 +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->name = xstrdup(name);
|
||||||
this->author = xstrdup(author);
|
this->author = xstrdup(author);
|
||||||
this->screenshot = image;
|
this->screenshot = image;
|
||||||
|
this->score = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameInfo::GameInfo(GameInfo *gi)
|
GameInfo::GameInfo(GameInfo *gi)
|
||||||
@ -203,17 +204,22 @@ void GameInfo::setAuthor(const char *author)
|
|||||||
{
|
{
|
||||||
free((void*)this->author);
|
free((void*)this->author);
|
||||||
this->author = xstrdup(author);
|
this->author = xstrdup(author);
|
||||||
|
if (strcmp(author, " ") != 0)
|
||||||
|
this->score++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameInfo::setName(const char *name)
|
void GameInfo::setName(const char *name)
|
||||||
{
|
{
|
||||||
free((void*)this->name);
|
free((void*)this->name);
|
||||||
this->name = xstrdup(name);
|
this->name = xstrdup(name);
|
||||||
|
if (strcmp(name, " ") != 0)
|
||||||
|
this->score++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GameInfo::setScreenshot(SDL_Surface *scr)
|
void GameInfo::setScreenshot(SDL_Surface *scr)
|
||||||
{
|
{
|
||||||
SDL_FreeSurface(this->screenshot);
|
SDL_FreeSurface(this->screenshot);
|
||||||
this->screenshot = scr;
|
this->screenshot = scr;
|
||||||
|
if (scr != NULL)
|
||||||
|
this->score++;
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,8 @@ public:
|
|||||||
const char *author;
|
const char *author;
|
||||||
const char *filename;
|
const char *filename;
|
||||||
SDL_Surface *screenshot;
|
SDL_Surface *screenshot;
|
||||||
|
|
||||||
|
Uint16 score;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*__GAME_INFO_HH__ */
|
#endif /*__GAME_INFO_HH__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user