2 * Copyright (c) 2007, 2008, 2009, Czirkos Zoltan <cirix@fw.hu>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 typedef struct _gd_caveset_data
25 GdString name; // Name of caveset
26 GdString description; // Some words about the caveset
27 GdString author; // Author
28 GdString difficulty; // difficulty of the caveset, for info purposes
29 GdString www; // link to author's webpage
30 GdString date; // date of creation
32 char *story; // story for the caves
33 char *remark; // notes about the game
35 char *title_screen; // base64-encoded title screen image
36 char *title_screen_scroll; // scrolling background for title screen image
38 GdString charset; // these are not used by gdash
41 // these are only for a game.
42 int initial_lives; // initial lives at game start
43 int maximum_lives; // maximum lives
44 int bonus_life_score; // bonus life / number of points
46 // and this one the highscores
47 GdHighScore highscore[GD_HIGHSCORE_NUM];
49 char *levelset_subdir; // current level set identifier
52 extern const GdStructDescriptor gd_caveset_properties[];
54 extern GdCavesetData *gd_caveset_data;
55 extern List *gd_caveset;
56 extern boolean gd_caveset_edited;
57 extern int gd_caveset_last_selected;
58 extern int gd_caveset_last_selected_level;
60 extern char *gd_caveset_extensions[];
62 // #included cavesets; configdir passed to look for .hsc file
63 boolean gd_caveset_load_from_internal(int caveset, const char *configdir);
64 const char **gd_caveset_get_internal_game_names(void);
66 // caveset load from file
67 boolean gd_caveset_load_from_file(char *filename);
68 // caveset save to bdcff file
69 boolean gd_caveset_save_to_file(const char *filename);
71 // misc caveset functions
72 int gd_caveset_count(void);
73 void gd_caveset_clear(void);
74 GdCave *gd_return_nth_cave(const int cave);
76 GdCave *gd_get_original_cave_from_caveset(const int cave);
77 GdCave *gd_get_prepared_cave_from_caveset(const int cave, const int level);
78 GdCave *gd_get_prepared_cave(const GdCave *cave, const int level);
80 // highscore in config directory
81 void gd_save_highscore(const char* directory);
82 boolean gd_load_highscore(const char *directory);
84 GdCavesetData *gd_caveset_data_new(void);
85 void gd_caveset_data_free(GdCavesetData *data);
87 // check replays and optionally remove
88 int gd_cave_check_replays(GdCave *cave, boolean report, boolean remove, boolean repair);
90 boolean gd_caveset_has_replays(void);
92 #endif // BD_CAVESET_H