2010-01-25 14:01:22 +01:00
|
|
|
#ifndef __GAME_INFO_HH__
|
|
|
|
#define __GAME_INFO_HH__
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
|
2010-01-30 21:03:17 +01:00
|
|
|
/* This is just a link to some other file (filename is the link) */
|
|
|
|
#define F_IS_LINK (1 << 0)
|
|
|
|
|
2010-03-26 07:34:58 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
GENRE_UNKNOWN = 0,
|
|
|
|
GENRE_ACTION = 1,
|
|
|
|
GENRE_ADVENTURE = 2,
|
|
|
|
GENRE_SIMULATION = 3,
|
|
|
|
GENRE_PUZZLE = 4,
|
|
|
|
};
|
|
|
|
|
2010-03-27 08:33:06 +01:00
|
|
|
struct game_info;
|
2010-01-25 14:01:22 +01:00
|
|
|
|
|
|
|
class GameInfo
|
|
|
|
{
|
|
|
|
public:
|
2010-01-30 14:03:53 +01:00
|
|
|
GameInfo(const char *filename = "unknown", const char *name = " ",
|
2010-03-26 07:34:58 +01:00
|
|
|
const char *publisher = " ",
|
|
|
|
const char *creator = " ",
|
2010-03-18 13:23:11 +01:00
|
|
|
const char *musician = " ",
|
2010-01-25 14:01:22 +01:00
|
|
|
SDL_Surface *image = NULL);
|
|
|
|
|
|
|
|
GameInfo(GameInfo *gi);
|
|
|
|
|
|
|
|
~GameInfo();
|
|
|
|
|
|
|
|
void setAuthor(const char *author);
|
|
|
|
|
|
|
|
void setName(const char *name);
|
|
|
|
|
2010-01-31 08:58:48 +01:00
|
|
|
void setYear(uint16_t year);
|
|
|
|
|
2010-01-30 20:03:10 +01:00
|
|
|
void setScreenshot(SDL_Surface *scr);
|
|
|
|
|
2010-01-25 14:01:22 +01:00
|
|
|
void resetDefaults();
|
|
|
|
|
|
|
|
/** Returns an allocated dump structure */
|
2010-03-27 08:33:06 +01:00
|
|
|
void *dump(size_t *out_sz);
|
2010-01-25 14:01:22 +01:00
|
|
|
|
|
|
|
/** Fill in this game info object from a structure */
|
|
|
|
bool fromDump(struct game_info *data);
|
|
|
|
|
|
|
|
static GameInfo *loadFromFile(const char *fileName);
|
|
|
|
|
|
|
|
/* Should perhaps be protected but I trust you - just be careful! */
|
|
|
|
const char *name;
|
2010-03-26 07:34:58 +01:00
|
|
|
const char *publisher;
|
2010-01-25 14:01:22 +01:00
|
|
|
const char *filename;
|
2010-03-26 07:34:58 +01:00
|
|
|
const char *creator;
|
|
|
|
const char *musician;
|
2010-01-25 14:01:22 +01:00
|
|
|
SDL_Surface *screenshot;
|
2010-01-30 20:06:18 +01:00
|
|
|
|
2010-03-26 07:34:58 +01:00
|
|
|
uint16_t genre;
|
|
|
|
uint16_t players;
|
2010-01-31 08:58:48 +01:00
|
|
|
uint16_t year;
|
|
|
|
uint16_t score;
|
2010-01-25 14:01:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /*__GAME_INFO_HH__ */
|