projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added random generator functions (from glib)
[rocksndiamonds.git]
/
src
/
game_bd
/
bd_cave.h
diff --git
a/src/game_bd/bd_cave.h
b/src/game_bd/bd_cave.h
index d97f280fbcf6c255b7fc836009e429671a8db829..d267c36329d5c207e620b2731f9344720c980905 100644
(file)
--- a/
src/game_bd/bd_cave.h
+++ b/
src/game_bd/bd_cave.h
@@
-167,6
+167,7
@@
enum _element_property
E_P_BLOWS_UP_FLIES, /* flies blow up, if they touch this */
E_P_EXPLODES_BY_HIT, /* explodes if hit by a stone */
E_P_BLOWS_UP_FLIES, /* flies blow up, if they touch this */
E_P_EXPLODES_BY_HIT, /* explodes if hit by a stone */
+ E_P_EXPLOSION, /* set for every stage of every explosion. */
E_P_EXPLOSION_FIRST_STAGE, /* set for first stage of every explosion.
helps slower/faster explosions changing */
E_P_EXPLOSION_FIRST_STAGE, /* set for first stage of every explosion.
helps slower/faster explosions changing */
@@
-179,6
+180,8
@@
enum _element_property
E_P_PLAYER, /* easier to find out if it is a player element */
E_P_MOVED_BY_CONVEYOR_TOP, /* can be moved by conveyor belt */
E_P_MOVED_BY_CONVEYOR_BOTTOM, /* can be moved UNDER the conveyor belt */
E_P_PLAYER, /* easier to find out if it is a player element */
E_P_MOVED_BY_CONVEYOR_TOP, /* can be moved by conveyor belt */
E_P_MOVED_BY_CONVEYOR_BOTTOM, /* can be moved UNDER the conveyor belt */
+
+ E_P_COLLECTIBLE, /* can be collected */
};
/* properties */
};
/* properties */
@@
-200,6
+203,7
@@
enum _element_property
#define P_BLOWS_UP_FLIES (1 << E_P_BLOWS_UP_FLIES)
#define P_EXPLODES_BY_HIT (1 << E_P_EXPLODES_BY_HIT)
#define P_BLOWS_UP_FLIES (1 << E_P_BLOWS_UP_FLIES)
#define P_EXPLODES_BY_HIT (1 << E_P_EXPLODES_BY_HIT)
+#define P_EXPLOSION (1 << E_P_EXPLOSION)
#define P_EXPLOSION_FIRST_STAGE (1 << E_P_EXPLOSION_FIRST_STAGE)
#define P_NON_EXPLODABLE (1 << E_P_NON_EXPLODABLE)
#define P_EXPLOSION_FIRST_STAGE (1 << E_P_EXPLOSION_FIRST_STAGE)
#define P_NON_EXPLODABLE (1 << E_P_NON_EXPLODABLE)
@@
-210,6
+214,8
@@
enum _element_property
#define P_MOVED_BY_CONVEYOR_TOP (1 << E_P_MOVED_BY_CONVEYOR_TOP)
#define P_MOVED_BY_CONVEYOR_BOTTOM (1 << E_P_MOVED_BY_CONVEYOR_BOTTOM)
#define P_MOVED_BY_CONVEYOR_TOP (1 << E_P_MOVED_BY_CONVEYOR_TOP)
#define P_MOVED_BY_CONVEYOR_BOTTOM (1 << E_P_MOVED_BY_CONVEYOR_BOTTOM)
+#define P_COLLECTIBLE (1 << E_P_COLLECTIBLE)
+
/* These are states of the magic wall. */
typedef enum _magic_wall_state
{
/* These are states of the magic wall. */
typedef enum _magic_wall_state
{
@@
-318,7
+324,7
@@
typedef struct _gd_cave_replay
GdString player_name; /* who played this */
GdString date; /* when played */
GdString player_name; /* who played this */
GdString date; /* when played */
-
GString *comment;
/* some comments from the player */
+
char *comment;
/* some comments from the player */
int score; /* score collected */
int duration; /* number of seconds played */
int score; /* score collected */
int duration; /* number of seconds played */
@@
-362,8
+368,8
@@
typedef struct _gd_cave
GdString difficulty; /* difficulty of the game, for info purposes */
GdString www; /* link to author's webpage */
GdString date; /* date of creation */
GdString difficulty; /* difficulty of the game, for info purposes */
GdString www; /* link to author's webpage */
GdString date; /* date of creation */
-
GString *story;
/* story for the cave - will be shown when the cave is played. */
-
GString *remark;
/* some note */
+
char *story;
/* story for the cave - will be shown when the cave is played. */
+
char *remark;
/* some note */
GdString charset; /* these are not used by gdash */
GdString fontset;
GdString charset; /* these are not used by gdash */
GdString fontset;
@@
-371,11
+377,11
@@
typedef struct _gd_cave
/* and this one the highscores */
GdHighScore highscore[GD_HIGHSCORE_NUM];
/* and this one the highscores */
GdHighScore highscore[GD_HIGHSCORE_NUM];
-
GHashTable *tags;
/* stores read-but-not-understood strings from bdcff, so we can save them later. */
+
HashTable *tags;
/* stores read-but-not-understood strings from bdcff, so we can save them later. */
GdElement **map; /* pointer to data for map, non-null if has a map */
GdElement **map; /* pointer to data for map, non-null if has a map */
-
G
List *objects;
-
G
List *replays;
+ List *objects;
+ List *replays;
boolean intermission; /* is this cave an intermission? */
boolean intermission_instantlife; /* one life extra, if the intermission is reached */
boolean intermission; /* is this cave an intermission? */
boolean intermission_instantlife; /* one life extra, if the intermission is reached */
@@
-622,7
+628,7
@@
typedef struct _gd_cave
} GdCave;
} GdCave;
-#define CAVE_OFFSET(property) (
G_
STRUCT_OFFSET(GdCave, property))
+#define CAVE_OFFSET(property) (STRUCT_OFFSET(GdCave, property))
/* arrays for movements */
/* also no1 and bd2 cave data import helpers; line direction coordinates */
/* arrays for movements */
/* also no1 and bd2 cave data import helpers; line direction coordinates */
@@
-638,8
+644,8
@@
GdElement gd_get_element_from_string(const char *string);
void gd_cave_init(void);
/* for cave tags hash table */
void gd_cave_init(void);
/* for cave tags hash table */
-
boolean gd_str_case_equal(gconstpointer s1, gconstpointer
s2);
-
guint gd_str_case_hash(gconstpointer
v);
+
int gd_str_case_equal(void *s1, void *
s2);
+
unsigned int gd_str_case_hash(void *
v);
/* cave highscore functions */
int gd_highscore_compare(gconstpointer a, gconstpointer b);
/* cave highscore functions */
int gd_highscore_compare(gconstpointer a, gconstpointer b);
@@
-696,10
+702,9
@@
void gd_drawcave_game(const GdCave *cave, int **element_buffer, int **gfx_buffer
boolean bonus_life_flash, int animcycle, boolean hate_invisible_outbox);
/* function to copy a GdString */
boolean bonus_life_flash, int animcycle, boolean hate_invisible_outbox);
/* function to copy a GdString */
-static inline int
-gd_strcpy(GdString dest, const GdString src)
+static inline char *gd_strcpy(GdString dest, const GdString src)
{
{
- return
g_strl
cpy(dest, src, sizeof(GdString));
+ return
strn
cpy(dest, src, sizeof(GdString));
}
int gd_cave_time_show(const GdCave *cave, int internal_time);
}
int gd_cave_time_show(const GdCave *cave, int internal_time);
@@
-708,10
+713,6
@@
GdReplay *gd_replay_new(void);
GdReplay *gd_replay_new_from_replay(GdReplay *orig);
void gd_replay_free(GdReplay *replay);
void gd_replay_store_movement(GdReplay *replay, GdDirection player_move, boolean player_fire, boolean suicide);
GdReplay *gd_replay_new_from_replay(GdReplay *orig);
void gd_replay_free(GdReplay *replay);
void gd_replay_store_movement(GdReplay *replay, GdDirection player_move, boolean player_fire, boolean suicide);
-boolean gd_replay_get_next_movement(GdReplay *replay, GdDirection *player_move, boolean *player_fire, boolean *suicide);
-void gd_replay_rewind(GdReplay *replay);
-
-char *gd_replay_movements_to_bdcff(GdReplay *replay);
guint32 gd_cave_adler_checksum(GdCave *cave);
void gd_cave_adler_checksum_more(GdCave *cave, guint32 *a, guint32 *b);
guint32 gd_cave_adler_checksum(GdCave *cave);
void gd_cave_adler_checksum_more(GdCave *cave, guint32 *a, guint32 *b);